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>
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/branch.h"
85 #include "scip/conflict.h"
86 #include "scip/cons.h"
87 #include "scip/dialog.h"
88 #include "scip/disp.h"
89 #include "scip/heur.h"
90 #include "scip/concsolver.h"
91 #include "scip/compr.h"
92 #include "scip/nodesel.h"
93 #include "scip/reader.h"
94 #include "scip/presol.h"
95 #include "scip/pricer.h"
96 #include "scip/relax.h"
97 #include "scip/sepa.h"
98 #include "scip/prop.h"
99 #include "nlpi/nlpi.h"
100 #include "nlpi/exprinterpret.h"
101 #include "scip/debug.h"
102 #include "scip/dialog_default.h"
103 #include "scip/message_default.h"
104 #include "scip/syncstore.h"
105 #include "scip/concurrent.h"
106 #include "xml/xml.h"
107 
108 /* We include the linear constraint handler to be able to copy a (multi)aggregation of variables (to a linear constraint).
109  * The better way would be to handle the distinction between original and transformed variables via a flag 'isoriginal'
110  * in the variable data structure. This would allow to have (multi)aggregated variables in the original problem.
111  *
112  * A second reason for including the linear constraint handler is for copying cuts to linear constraints.
113  */
114 #include "scip/cons_linear.h"
115 
116 /* We need to include the branching and the heurtistics for reoptimization after creating the reoptimization because we
117  * do not want to use these plugins by default if reoptimization is disabled. */
118 #include "scip/branch_nodereopt.h"
119 #include "scip/heur_reoptsols.h"
121 #include "scip/heur_ofins.h"
122 
123 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
124  * this structure except the interface methods in scip.c.
125  * In optimized mode, the structure is included in scip.h, because some of the methods
126  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
127  */
128 #ifndef NDEBUG
129 #include "scip/struct_scip.h"
130 #endif
131 
132 /*
133  * Local methods
134  */
135 
136 
137 /** checks, if SCIP is in one of the feasible stages */
138 #ifndef NDEBUG
139 static
141  SCIP* scip, /**< SCIP data structure */
142  const char* method, /**< method that was called */
143  SCIP_Bool init, /**< may method be called in the INIT stage? */
144  SCIP_Bool problem, /**< may method be called in the PROBLEM stage? */
145  SCIP_Bool transforming, /**< may method be called in the TRANSFORMING stage? */
146  SCIP_Bool transformed, /**< may method be called in the TRANSFORMED stage? */
147  SCIP_Bool initpresolve, /**< may method be called in the INITPRESOLVE stage? */
148  SCIP_Bool presolving, /**< may method be called in the PRESOLVING stage? */
149  SCIP_Bool exitpresolve, /**< may method be called in the EXITPRESOLE stage? */
150  SCIP_Bool presolved, /**< may method be called in the PRESOLVED stage? */
151  SCIP_Bool initsolve, /**< may method be called in the INITSOLVE stage? */
152  SCIP_Bool solving, /**< may method be called in the SOLVING stage? */
153  SCIP_Bool solved, /**< may method be called in the SOLVED stage? */
154  SCIP_Bool exitsolve, /**< may method be called in the EXITSOLVE stage? */
155  SCIP_Bool freetrans, /**< may method be called in the FREETRANS stage? */
156  SCIP_Bool freescip /**< may method be called in the FREE stage? */
157  )
158 {
159  assert(scip != NULL);
160  assert(method != NULL);
161 
162  /*SCIPdebugMsg(scip, "called method <%s> at stage %d ------------------------------------------------\n",
163  method, scip->set->stage);*/
164 
165  assert(scip->mem != NULL);
166  assert(scip->set != NULL);
167  assert(scip->interrupt != NULL);
168  assert(scip->dialoghdlr != NULL);
169  assert(scip->totaltime != NULL);
170 
171  switch( scip->set->stage )
172  {
173  case SCIP_STAGE_INIT:
174  assert(scip->stat == NULL);
175  assert(scip->origprob == NULL);
176  assert(scip->eventfilter == NULL);
177  assert(scip->eventqueue == NULL);
178  assert(scip->branchcand == NULL);
179  assert(scip->lp == NULL);
180  assert(scip->nlp == NULL);
181  assert(scip->primal == NULL);
182  assert(scip->tree == NULL);
183  assert(scip->conflict == NULL);
184  assert(scip->transprob == NULL);
185  assert(scip->pricestore == NULL);
186  assert(scip->sepastore == NULL);
187  assert(scip->cutpool == NULL);
188  assert(scip->delayedcutpool == NULL);
189 
190  if( !init )
191  {
192  SCIPerrorMessage("cannot call method <%s> in initialization stage\n", method);
193  return SCIP_INVALIDCALL;
194  }
195  return SCIP_OKAY;
196 
197  case SCIP_STAGE_PROBLEM:
198  assert(scip->stat != NULL);
199  assert(scip->origprob != NULL);
200  assert(scip->eventfilter == NULL);
201  assert(scip->eventqueue == NULL);
202  assert(scip->branchcand == NULL);
203  assert(scip->lp == NULL);
204  assert(scip->nlp == NULL);
205  assert(scip->primal == NULL);
206  assert(scip->tree == NULL);
207  assert(scip->conflict == NULL);
208  assert(scip->transprob == NULL);
209  assert(scip->pricestore == NULL);
210  assert(scip->sepastore == NULL);
211  assert(scip->cutpool == NULL);
212  assert(scip->delayedcutpool == NULL);
213 
214  if( !problem )
215  {
216  SCIPerrorMessage("cannot call method <%s> in problem creation stage\n", method);
217  return SCIP_INVALIDCALL;
218  }
219  return SCIP_OKAY;
220 
222  assert(scip->stat != NULL);
223  assert(scip->origprob != NULL);
224  assert(scip->eventfilter != NULL);
225  assert(scip->eventqueue != NULL);
226  assert(scip->branchcand != NULL);
227  assert(scip->lp != NULL);
228  assert(scip->primal != NULL);
229  assert(scip->tree != NULL);
230  assert(scip->conflict != NULL);
231  assert(scip->transprob != NULL);
232  assert(scip->pricestore == NULL);
233  assert(scip->sepastore == NULL);
234  assert(scip->cutpool == NULL);
235  assert(scip->delayedcutpool == NULL);
236 
237  if( !transforming )
238  {
239  SCIPerrorMessage("cannot call method <%s> in problem transformation stage\n", method);
240  return SCIP_INVALIDCALL;
241  }
242  return SCIP_OKAY;
243 
245  assert(scip->stat != NULL);
246  assert(scip->origprob != NULL);
247  assert(scip->eventfilter != NULL);
248  assert(scip->eventqueue != NULL);
249  assert(scip->branchcand != NULL);
250  assert(scip->lp != NULL);
251  assert(scip->primal != NULL);
252  assert(scip->tree != NULL);
253  assert(scip->conflict != NULL);
254  assert(scip->transprob != NULL);
255  assert(scip->pricestore == NULL);
256  assert(scip->sepastore == NULL);
257  assert(scip->cutpool == NULL);
258  assert(scip->delayedcutpool == NULL);
259 
260  if( !transformed )
261  {
262  SCIPerrorMessage("cannot call method <%s> in problem transformed stage\n", method);
263  return SCIP_INVALIDCALL;
264  }
265  return SCIP_OKAY;
266 
268  assert(scip->stat != NULL);
269  assert(scip->origprob != NULL);
270  assert(scip->eventfilter != NULL);
271  assert(scip->eventqueue != NULL);
272  assert(scip->branchcand != NULL);
273  assert(scip->lp != NULL);
274  assert(scip->primal != NULL);
275  assert(scip->tree != NULL);
276  assert(scip->conflict != NULL);
277  assert(scip->transprob != NULL);
278  assert(scip->pricestore == NULL);
279  assert(scip->sepastore == NULL);
280  assert(scip->cutpool == NULL);
281  assert(scip->delayedcutpool == NULL);
282 
283  if( !initpresolve )
284  {
285  SCIPerrorMessage("cannot call method <%s> in init presolving stage\n", method);
286  return SCIP_INVALIDCALL;
287  }
288  return SCIP_OKAY;
289 
291  assert(scip->stat != NULL);
292  assert(scip->origprob != NULL);
293  assert(scip->eventfilter != NULL);
294  assert(scip->eventqueue != NULL);
295  assert(scip->branchcand != NULL);
296  assert(scip->lp != NULL);
297  assert(scip->primal != NULL);
298  assert(scip->tree != NULL);
299  assert(scip->conflict != NULL);
300  assert(scip->transprob != NULL);
301  assert(scip->pricestore == NULL);
302  assert(scip->sepastore == NULL);
303  assert(scip->cutpool == NULL);
304  assert(scip->delayedcutpool == NULL);
305 
306  if( !presolving )
307  {
308  SCIPerrorMessage("cannot call method <%s> in presolving stage\n", method);
309  return SCIP_INVALIDCALL;
310  }
311  return SCIP_OKAY;
312 
314  assert(scip->stat != NULL);
315  assert(scip->origprob != NULL);
316  assert(scip->eventfilter != NULL);
317  assert(scip->eventqueue != NULL);
318  assert(scip->branchcand != NULL);
319  assert(scip->lp != NULL);
320  assert(scip->primal != NULL);
321  assert(scip->tree != NULL);
322  assert(scip->conflict != NULL);
323  assert(scip->transprob != NULL);
324  assert(scip->pricestore == NULL);
325  assert(scip->sepastore == NULL);
326  assert(scip->cutpool == NULL);
327  assert(scip->delayedcutpool == NULL);
328 
329  if( !exitpresolve )
330  {
331  SCIPerrorMessage("cannot call method <%s> in exit presolving stage\n", method);
332  return SCIP_INVALIDCALL;
333  }
334  return SCIP_OKAY;
335 
337  assert(scip->stat != NULL);
338  assert(scip->origprob != NULL);
339  assert(scip->eventfilter != NULL);
340  assert(scip->eventqueue != NULL);
341  assert(scip->branchcand != NULL);
342  assert(scip->lp != NULL);
343  assert(scip->primal != NULL);
344  assert(scip->tree != NULL);
345  assert(scip->conflict != NULL);
346  assert(scip->transprob != NULL);
347  assert(scip->pricestore == NULL);
348  assert(scip->sepastore == NULL);
349  assert(scip->cutpool == NULL);
350  assert(scip->delayedcutpool == NULL);
351 
352  if( !presolved )
353  {
354  SCIPerrorMessage("cannot call method <%s> in problem presolved stage\n", method);
355  return SCIP_INVALIDCALL;
356  }
357  return SCIP_OKAY;
358 
360  assert(scip->stat != NULL);
361  assert(scip->origprob != NULL);
362  assert(scip->eventfilter != NULL);
363  assert(scip->eventqueue != NULL);
364  assert(scip->branchcand != NULL);
365  assert(scip->lp != NULL);
366  assert(scip->primal != NULL);
367  assert(scip->tree != NULL);
368  assert(scip->transprob != NULL);
369 
370  if( !initsolve )
371  {
372  SCIPerrorMessage("cannot call method <%s> in init solve stage\n", method);
373  return SCIP_INVALIDCALL;
374  }
375  return SCIP_OKAY;
376 
377  case SCIP_STAGE_SOLVING:
378  assert(scip->stat != NULL);
379  assert(scip->origprob != NULL);
380  assert(scip->eventfilter != NULL);
381  assert(scip->eventqueue != NULL);
382  assert(scip->branchcand != NULL);
383  assert(scip->lp != NULL);
384  assert(scip->primal != NULL);
385  assert(scip->tree != NULL);
386  assert(scip->conflict != NULL);
387  assert(scip->transprob != NULL);
388  assert(scip->pricestore != NULL);
389  assert(scip->sepastore != NULL);
390  assert(scip->cutpool != NULL);
391  assert(scip->delayedcutpool != NULL);
392 
393  if( !solving )
394  {
395  SCIPerrorMessage("cannot call method <%s> in solving stage\n", method);
396  return SCIP_INVALIDCALL;
397  }
398  return SCIP_OKAY;
399 
400  case SCIP_STAGE_SOLVED:
401  assert(scip->stat != NULL);
402  assert(scip->origprob != NULL);
403  assert(scip->eventfilter != NULL);
404  assert(scip->eventqueue != NULL);
405  assert(scip->branchcand != NULL);
406  assert(scip->lp != NULL);
407  assert(scip->primal != NULL);
408  assert(scip->tree != NULL);
409  assert(scip->conflict != NULL);
410  assert(scip->transprob != NULL);
411  assert(scip->pricestore != NULL);
412  assert(scip->sepastore != NULL);
413  assert(scip->cutpool != NULL);
414  assert(scip->delayedcutpool != NULL);
415 
416  if( !solved )
417  {
418  SCIPerrorMessage("cannot call method <%s> in problem solved stage\n", method);
419  return SCIP_INVALIDCALL;
420  }
421  return SCIP_OKAY;
422 
424  assert(scip->stat != NULL);
425  assert(scip->origprob != NULL);
426  assert(scip->eventfilter != NULL);
427  assert(scip->eventqueue != NULL);
428  assert(scip->branchcand != NULL);
429  assert(scip->lp != NULL);
430  assert(scip->primal != NULL);
431  assert(scip->tree != NULL);
432  assert(scip->transprob != NULL);
433 
434  if( !exitsolve )
435  {
436  SCIPerrorMessage("cannot call method <%s> in solve deinitialization stage\n", method);
437  return SCIP_INVALIDCALL;
438  }
439  return SCIP_OKAY;
440 
442  assert(scip->stat != NULL);
443  assert(scip->origprob != NULL);
444  assert(scip->pricestore == NULL);
445  assert(scip->sepastore == NULL);
446  assert(scip->cutpool == NULL);
447  assert(scip->delayedcutpool == NULL);
448 
449  if( !freetrans )
450  {
451  SCIPerrorMessage("cannot call method <%s> in free transformed problem stage\n", method);
452  return SCIP_INVALIDCALL;
453  }
454  return SCIP_OKAY;
455 
456  case SCIP_STAGE_FREE:
457  if( !freescip )
458  {
459  SCIPerrorMessage("cannot call method <%s> in free stage\n", method);
460  return SCIP_INVALIDCALL;
461  }
462  return SCIP_OKAY;
463 
464  default:
465  /* note that this is in an internal SCIP error since all SCIP stages are covert in the switch above */
466  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
467  return SCIP_ERROR;
468  }
469 }
470 #else
471 #define checkStage(scip,method,init,problem,transforming,transformed,initpresolve,presolving,exitpresolve,presolved, \
472  initsolve,solving,solved,exitsolve,freetrans,freescip) SCIP_OKAY
473 #endif
474 
475 /** gets global lower (dual) bound in transformed problem */
476 static
478  SCIP* scip /**< SCIP data structure */
479  )
480 {
481  if( scip->set->stage <= SCIP_STAGE_INITSOLVE )
482  return -SCIPinfinity(scip);
483 
484  return SCIPtreeGetLowerbound(scip->tree, scip->set);
485 }
486 
487 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit) */
488 static
490  SCIP* scip /**< SCIP data structure */
491  )
492 {
493  if( SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED )
494  return -SCIPinfinity(scip);
495  else
496  return scip->primal->upperbound;
497 }
498 
499 
500 /** gets global primal bound (objective value of best solution or user objective limit) */
501 static
503  SCIP* scip /**< SCIP data structure */
504  )
505 {
506  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, getUpperbound(scip));
507 }
508 
509 /** gets global dual bound */
510 static
512  SCIP* scip /**< SCIP data structure */
513  )
514 {
515  SCIP_Real lowerbound;
516 
517  if( scip->set->stage <= SCIP_STAGE_INITSOLVE )
518  {
519  /* in case we are in presolving we use the stored dual bound if it exits, otherwise, minus or plus infinity
520  * depending on the objective sense
521  */
522  if( scip->transprob->dualbound < SCIP_INVALID )
523  lowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
524  else
525  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, -SCIPinfinity(scip));
526  }
527  else
528  lowerbound = SCIPtreeGetLowerbound(scip->tree, scip->set);
529 
530  if( SCIPsetIsInfinity(scip->set, lowerbound) )
531  {
532  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
533  * dual bound = -inf instead of dual bound = primal bound = +inf
534  * also in case we prove that the problem is unbounded, it seems to make sense to return with dual bound = -inf,
535  * since -infinity is the only valid lower bound
536  */
538  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, -SCIPinfinity(scip));
539  else
540  return getPrimalbound(scip);
541  }
542  else
543  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, lowerbound);
544 }
545 
546 /*
547  * miscellaneous methods
548  */
549 
550 /** returns complete SCIP version number in the format "major . minor tech"
551  *
552  * @return complete SCIP version
553  */
555  void
556  )
557 {
558  return (SCIP_Real)(SCIP_VERSION)/100.0;
559 }
560 
561 /** returns SCIP major version
562  *
563  * @return major SCIP version
564  */
566  void
567  )
568 {
569  return SCIP_VERSION/100;
570 }
571 
572 /** returns SCIP minor version
573  *
574  * @return minor SCIP version
575  */
577  void
578  )
579 {
580  return (SCIP_VERSION/10) % 10; /*lint !e778*/
581 }
582 
583 /** returns SCIP technical version
584  *
585  * @return technical SCIP version
586  */
588  void
589  )
590 {
591  return SCIP_VERSION % 10; /*lint !e778*/
592 }
593 
594 /** returns SCIP sub version number
595  *
596  * @return subversion SCIP version
597  */
599  void
600  )
601 {
602  return SCIP_SUBVERSION;
603 }
604 
605 /** prints a version information line to a file stream via the message handler system
606  *
607  * @note If the message handler is set to a NULL pointer nothing will be printed
608  */
610  SCIP* scip, /**< SCIP data structure */
611  FILE* file /**< output file (or NULL for standard output) */
612  )
613 {
614  assert( scip != NULL );
615 
616  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP version %d.%d.%d",
618 #if SCIP_SUBVERSION > 0
619  SCIPmessageFPrintInfo(scip->messagehdlr, file, ".%d", SCIPsubversion());
620 #endif
621 
622  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [precision: %d byte]", (int)sizeof(SCIP_Real));
623 
624 #ifndef BMS_NOBLOCKMEM
625  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [memory: block]");
626 #else
627  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [memory: standard]");
628 #endif
629 #ifndef NDEBUG
630  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [mode: debug]");
631 #else
632  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [mode: optimized]");
633 #endif
634  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [LP solver: %s]", SCIPlpiGetSolverName());
635  SCIPmessageFPrintInfo(scip->messagehdlr, file, " [GitHash: %s]", SCIPgetGitHash());
636  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
637  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%s\n", SCIP_COPYRIGHT);
638 }
639 
640 /** prints detailed information on the compile-time flags
641  *
642  * @note If the message handler is set to a NULL pointer nothing will be printed
643  */
645  SCIP* scip, /**< SCIP data structure */
646  FILE* file /**< output file (or NULL for standard output) */
647  )
648 {
649  assert( scip != NULL );
650 
651  /* compiler */
652  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Compiler: ");
653 #if defined(__INTEL_COMPILER)
654  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Intel %d\n", __INTEL_COMPILER);
655 #elif defined(__clang__)
656  SCIPmessageFPrintInfo(scip->messagehdlr, file, "clang %d.%d.%d\n", __clang_major__, __clang_minor__, __clang_patchlevel__);
657 #elif defined(_MSC_VER)
658  SCIPmessageFPrintInfo(scip->messagehdlr, file, "microsoft visual c %d\n", _MSC_FULL_VER);
659 #elif defined(__GNUC__)
660  SCIPmessageFPrintInfo(scip->messagehdlr, file, "gcc %d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
661 #else
662  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown\n");
663 #endif
664 
665  /* build flags */
666  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\nBuild options:\n%s", SCIPgetBuildFlags());
667 }
668 
669 /** prints error message for the given SCIP_RETCODE via the error prints method */
671  SCIP_RETCODE retcode /**< SCIP return code causing the error */
672  )
673 {
674  SCIPmessagePrintError("SCIP Error (%d): ", retcode);
675  SCIPretcodePrintError(retcode);
676  SCIPmessagePrintError("\n");
677 }
678 
679 /*
680  * general SCIP methods
681  */
682 
683 /** creates and initializes SCIP data structures
684  *
685  * @note The SCIP default message handler is installed. Use the method SCIPsetMessagehdlr() to install your own
686  * message handler or SCIPsetMessagehdlrLogfile() and SCIPsetMessagehdlrQuiet() to write into a log
687  * file and turn off/on the display output, respectively.
688  *
689  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
690  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
691  *
692  * @post After calling this method \SCIP reached the solving stage \ref SCIP_STAGE_INIT
693  *
694  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
695  */
697  SCIP** scip /**< pointer to SCIP data structure */
698  )
699 {
700  assert(scip != NULL);
701 
702  SCIP_ALLOC( BMSallocMemory(scip) );
703 
704  /* create a default message handler */
705  SCIP_CALL( SCIPcreateMessagehdlrDefault(&(*scip)->messagehdlr, TRUE, NULL, FALSE) );
706 
707  SCIP_CALL( SCIPmemCreate(&(*scip)->mem) );
708  SCIP_CALL( SCIPsetCreate(&(*scip)->set, (*scip)->messagehdlr, (*scip)->mem->setmem, *scip) );
709  SCIP_CALL( SCIPinterruptCreate(&(*scip)->interrupt) );
710  SCIP_CALL( SCIPdialoghdlrCreate((*scip)->set, &(*scip)->dialoghdlr) );
711  SCIP_CALL( SCIPclockCreate(&(*scip)->totaltime, SCIP_CLOCKTYPE_DEFAULT) );
712  SCIP_CALL( SCIPsyncstoreCreate( &(*scip)->syncstore ) );
713 
714  SCIPclockStart((*scip)->totaltime, (*scip)->set);
715  (*scip)->stat = NULL;
716  (*scip)->origprob = NULL;
717  (*scip)->origprimal = NULL;
718  (*scip)->eventfilter = NULL;
719  (*scip)->eventqueue = NULL;
720  (*scip)->branchcand = NULL;
721  (*scip)->lp = NULL;
722  (*scip)->nlp = NULL;
723  (*scip)->primal = NULL;
724  (*scip)->tree = NULL;
725  (*scip)->conflict = NULL;
726  (*scip)->transprob = NULL;
727  (*scip)->pricestore = NULL;
728  (*scip)->sepastore = NULL;
729  (*scip)->conflictstore = NULL;
730  (*scip)->cutpool = NULL;
731  (*scip)->delayedcutpool = NULL;
732  (*scip)->reopt = NULL;
733  (*scip)->concurrent = NULL;
734 
735  SCIP_CALL( SCIPnlpInclude((*scip)->set, SCIPblkmem(*scip)) );
736 
737  if( strcmp(SCIPlpiGetSolverName(), "NONE") != 0 )
738  {
740  }
741  if( strcmp(SCIPexprintGetName(), "NONE") != 0 )
742  {
744  }
745 
746 #ifdef WITH_ZLIB
747  SCIP_CALL( SCIPsetIncludeExternalCode((*scip)->set, "ZLIB " ZLIB_VERSION, "General purpose compression library by J. Gailly and M. Adler (zlib.net)") );
748 #endif
749 
750  return SCIP_OKAY;
751 }
752 
753 /** frees SCIP data structures
754  *
755  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
756  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
757  *
758  * @pre This method can be called if @p scip is in one of the following stages:
759  * - \ref SCIP_STAGE_INIT
760  * - \ref SCIP_STAGE_PROBLEM
761  * - \ref SCIP_STAGE_TRANSFORMED
762  * - \ref SCIP_STAGE_INITPRESOLVE
763  * - \ref SCIP_STAGE_PRESOLVING
764  * - \ref SCIP_STAGE_PRESOLVED
765  * - \ref SCIP_STAGE_EXITPRESOLVE
766  * - \ref SCIP_STAGE_SOLVING
767  * - \ref SCIP_STAGE_SOLVED
768  * - \ref SCIP_STAGE_FREE
769  *
770  * @post After calling this method \SCIP reached the solving stage \ref SCIP_STAGE_FREE
771  *
772  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
773  */
775  SCIP** scip /**< pointer to SCIP data structure */
776  )
777 {
778  assert(scip != NULL);
779  assert(*scip != NULL);
780 
781  SCIP_CALL( checkStage(*scip, "SCIPfree", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
782 
783  SCIP_CALL( SCIPfreeProb(*scip) );
784  assert((*scip)->set->stage == SCIP_STAGE_INIT);
785 
786  /* switch stage to FREE */
787  (*scip)->set->stage = SCIP_STAGE_FREE;
788 
789  SCIP_CALL( SCIPsyncstoreRelease(&(*scip)->syncstore) );
790  SCIP_CALL( SCIPsetFree(&(*scip)->set, (*scip)->mem->setmem) );
791  SCIP_CALL( SCIPdialoghdlrFree(*scip, &(*scip)->dialoghdlr) );
792  SCIPclockFree(&(*scip)->totaltime);
793  SCIPinterruptFree(&(*scip)->interrupt);
794  SCIP_CALL( SCIPmemFree(&(*scip)->mem) );
795 
796  /* release message handler */
797  SCIP_CALL( SCIPmessagehdlrRelease(&(*scip)->messagehdlr) );
798 
799  BMSfreeMemory(scip);
800 
801  return SCIP_OKAY;
802 }
803 
804 #undef SCIPgetStage
805 #undef SCIPhasPerformedPresolve
806 #undef SCIPisStopped
807 
808 /** returns current stage of SCIP
809  *
810  * @return the current SCIP stage
811  *
812  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
813  */
815  SCIP* scip /**< SCIP data structure */
816  )
817 {
818  assert(scip != NULL);
819  assert(scip->set != NULL);
820 
821  return scip->set->stage;
822 }
823 
824 /** outputs SCIP stage and solution status if applicable via the message handler
825  *
826  * @note If the message handler is set to a NULL pointer nothing will be printed
827  *
828  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
829  * thus may to correspond to the original status.
830  *
831  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
832  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
833  *
834  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
835  */
837  SCIP* scip, /**< SCIP data structure */
838  FILE* file /**< output file (or NULL for standard output) */
839  )
840 {
841  SCIP_CALL( checkStage(scip, "SCIPprintStage", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
842 
843  switch( scip->set->stage )
844  {
845  case SCIP_STAGE_INIT:
846  SCIPmessageFPrintInfo(scip->messagehdlr, file, "initialization");
847  break;
848  case SCIP_STAGE_PROBLEM:
849  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem creation / modification");
850  break;
852  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem transformation");
853  break;
855  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem transformed");
856  break;
858  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving is being initialized");
859  break;
861  if( SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
862  {
863  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving was interrupted [");
864  SCIP_CALL( SCIPprintStatus(scip, file) );
865  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
866  }
867  else
868  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving process is running");
869  break;
871  SCIPmessageFPrintInfo(scip->messagehdlr, file, "presolving is being exited");
872  break;
874  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem is presolved");
875  break;
877  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process initialization");
878  break;
879  case SCIP_STAGE_SOLVING:
880  if( SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
881  {
882  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving was interrupted [");
883  SCIP_CALL( SCIPprintStatus(scip, file) );
884  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
885  }
886  else
887  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process is running");
888  break;
889  case SCIP_STAGE_SOLVED:
890  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem is solved [");
891  SCIP_CALL( SCIPprintStatus(scip, file) );
892  SCIPmessageFPrintInfo(scip->messagehdlr, file, "]");
893 
894  if( scip->primal->nlimsolsfound == 0 && !SCIPisInfinity(scip, (int)SCIPgetObjsense(scip) * getPrimalbound(scip)) )
895  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (objective limit reached)");
896 
897  break;
899  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solving process deinitialization");
900  break;
902  SCIPmessageFPrintInfo(scip->messagehdlr, file, "freeing transformed problem");
903  break;
904  case SCIP_STAGE_FREE:
905  SCIPmessageFPrintInfo(scip->messagehdlr, file, "freeing SCIP");
906  break;
907  default:
908  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
909  return SCIP_INVALIDDATA;
910  }
911 
912  return SCIP_OKAY;
913 }
914 
915 /** gets solution status
916  *
917  * @return SCIP solution status
918  *
919  * See \ref SCIP_Status "SCIP_STATUS" for a complete list of all possible solving status.
920  */
922  SCIP* scip /**< SCIP data structure */
923  )
924 {
925  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetStatus", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
926 
927  if( scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_FREE )
928  return SCIP_STATUS_UNKNOWN;
929  else
930  {
931  assert(scip->stat != NULL);
932 
933  return scip->stat->status;
934  }
935 }
936 
937 /** outputs solution status
938  *
939  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
940  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
941  *
942  * See \ref SCIP_Status "SCIP_STATUS" for a complete list of all possible solving status.
943  */
945  SCIP* scip, /**< SCIP data structure */
946  FILE* file /**< output file (or NULL for standard output) */
947  )
948 {
949  SCIP_CALL( checkStage(scip, "SCIPprintStatus", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
950 
951  switch( SCIPgetStatus(scip) )
952  {
953  case SCIP_STATUS_UNKNOWN:
954  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown");
955  break;
957  SCIPmessageFPrintInfo(scip->messagehdlr, file, "user interrupt");
958  break;
960  SCIPmessageFPrintInfo(scip->messagehdlr, file, "node limit reached");
961  break;
963  SCIPmessageFPrintInfo(scip->messagehdlr, file, "total node limit reached");
964  break;
966  SCIPmessageFPrintInfo(scip->messagehdlr, file, "stall node limit reached");
967  break;
969  SCIPmessageFPrintInfo(scip->messagehdlr, file, "time limit reached");
970  break;
972  SCIPmessageFPrintInfo(scip->messagehdlr, file, "memory limit reached");
973  break;
975  SCIPmessageFPrintInfo(scip->messagehdlr, file, "gap limit reached");
976  break;
978  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solution limit reached");
979  break;
981  SCIPmessageFPrintInfo(scip->messagehdlr, file, "solution improvement limit reached");
982  break;
984  SCIPmessageFPrintInfo(scip->messagehdlr, file, "restart limit reached");
985  break;
986  case SCIP_STATUS_OPTIMAL:
987  SCIPmessageFPrintInfo(scip->messagehdlr, file, "optimal solution found");
988  break;
990  SCIPmessageFPrintInfo(scip->messagehdlr, file, "infeasible");
991  break;
993  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unbounded");
994  break;
996  SCIPmessageFPrintInfo(scip->messagehdlr, file, "infeasible or unbounded");
997  break;
998  default:
999  SCIPerrorMessage("invalid status code <%d>\n", SCIPgetStatus(scip));
1000  return SCIP_INVALIDDATA;
1001  }
1002 
1003  return SCIP_OKAY;
1004 }
1005 
1006 /** returns whether the current stage belongs to the transformed problem space
1007  *
1008  * @return Returns TRUE if the \SCIP instance is transformed, otherwise FALSE
1009  */
1011  SCIP* scip /**< SCIP data structure */
1012  )
1013 {
1014  assert(scip != NULL);
1015 
1016  return ((int)scip->set->stage >= (int)SCIP_STAGE_TRANSFORMING);
1017 }
1018 
1019 /** returns whether the solution process should be probably correct
1020  *
1021  * @note This feature is not supported yet!
1022  *
1023  * @return Returns TRUE if \SCIP is exact solving mode, otherwise FALSE
1024  */
1026  SCIP* scip /**< SCIP data structure */
1027  )
1028 {
1029  assert(scip != NULL);
1030  assert(scip->set != NULL);
1031 
1032  return (scip->set->misc_exactsolve);
1033 }
1034 
1035 /** returns whether the presolving process would be finished given no more presolving reductions are found in this
1036  * presolving round
1037  *
1038  * Checks whether the number of presolving rounds is not exceeded and the presolving reductions found in the current
1039  * presolving round suffice to trigger another presolving round.
1040  *
1041  * @note if subsequent presolvers find more reductions, presolving might continue even if the method returns FALSE
1042  * @note does not check whether infeasibility or unboundedness was already detected in presolving (which would result
1043  * in presolving being stopped although the method returns TRUE)
1044  *
1045  * @return Returns TRUE if presolving is finished if no further reductions are detected
1046  */
1048  SCIP* scip /**< SCIP data structure */
1049  )
1050 {
1051  int maxnrounds;
1052  SCIP_Bool finished;
1053 
1054  assert(scip != NULL);
1055  assert(scip->stat != NULL);
1056  assert(scip->transprob != NULL);
1057 
1058  SCIP_CALL_ABORT( checkStage(scip, "SCIPisPresolveFinished", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
1059 
1060  /* get maximum number of presolving rounds */
1061  maxnrounds = scip->set->presol_maxrounds;
1062  if( maxnrounds == -1 )
1063  maxnrounds = INT_MAX;
1064 
1065  /* don't abort, if enough changes were applied to the variables */
1066  finished = (scip->transprob->nvars == 0
1067  || (scip->stat->npresolfixedvars - scip->stat->lastnpresolfixedvars
1068  + scip->stat->npresolaggrvars - scip->stat->lastnpresolaggrvars
1070  + (scip->stat->npresolchgbds - scip->stat->lastnpresolchgbds)/10.0
1071  + (scip->stat->npresoladdholes - scip->stat->lastnpresoladdholes)/10.0
1072  <= scip->set->presol_abortfac * scip->transprob->nvars)); /*lint !e653*/
1073 
1074  /* don't abort, if enough changes were applied to the constraints */
1075  finished = finished
1076  && (scip->transprob->nconss == 0
1077  || (scip->stat->npresoldelconss - scip->stat->lastnpresoldelconss
1078  + scip->stat->npresoladdconss - scip->stat->lastnpresoladdconss
1080  + scip->stat->npresolchgsides - scip->stat->lastnpresolchgsides
1081  <= scip->set->presol_abortfac * scip->transprob->nconss));
1082 
1083  /* don't abort, if enough changes were applied to the coefficients (assume a 1% density of non-zero elements) */
1084  finished = finished
1085  && (scip->transprob->nvars == 0 || scip->transprob->nconss == 0
1086  || (scip->stat->npresolchgcoefs - scip->stat->lastnpresolchgcoefs
1087  <= scip->set->presol_abortfac * 0.01 * scip->transprob->nvars * scip->transprob->nconss));
1088 
1089 #ifdef SCIP_DISABLED_CODE
1090  /* since 2005, we do not take cliques and implications into account when deciding whether to stop presolving */
1091  /* don't abort, if enough new implications or cliques were found (assume 100 implications per variable) */
1092  finished = finished
1093  && (scip->stat->nimplications - scip->stat->lastnpresolimplications
1094  <= scip->set->presol_abortfac * 100 * scip->transprob->nbinvars)
1095  && (SCIPcliquetableGetNCliques(scip->cliquetable) - scip->stat->lastnpresolcliques
1096  <= scip->set->presol_abortfac * scip->transprob->nbinvars);
1097 #endif
1098 
1099  /* abort if maximal number of presolving rounds is reached */
1100  finished = finished || (scip->stat->npresolrounds + 1 >= maxnrounds);
1101 
1102  return finished;
1103 }
1104 
1105 /** returns whether SCIP has performed presolving during the last solve
1106  *
1107  * @return Returns TRUE if presolving was performed during the last solve
1108  */
1110  SCIP* scip /**< SCIP data structure */
1111  )
1112 {
1113  assert(scip != NULL);
1114  assert(scip->stat != NULL);
1115 
1116  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasPerformedPresolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1117 
1118  return scip->stat->performpresol;
1119 }
1120 
1121 /** returns whether the user pressed CTRL-C to interrupt the solving process
1122  *
1123  * @return Returns TRUE if Ctrl-C was pressed, otherwise FALSE.
1124  */
1126  SCIP* scip /**< SCIP data structure */
1127  )
1128 {
1129  return SCIPinterrupted();
1130 }
1131 
1132 /** returns whether the solving process should be / was stopped before proving optimality;
1133  * if the solving process should be / was stopped, the status returned by SCIPgetStatus() yields
1134  * the reason for the premature abort
1135  *
1136  * @return Returns TRUE if solving process is stopped/interrupted, otherwise FALSE.
1137  */
1139  SCIP* scip /**< SCIP data structure */
1140  )
1141 {
1142  SCIP_CALL_ABORT( checkStage(scip, "SCIPisStopped", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1143 
1144  return SCIPsolveIsStopped(scip->set, scip->stat, FALSE);
1145 }
1146 
1147 /** enable debug solution mechanism
1148  *
1149  * the debug solution mechanism allows to trace back the invalidation of
1150  * a debug solution during the solution process of SCIP. It must be explicitly
1151  * enabled for the SCIP data structure.
1152  *
1153  * @see debug.h for more information on debug solution mechanism
1154  */
1156  SCIP* scip /**< SCIP data structure */
1157  )
1158 {
1159  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableDebugSol", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1160 
1161  SCIPdebugSolEnable(scip);
1162 }
1163 
1164 /** disable solution debugging mechanism
1165  *
1166  * @see debug.h for more information on debug solution mechanism
1167  */
1169  SCIP* scip /**< SCIP data structure */
1170  )
1171 {
1172  SCIP_CALL_ABORT( checkStage(scip, "SCIPdisableDebugSol", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1173 
1174  SCIPdebugSolDisable(scip);
1175 }
1176 
1177 /*
1178  * message output methods
1179  */
1180 
1181 /** installs the given message handler, such that all messages are passed to this handler. A messages handler can be
1182  * created via SCIPmessagehdlrCreate().
1183  *
1184  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1185  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1186  *
1187  * @pre this method can be called in one of the following stages of the SCIP solving process:
1188  * - \ref SCIP_STAGE_INIT
1189  * - \ref SCIP_STAGE_PROBLEM
1190  *
1191  * @note The currently installed messages handler gets freed if this SCIP instance is its last user (w.r.t. capture/release).
1192  */
1194  SCIP* scip, /**< SCIP data structure */
1195  SCIP_MESSAGEHDLR* messagehdlr /**< message handler to install, or NULL to suppress all output */
1196  )
1197 {
1198  int i;
1199 
1200  SCIP_CALL( checkStage(scip, "SCIPsetMessagehdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1201 
1202  assert(scip != NULL);
1203  assert(scip->set != NULL);
1204  assert(scip->set->nlpis != NULL || scip->set->nnlpis == 0);
1205 
1206  /* update message handler in NLP solver interfaces */
1207  for( i = 0; i < scip->set->nnlpis; ++i )
1208  {
1209  assert(scip->set->nlpis[i] != NULL);
1210 
1211  SCIP_CALL( SCIPnlpiSetMessageHdlr(scip->set->nlpis[i], messagehdlr) );
1212  }
1213 
1214  SCIPmessagehdlrCapture(messagehdlr);
1215 
1217  assert(scip->messagehdlr == NULL);
1218 
1219  scip->messagehdlr = messagehdlr;
1220 
1221  return SCIP_OKAY;
1222 }
1223 
1224 /** returns the currently installed message handler
1225  *
1226  * @return the currently installed message handler, or NULL if messages are currently suppressed
1227  */
1229  SCIP* scip /**< SCIP data structure */
1230  )
1231 {
1232  return scip->messagehdlr;
1233 }
1234 
1235 /** sets the log file name for the currently installed message handler */
1237  SCIP* scip, /**< SCIP data structure */
1238  const char* filename /**< name of log file, or NULL (no log) */
1239  )
1240 {
1241  if( scip->messagehdlr != NULL )
1242  {
1243  SCIPmessagehdlrSetLogfile(scip->messagehdlr, filename);
1244  }
1245 }
1246 
1247 /** sets the currently installed message handler to be quiet (or not) */
1249  SCIP* scip, /**< SCIP data structure */
1250  SCIP_Bool quiet /**< should screen messages be suppressed? */
1251  )
1252 {
1253  if( scip->messagehdlr != NULL )
1254  {
1255  SCIPmessagehdlrSetQuiet(scip->messagehdlr, quiet);
1256  }
1257 }
1258 
1259 /** prints a warning message via the message handler */
1261  SCIP* scip, /**< SCIP data structure */
1262  const char* formatstr, /**< format string like in printf() function */
1263  ... /**< format arguments line in printf() function */
1264  )
1265 {
1266  va_list ap;
1267 
1268  assert(scip != NULL);
1269 
1270  va_start(ap, formatstr); /*lint !e838*/
1271  SCIPmessageVFPrintWarning(scip->messagehdlr, formatstr, ap);
1272  va_end(ap);
1273 }
1274 
1275 /** prints a debug message */
1277  SCIP* scip, /**< SCIP data structure */
1278  const char* sourcefile, /**< name of the source file that called the function */
1279  int sourceline, /**< line in the source file where the function was called */
1280  const char* formatstr, /**< format string like in printf() function */
1281  ... /**< format arguments line in printf() function */
1282  )
1283 {
1284  int subscipdepth = 0;
1285  va_list ap;
1286 
1287  assert( sourcefile != NULL );
1288  assert( scip != NULL );
1289 
1290  if ( scip->stat != NULL )
1291  subscipdepth = scip->stat->subscipdepth;
1292  if ( subscipdepth > 0 )
1293  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "%d: [%s:%d] debug: ", subscipdepth, sourcefile, sourceline);
1294  else
1295  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "[%s:%d] debug: ", sourcefile, sourceline);
1296 
1297  va_start(ap, formatstr); /*lint !e838*/
1298  SCIPmessageVFPrintInfo(scip->messagehdlr, NULL, formatstr, ap);
1299  va_end(ap);
1300 }
1301 
1302 /** prints a debug message without precode */
1304  SCIP* scip, /**< SCIP data structure */
1305  const char* formatstr, /**< format string like in printf() function */
1306  ... /**< format arguments line in printf() function */
1307  )
1308 {
1309  va_list ap;
1310 
1311  assert( scip != NULL );
1312 
1313  va_start(ap, formatstr); /*lint !e838*/
1314  SCIPmessageVFPrintInfo(scip->messagehdlr, NULL, formatstr, ap);
1315  va_end(ap);
1316 }
1317 
1318 /** prints a dialog message that requests user interaction or is a direct response to a user interactive command */
1320  SCIP* scip, /**< SCIP data structure */
1321  FILE* file, /**< file stream to print into, or NULL for stdout */
1322  const char* formatstr, /**< format string like in printf() function */
1323  ... /**< format arguments line in printf() function */
1324  )
1325 {
1326  va_list ap;
1327 
1328  assert(scip != NULL);
1329 
1330  va_start(ap, formatstr); /*lint !e838*/
1331  SCIPmessageVFPrintDialog(scip->messagehdlr, file, formatstr, ap);
1332  va_end(ap);
1333 }
1334 
1335 /** prints a message */
1337  SCIP* scip, /**< SCIP data structure */
1338  FILE* file, /**< file stream to print into, or NULL for stdout */
1339  const char* formatstr, /**< format string like in printf() function */
1340  ... /**< format arguments line in printf() function */
1341  )
1342 {
1343  va_list ap;
1344 
1345  assert(scip != NULL);
1346 
1347  va_start(ap, formatstr); /*lint !e838*/
1348  SCIPmessageVFPrintInfo(scip->messagehdlr, file, formatstr, ap);
1349  va_end(ap);
1350 }
1351 
1352 /** prints a message depending on the verbosity level */
1354  SCIP* scip, /**< SCIP data structure */
1355  SCIP_VERBLEVEL msgverblevel, /**< verbosity level of this message */
1356  FILE* file, /**< file stream to print into, or NULL for stdout */
1357  const char* formatstr, /**< format string like in printf() function */
1358  ... /**< format arguments line in printf() function */
1359  )
1360 {
1361  va_list ap;
1362 
1363  assert(scip != NULL);
1364  assert(scip->set != NULL);
1365 
1366  va_start(ap, formatstr); /*lint !e838*/
1367  SCIPmessageVFPrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, msgverblevel, file, formatstr, ap);
1368  va_end(ap);
1369 }
1370 
1371 /** returns the current message verbosity level
1372  *
1373  * @return message verbosity level of SCIP
1374  *
1375  * @see \ref SCIP_VerbLevel "SCIP_VERBLEVEL" for a list of all verbosity levels
1376  */
1378  SCIP* scip /**< SCIP data structure */
1379  )
1380 {
1381  assert(scip != NULL);
1382  assert(scip->set != NULL);
1383 
1384  return scip->set->disp_verblevel;
1385 }
1386 
1387 
1388 /*
1389  * SCIP copy methods
1390  */
1391 
1392 /** returns true if the @p cut matches the selection criterium for copying */
1393 static
1395  SCIP* scip, /**< SCIP data structure */
1396  SCIP_CUT* cut, /**< a cut */
1397  char cutsel /**< cut selection for sub SCIPs ('a'ge, activity 'q'uotient) */
1398  )
1399 {
1400  SCIP_Bool takecut;
1401 
1402  assert(cut != NULL);
1403 
1404  if( !SCIProwIsInLP(SCIPcutGetRow(cut)) )
1405  return FALSE;
1406 
1407  switch( cutsel )
1408  {
1409  case 'a':
1410  takecut = (SCIPcutGetAge(cut) == 0);
1411  break;
1412  case 'q':
1413  takecut = (SCIPcutGetLPActivityQuot(cut) >= scip->set->sepa_minactivityquot);
1414  break;
1415  default:
1416  SCIPerrorMessage("unknown cut selection strategy %c, must be either 'a' or 'q'\n");
1417  SCIPABORT();
1418  takecut = FALSE; /*lint !e527*/
1419  break;
1420  }
1421 
1422  return takecut;
1423 }
1424 
1425 /** copy active and tight cuts from one SCIP instance to linear constraints of another SCIP instance */
1426 static
1428  SCIP* sourcescip, /**< source SCIP data structure */
1429  SCIP* targetscip, /**< target SCIP data structure */
1430  SCIP_CUT** cuts, /**< cuts to copy */
1431  int ncuts, /**< number of cuts to copy */
1432  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1433  * target variables, or NULL */
1434  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1435  * target constraints, or NULL */
1436  SCIP_Bool global, /**< create a global or a local copy? */
1437  int* ncutsadded /**< pointer to store number of copied cuts */
1438  )
1439 {
1440  int c;
1441 
1442  assert(sourcescip != NULL);
1443  assert(targetscip != NULL);
1444  assert(cuts != NULL || ncuts == 0);
1445  assert(ncutsadded != NULL);
1446 
1447  for( c = 0; c < ncuts; ++c )
1448  {
1449  SCIP_ROW* row;
1450  SCIP_Bool takecut;
1451 
1452  assert( cuts[c] != NULL ); /*lint !e613*/
1453  row = SCIPcutGetRow(cuts[c]); /*lint !e613*/
1454  assert(!SCIProwIsLocal(row));
1455  assert(!SCIProwIsModifiable(row));
1456 
1457  /* in case of a restart, convert the cuts with a good LP activity quotient; in other cases, e.g., when heuristics
1458  * copy cuts into subscips, take only currently active ones
1459  */
1460  if( sourcescip == targetscip )
1461  {
1462  assert( SCIPisInRestart(sourcescip) );
1463  takecut = takeCut(sourcescip, cuts[c], sourcescip->set->sepa_cutselrestart); /*lint !e613*/
1464  }
1465  else
1466  takecut = takeCut(sourcescip, cuts[c], sourcescip->set->sepa_cutselsubscip); /*lint !e613*/
1467 
1468  /* create a linear constraint out of the cut */
1469  if( takecut )
1470  {
1471  char name[SCIP_MAXSTRLEN];
1472  SCIP_CONS* cons;
1473  SCIP_COL** cols;
1474  SCIP_VAR** vars;
1475  int ncols;
1476  int i;
1477 
1478  cols = SCIProwGetCols(row);
1479  ncols = SCIProwGetNNonz(row);
1480 
1481  /* get all variables of the row */
1482  SCIP_CALL( SCIPallocBufferArray(targetscip, &vars, ncols) );
1483  for( i = 0; i < ncols; ++i )
1484  vars[i] = SCIPcolGetVar(cols[i]);
1485 
1486  /* get corresponding variables in targetscip if necessary */
1487  if( sourcescip != targetscip )
1488  {
1489  SCIP_Bool success;
1490 
1491  for( i = 0; i < ncols; ++i )
1492  {
1493  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, vars[i], &vars[i], varmap, consmap, global, &success) );
1494 
1495  if( !success )
1496  {
1497  SCIPdebugMsg(sourcescip, "Converting cuts to constraints failed.\n");
1498 
1499  /* free temporary memory */
1500  SCIPfreeBufferArray(targetscip, &vars);
1501  return SCIP_OKAY;
1502  }
1503  }
1504  }
1505 
1506  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%d", SCIProwGetName(row), SCIPgetNRuns(sourcescip));
1507  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, ncols, vars, SCIProwGetVals(row),
1510  SCIP_CALL( SCIPaddCons(targetscip, cons) );
1511 
1512  SCIPdebugMsg(sourcescip, "Converted cut <%s> to constraint <%s>.\n", SCIProwGetName(row), SCIPconsGetName(cons));
1513  SCIPdebugPrintCons(targetscip, cons, NULL);
1514  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
1515 
1516  /* free temporary memory */
1517  SCIPfreeBufferArray(targetscip, &vars);
1518 
1519  ++(*ncutsadded);
1520  }
1521  }
1522 
1523  return SCIP_OKAY;
1524 }
1525 
1526 /** copies plugins from sourcescip to targetscip; in case that a constraint handler which does not need constraints
1527  * cannot be copied, valid will return FALSE. All plugins can declare that, if their copy process failed, the
1528  * copied SCIP instance might not represent the same problem semantics as the original.
1529  * Note that in this case dual reductions might be invalid.
1530  *
1531  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1532  * Also, 'passmessagehdlr' should be set to FALSE.
1533  * @note Do not change the source SCIP environment during the copying process
1534  *
1535  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1536  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1537  *
1538  * @pre This method can be called if sourcescip is in one of the following stages:
1539  * - \ref SCIP_STAGE_PROBLEM
1540  * - \ref SCIP_STAGE_TRANSFORMED
1541  * - \ref SCIP_STAGE_INITPRESOLVE
1542  * - \ref SCIP_STAGE_PRESOLVING
1543  * - \ref SCIP_STAGE_EXITPRESOLVE
1544  * - \ref SCIP_STAGE_PRESOLVED
1545  * - \ref SCIP_STAGE_INITSOLVE
1546  * - \ref SCIP_STAGE_SOLVING
1547  * - \ref SCIP_STAGE_SOLVED
1548  *
1549  * @pre This method can be called if targetscip is in one of the following stages:
1550  * - \ref SCIP_STAGE_INIT
1551  * - \ref SCIP_STAGE_FREE
1552  *
1553  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1554  * process was interrupted:
1555  * - \ref SCIP_STAGE_PROBLEM
1556  *
1557  * @note sourcescip stage does not get changed
1558  *
1559  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1560  */
1562  SCIP* sourcescip, /**< source SCIP data structure */
1563  SCIP* targetscip, /**< target SCIP data structure */
1564  SCIP_Bool copyreaders, /**< should the file readers be copied */
1565  SCIP_Bool copypricers, /**< should the variable pricers be copied */
1566  SCIP_Bool copyconshdlrs, /**< should the constraint handlers be copied */
1567  SCIP_Bool copyconflicthdlrs, /**< should the conflict handlers be copied */
1568  SCIP_Bool copypresolvers, /**< should the presolvers be copied */
1569  SCIP_Bool copyrelaxators, /**< should the relaxation handlers be copied */
1570  SCIP_Bool copyseparators, /**< should the separators be copied */
1571  SCIP_Bool copypropagators, /**< should the propagators be copied */
1572  SCIP_Bool copyheuristics, /**< should the heuristics be copied */
1573  SCIP_Bool copyeventhdlrs, /**< should the event handlers be copied */
1574  SCIP_Bool copynodeselectors, /**< should the node selectors be copied */
1575  SCIP_Bool copybranchrules, /**< should the branchrules be copied */
1576  SCIP_Bool copydisplays, /**< should the display columns be copied */
1577  SCIP_Bool copydialogs, /**< should the dialogs be copied */
1578  SCIP_Bool copynlpis, /**< should the NLPIs be copied */
1579  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
1580  SCIP_Bool* valid /**< pointer to store whether plugins, in particular all constraint
1581  * handlers which do not need constraints were validly copied */
1582  )
1583 {
1584  assert(sourcescip != NULL);
1585  assert(targetscip != NULL);
1586  assert(sourcescip->set != NULL);
1587  assert(targetscip->set != NULL);
1588 
1589  /* check stages for both, the source and the target SCIP data structure */
1590  SCIP_CALL( checkStage(sourcescip, "SCIPcopyPlugins", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1591  SCIP_CALL( checkStage(targetscip, "SCIPcopyPlugins", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1592 
1593  /* passes the message handler of the source SCIP to the target SCIP, also if NULL */
1594  if( passmessagehdlr )
1595  {
1596  SCIP_CALL( SCIPsetMessagehdlr(targetscip, SCIPgetMessagehdlr(sourcescip)) );
1597  }
1598 
1599  SCIP_CALL( SCIPsetCopyPlugins(sourcescip->set, targetscip->set,
1600  copyreaders, copypricers, copyconshdlrs, copyconflicthdlrs, copypresolvers, copyrelaxators, copyseparators, copypropagators,
1601  copyheuristics, copyeventhdlrs, copynodeselectors, copybranchrules, copydisplays, copydialogs, copynlpis, valid) );
1602 
1603  return SCIP_OKAY;
1604 }
1605 
1606 /** create a problem by copying the problem data of the source SCIP */
1607 static
1609  SCIP* sourcescip, /**< source SCIP data structure */
1610  SCIP* targetscip, /**< target SCIP data structure */
1611  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1612  * target variables, or NULL */
1613  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1614  * target constraints, or NULL */
1615  SCIP_Bool original, /**< should the original problem be copied? */
1616  SCIP_Bool global, /**< create a global or a local copy? (set to TRUE for original copy) */
1617  const char* name /**< problem name of target */
1618  )
1619 {
1620  SCIP_PROB* sourceprob;
1621  SCIP_HASHMAP* localvarmap;
1622  SCIP_HASHMAP* localconsmap;
1623  SCIP_Bool uselocalvarmap;
1624  SCIP_Bool uselocalconsmap;
1625 
1626  assert(sourcescip != NULL);
1627  assert(targetscip != NULL);
1628  assert(!original || global);
1629 
1630  /* free old problem */
1631  SCIP_CALL( SCIPfreeProb(targetscip) );
1632  assert(targetscip->set->stage == SCIP_STAGE_INIT);
1633 
1634  uselocalvarmap = (varmap == NULL);
1635  uselocalconsmap = (consmap == NULL);
1636 
1637  if( uselocalvarmap )
1638  {
1639  /* create the variable mapping hash map */
1640  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
1641  }
1642  else
1643  localvarmap = varmap;
1644 
1645  if( uselocalconsmap )
1646  {
1647  /* create the constraint mapping hash map */
1648  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
1649  }
1650  else
1651  localconsmap = consmap;
1652 
1653  /* switch stage to PROBLEM */
1654  targetscip->set->stage = SCIP_STAGE_PROBLEM;
1655 
1656  if( !original && SCIPisTransformed(sourcescip) )
1657  sourceprob = sourcescip->transprob;
1658  else
1659  sourceprob = sourcescip->origprob;
1660 
1661  /* create the statistics data structure */
1662  SCIP_CALL( SCIPstatCreate(&targetscip->stat, targetscip->mem->probmem, targetscip->set, targetscip->transprob, targetscip->origprob, targetscip->messagehdlr) );
1663  targetscip->stat->subscipdepth = sourcescip->stat->subscipdepth + 1;
1664 
1665  /* create the problem by copying the source problem */
1666  SCIP_CALL( SCIPprobCopy(&targetscip->origprob, targetscip->mem->probmem, targetscip->set, name, sourcescip, sourceprob, localvarmap, localconsmap, global) );
1667 
1668  /* creating the solution candidates storage */
1669  /**@todo copy solution of source SCIP as candidates for the target SCIP */
1670  SCIP_CALL( SCIPprimalCreate(&targetscip->origprimal) );
1671 
1672  /* create conflict store to store conflict constraints */
1673  SCIP_CALL( SCIPconflictstoreCreate(&targetscip->conflictstore, targetscip->set) );
1674 
1675  if( uselocalvarmap )
1676  {
1677  /* free hash map */
1678  SCIPhashmapFree(&localvarmap);
1679  }
1680 
1681  if( uselocalconsmap )
1682  {
1683  /* free hash map */
1684  SCIPhashmapFree(&localconsmap);
1685  }
1686 
1687  return SCIP_OKAY;
1688 }
1689 
1690 
1691 /** create a problem by copying the problem data of the source SCIP
1692  *
1693  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1694  * @note Do not change the source SCIP environment during the copying process
1695  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1696  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1697  *
1698  * @pre This method can be called if sourcescip is in one of the following stages:
1699  * - \ref SCIP_STAGE_PROBLEM
1700  * - \ref SCIP_STAGE_TRANSFORMED
1701  * - \ref SCIP_STAGE_INITPRESOLVE
1702  * - \ref SCIP_STAGE_PRESOLVING
1703  * - \ref SCIP_STAGE_EXITPRESOLVE
1704  * - \ref SCIP_STAGE_PRESOLVED
1705  * - \ref SCIP_STAGE_INITSOLVE
1706  * - \ref SCIP_STAGE_SOLVING
1707  * - \ref SCIP_STAGE_SOLVED
1708  *
1709  * @pre This method can be called if targetscip is in one of the following stages:
1710  * - \ref SCIP_STAGE_INIT
1711  * - \ref SCIP_STAGE_PROBLEM
1712  * - \ref SCIP_STAGE_TRANSFORMED
1713  * - \ref SCIP_STAGE_INITPRESOLVE
1714  * - \ref SCIP_STAGE_PRESOLVING
1715  * - \ref SCIP_STAGE_EXITPRESOLVE
1716  * - \ref SCIP_STAGE_PRESOLVED
1717  * - \ref SCIP_STAGE_INITSOLVE
1718  * - \ref SCIP_STAGE_SOLVING
1719  * - \ref SCIP_STAGE_SOLVED
1720  * - \ref SCIP_STAGE_FREE
1721  *
1722  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1723  * process was interrupted:
1724  * - \ref SCIP_STAGE_PROBLEM
1725  *
1726  * @note sourcescip stage does not get changed
1727  *
1728  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1729  */
1731  SCIP* sourcescip, /**< source SCIP data structure */
1732  SCIP* targetscip, /**< target SCIP data structure */
1733  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1734  * target variables, or NULL */
1735  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1736  * target constraints, or NULL */
1737  SCIP_Bool global, /**< create a global or a local copy? */
1738  const char* name /**< problem name of target */
1739  )
1740 {
1741  assert(sourcescip != NULL);
1742  assert(targetscip != NULL);
1743 
1744  /* check stages for both, the source and the target SCIP data structure */
1745  SCIP_CALL( checkStage(sourcescip, "SCIPcopyProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1746  SCIP_CALL( checkStage(targetscip, "SCIPcopyProb", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE) );
1747 
1748  SCIP_CALL( copyProb(sourcescip, targetscip, varmap, consmap, FALSE, global, name) );
1749 
1750  return SCIP_OKAY;
1751 }
1752 
1753 /** create a problem by copying the original problem data of the source SCIP
1754  *
1755  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1756  * @note Do not change the source SCIP environment during the copying process
1757  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1758  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1759  *
1760  * @pre This method can be called if sourcescip is in one of the following stages:
1761  * - \ref SCIP_STAGE_PROBLEM
1762  * - \ref SCIP_STAGE_TRANSFORMED
1763  * - \ref SCIP_STAGE_INITPRESOLVE
1764  * - \ref SCIP_STAGE_PRESOLVING
1765  * - \ref SCIP_STAGE_EXITPRESOLVE
1766  * - \ref SCIP_STAGE_PRESOLVED
1767  * - \ref SCIP_STAGE_INITSOLVE
1768  * - \ref SCIP_STAGE_SOLVING
1769  * - \ref SCIP_STAGE_SOLVED
1770  *
1771  * @pre This method can be called if targetscip is in one of the following stages:
1772  * - \ref SCIP_STAGE_INIT
1773  * - \ref SCIP_STAGE_FREE
1774  *
1775  * @post After calling this method targetscip reaches one of the following stages depending on if and when the solution
1776  * process was interrupted:
1777  * - \ref SCIP_STAGE_PROBLEM
1778  *
1779  * @note sourcescip stage does not get changed
1780  *
1781  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1782  */
1784  SCIP* sourcescip, /**< source SCIP data structure */
1785  SCIP* targetscip, /**< target SCIP data structure */
1786  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
1787  * target variables, or NULL */
1788  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1789  * target constraints, or NULL */
1790  const char* name /**< problem name of target */
1791  )
1792 {
1793  assert(sourcescip != NULL);
1794  assert(targetscip != NULL);
1795 
1796  /* check stages for both, the source and the target SCIP data structure */
1797  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1798  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigProb", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
1799 
1800  SCIP_CALL( copyProb(sourcescip, targetscip, varmap, consmap, TRUE, TRUE, name) );
1801 
1802  /* set the correct objective sense; necessary if we maximize in the original problem */
1803  SCIP_CALL( SCIPsetObjsense(targetscip, SCIPgetObjsense(sourcescip)) );
1804 
1805  return SCIP_OKAY;
1806 }
1807 
1808 /** enables constraint compression.
1809  *
1810  * If constraint compression is enabled, fixed variables will be treated as constants
1811  * by all constraints that are copied after calling this method.
1812  *
1813  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1814  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1815  *
1816  * @pre This method can be called if scip is in one of the following stages:
1817  * - \ref SCIP_STAGE_PROBLEM
1818  *
1819  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1820  */
1822  SCIP* scip /**< source SCIP data structure */
1823  )
1824 {
1825  assert(scip != NULL);
1826  assert(scip->origprob != NULL);
1827 
1828 
1829  /* check stage */
1830  SCIP_CALL( checkStage(scip, "SCIPenableConsCompression", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
1831 
1832  /* enable problem compression */
1834 
1835  return SCIP_OKAY;
1836 }
1837 
1838 /** is constraint compression enabled?
1839  *
1840  * If constraint compression is enabled, fixed variables can be treated as constants
1841  * by all constraints that are copied after calling this method.
1842  *
1843  * @return TRUE if problem constraint compression is enabled, otherwise FALSE
1844  *
1845  * @pre This method can be called if scip is in one of the following stages:
1846  * - \ref SCIP_STAGE_PROBLEM
1847  * - \ref SCIP_STAGE_TRANSFORMING
1848  * - \ref SCIP_STAGE_TRANSFORMED
1849  * - \ref SCIP_STAGE_INITPRESOLVE
1850  * - \ref SCIP_STAGE_PRESOLVING
1851  * - \ref SCIP_STAGE_EXITPRESOLVE
1852  * - \ref SCIP_STAGE_PRESOLVED
1853  * - \ref SCIP_STAGE_INITSOLVE
1854  * - \ref SCIP_STAGE_SOLVING
1855  * - \ref SCIP_STAGE_SOLVED
1856  * - \ref SCIP_STAGE_EXITSOLVE
1857  * - \ref SCIP_STAGE_FREETRANS
1858  *
1859  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1860  */
1862  SCIP* scip /**< source SCIP data structure */
1863  )
1864 {
1865  assert(scip != NULL);
1866  assert(scip->origprob != NULL);
1867 
1868  /* check stage */
1869  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConsCompressionEnabled", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
1870 
1871  /* is problem compression enabled */
1873 }
1874 
1875 /** returns copy of the source variable; if there already is a copy of the source variable in the variable hash map,
1876  * it is just returned as target variable; otherwise a new variable will be created and added to the target SCIP; this
1877  * created variable is added to the variable hash map and returned as target variable
1878  *
1879  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
1880  * @note Do not change the source SCIP environment during the copying process
1881  * @note if a new variable was created, this variable will be added to the target-SCIP, but it is not captured
1882  *
1883  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1884  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1885  *
1886  * @pre This method can be called if sourcescip is in one of the following stages:
1887  * - \ref SCIP_STAGE_PROBLEM
1888  * - \ref SCIP_STAGE_TRANSFORMED
1889  * - \ref SCIP_STAGE_INITPRESOLVE
1890  * - \ref SCIP_STAGE_PRESOLVING
1891  * - \ref SCIP_STAGE_EXITPRESOLVE
1892  * - \ref SCIP_STAGE_PRESOLVED
1893  * - \ref SCIP_STAGE_INITSOLVE
1894  * - \ref SCIP_STAGE_SOLVING
1895  * - \ref SCIP_STAGE_SOLVED
1896  *
1897  * @pre This method can be called if targetscip is in one of the following stages:
1898  * - \ref SCIP_STAGE_PROBLEM
1899  * - \ref SCIP_STAGE_TRANSFORMED
1900  * - \ref SCIP_STAGE_INITPRESOLVE
1901  * - \ref SCIP_STAGE_PRESOLVING
1902  * - \ref SCIP_STAGE_EXITPRESOLVE
1903  * - \ref SCIP_STAGE_SOLVING
1904  *
1905  * @note targetscip stage does not get changed
1906  *
1907  * @note sourcescip stage does not get changed
1908  *
1909  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1910  */
1912  SCIP* sourcescip, /**< source SCIP data structure */
1913  SCIP* targetscip, /**< target SCIP data structure */
1914  SCIP_VAR* sourcevar, /**< source variable */
1915  SCIP_VAR** targetvar, /**< pointer to store the target variable */
1916  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
1917  * target variables, or NULL */
1918  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
1919  * target constraints, or NULL */
1920  SCIP_Bool global, /**< should global or local bounds be used? */
1921  SCIP_Bool* success /**< pointer to store whether the copying was successful or not */
1922  )
1923 {
1924  SCIP_HASHMAP* localvarmap;
1925  SCIP_HASHMAP* localconsmap;
1926  SCIP_VAR* var;
1927  SCIP_Bool uselocalvarmap;
1928  SCIP_Bool uselocalconsmap;
1929 
1930  assert(sourcescip != NULL);
1931  assert(targetscip != NULL);
1932  assert(sourcevar != NULL);
1933  assert(targetvar != NULL);
1934  assert(sourcevar->scip == sourcescip);
1935 
1936  /* check stages for both, the source and the target SCIP data structure */
1937  SCIP_CALL( checkStage(sourcescip, "SCIPgetVarCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1938  SCIP_CALL( checkStage(targetscip, "SCIPgetVarCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1939 
1940  uselocalvarmap = (varmap == NULL);
1941  uselocalconsmap = (consmap == NULL);
1942  *success = TRUE;
1943 
1944  /* try to retrieve copied variable from hashmap */
1945  if( !uselocalvarmap )
1946  {
1947  *targetvar = (SCIP_VAR*) SCIPhashmapGetImage(varmap, sourcevar);
1948  if( *targetvar != NULL )
1949  return SCIP_OKAY;
1950  }
1951 
1952  /* if the target SCIP is already in solving stage we currently are not copying the variable!
1953  * this has to be done because we cannot simply add variables to SCIP during solving and thereby enlarge the search
1954  * space.
1955  * unlike column generation we cannot assume here that the variable could be implicitly set to zero in all prior
1956  * computations
1957  */
1958  if( SCIPgetStage(targetscip) > SCIP_STAGE_PROBLEM )
1959  {
1960  *success = FALSE;
1961  *targetvar = NULL;
1962 
1963  return SCIP_OKAY;
1964  }
1965 
1966  /* create the variable mapping hash map */
1967  if( uselocalvarmap )
1968  {
1969  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
1970  }
1971  else
1972  localvarmap = varmap;
1973 
1974  if( uselocalconsmap )
1975  {
1976  /* create the constraint mapping hash map */
1977  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
1978  }
1979  else
1980  localconsmap = consmap;
1981 
1982  /* if variable does not exist yet in target SCIP, create it */
1983  switch( SCIPvarGetStatus(sourcevar) )
1984  {
1986  case SCIP_VARSTATUS_COLUMN:
1987  case SCIP_VARSTATUS_LOOSE:
1988  case SCIP_VARSTATUS_FIXED:
1989  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
1990  sourcescip, sourcevar, localvarmap, localconsmap, global) );
1991  break;
1992 
1994  {
1995  SCIP_CONS* cons;
1996  char name[SCIP_MAXSTRLEN];
1997 
1998  SCIP_VAR* sourceaggrvar;
1999  SCIP_VAR* targetaggrvar;
2000  SCIP_Real aggrcoef;
2001  SCIP_Real constant;
2002 
2003  /* get aggregation data */
2004  sourceaggrvar = SCIPvarGetAggrVar(sourcevar);
2005  aggrcoef = SCIPvarGetAggrScalar(sourcevar);
2006  constant = SCIPvarGetAggrConstant(sourcevar);
2007 
2008  /* get copy of the aggregation variable */
2009  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourceaggrvar, &targetaggrvar, localvarmap, localconsmap, global, success) );
2010  assert(*success);
2011 
2012  /* create copy of the aggregated variable */
2013  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
2014  sourcescip, sourcevar, localvarmap, localconsmap, global) );
2015 
2016  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_aggr", SCIPvarGetName(sourcevar));
2017 
2018  /* add aggregation x = a*y + c as linear constraint x - a*y = c */
2019  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, 0, NULL, NULL, constant,
2020  constant, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2021  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, var, 1.0) );
2022  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, targetaggrvar, -aggrcoef) );
2023 
2024  SCIP_CALL( SCIPaddCons(targetscip, cons) );
2025  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
2026 
2027  break;
2028  }
2030  {
2031  SCIP_CONS* cons;
2032  char name[SCIP_MAXSTRLEN];
2033 
2034  SCIP_VAR** sourceaggrvars;
2035  SCIP_VAR** targetaggrvars;
2036  SCIP_Real* aggrcoefs;
2037  SCIP_Real constant;
2038 
2039  int naggrvars;
2040  int i;
2041 
2042  /* get the active representation */
2043  SCIP_CALL( SCIPflattenVarAggregationGraph(sourcescip, sourcevar) );
2044 
2045  /* get multi-aggregation data */
2046  naggrvars = SCIPvarGetMultaggrNVars(sourcevar);
2047  sourceaggrvars = SCIPvarGetMultaggrVars(sourcevar);
2048  aggrcoefs = SCIPvarGetMultaggrScalars(sourcevar);
2049  constant = SCIPvarGetMultaggrConstant(sourcevar);
2050 
2051  SCIP_CALL( SCIPallocBufferArray(targetscip, &targetaggrvars, naggrvars) );
2052 
2053  /* get copies of the active variables of the multi-aggregation */
2054  for( i = 0; i < naggrvars; ++i )
2055  {
2056  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourceaggrvars[i], &targetaggrvars[i], localvarmap, localconsmap, global, success) );
2057  assert(*success);
2058  }
2059 
2060  /* create copy of the multi-aggregated variable */
2061  SCIP_CALL( SCIPvarCopy(&var, targetscip->mem->probmem, targetscip->set, targetscip->stat,
2062  sourcescip, sourcevar, localvarmap, localconsmap, global) );
2063 
2064  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_multaggr", SCIPvarGetName(sourcevar));
2065 
2066  /* add multi-aggregation x = a^T y + c as linear constraint a^T y - x = -c */
2067  SCIP_CALL( SCIPcreateConsLinear(targetscip, &cons, name, naggrvars, targetaggrvars, aggrcoefs, -constant,
2068  -constant, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2069  SCIP_CALL( SCIPaddCoefLinear(targetscip, cons, var, -1.0) );
2070  SCIP_CALL( SCIPaddCons(targetscip, cons) );
2071  SCIP_CALL( SCIPreleaseCons(targetscip, &cons) );
2072 
2073  SCIPfreeBufferArray(targetscip, &targetaggrvars);
2074 
2075  break;
2076  }
2078  {
2079  SCIP_VAR* sourcenegatedvar;
2080  SCIP_VAR* targetnegatedvar;
2081 
2082  /* get negated source variable */
2083  sourcenegatedvar = SCIPvarGetNegationVar(sourcevar);
2084  assert(sourcenegatedvar != NULL);
2085  assert(SCIPvarGetStatus(sourcenegatedvar) != SCIP_VARSTATUS_NEGATED);
2086 
2087  /* get copy of negated source variable */
2088  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcenegatedvar, &targetnegatedvar, localvarmap, localconsmap, global, success) );
2089  assert(*success);
2090  assert(SCIPvarGetStatus(targetnegatedvar) != SCIP_VARSTATUS_NEGATED);
2091 
2092  /* get negation of copied negated source variable, this is the target variable */
2093  SCIP_CALL( SCIPgetNegatedVar(targetscip, targetnegatedvar, targetvar) );
2094  assert(SCIPvarGetStatus(*targetvar) == SCIP_VARSTATUS_NEGATED);
2095 
2096  /* free local hash maps if necessary */
2097  if( uselocalvarmap )
2098  SCIPhashmapFree(&localvarmap);
2099 
2100  if( uselocalconsmap )
2101  SCIPhashmapFree(&localconsmap);
2102 
2103  /* we have to return right away, to avoid adding the negated variable to the problem since the "not negated"
2104  * variable was already added */
2105  return SCIP_OKAY;
2106  }
2107  default:
2108  /* note that this is in an internal SCIP error since the variable status is only handled by the core */
2109  SCIPerrorMessage("unknown variable status\n");
2110  SCIPABORT();
2111  return SCIP_ERROR; /*lint !e527*/
2112  }
2113 
2114  /* add the (new) target variable to the target problem */
2115  SCIP_CALL( SCIPaddVar(targetscip, var) );
2116 
2117  *targetvar = var;
2118 
2119  /* remove the variable capture which was done due to the creation of the variable */
2120  SCIP_CALL( SCIPreleaseVar(targetscip, &var) );
2121 
2122  /* free local hash maps if necessary */
2123  if( uselocalvarmap )
2124  SCIPhashmapFree(&localvarmap);
2125 
2126  if( uselocalconsmap )
2127  SCIPhashmapFree(&localconsmap);
2128 
2129  return SCIP_OKAY;
2130 }
2131 
2132 /** copies all original or active variables from source-SCIP and adds these variable to the target-SCIP; the mapping
2133  * between these variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed
2134  * and aggregated variables do not get copied
2135  */
2136 static
2138  SCIP* sourcescip, /**< source SCIP data structure */
2139  SCIP* targetscip, /**< target SCIP data structure */
2140  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2141  * target variables, or NULL */
2142  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2143  * target constraints, or NULL */
2144  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
2145  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
2146  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
2147  SCIP_Bool original, /**< should original variables be copied? */
2148  SCIP_Bool global /**< should global or local bounds be used? (for original=FALSE) */
2149  )
2150 {
2151  SCIP_VAR** sourcevars;
2152  SCIP_HASHMAP* localvarmap;
2153  SCIP_HASHMAP* localconsmap;
2154  SCIP_Bool uselocalvarmap;
2155  SCIP_Bool uselocalconsmap;
2156  int nsourcevars;
2157  int i;
2158 
2159  assert(sourcescip != NULL);
2160  assert(targetscip != NULL);
2161  assert(nfixedvars == 0 || fixedvars != NULL);
2162  assert(nfixedvars == 0 || fixedvals != NULL);
2163 
2164  if( original )
2165  {
2166  /* get original variables of the source SCIP */
2167  SCIP_CALL( SCIPgetOrigVarsData(sourcescip, &sourcevars, &nsourcevars, NULL, NULL, NULL, NULL) );
2168  }
2169  else
2170  {
2171  /* get active variables of the source SCIP */
2172  SCIP_CALL( SCIPgetVarsData(sourcescip, &sourcevars, &nsourcevars, NULL, NULL, NULL, NULL) );
2173  }
2174 
2175  uselocalvarmap = (varmap == NULL);
2176  uselocalconsmap = (consmap == NULL);
2177 
2178  if( uselocalvarmap )
2179  {
2180  /* create the variable mapping hash map */
2181  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2182  }
2183  else
2184  localvarmap = varmap;
2185 
2186  if( uselocalconsmap )
2187  {
2188  /* create the constraint mapping hash map */
2189  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2190  }
2191  else
2192  localconsmap = consmap;
2193 
2194  /* create the variables of the target SCIP */
2195  for( i = 0; i < nsourcevars; ++i )
2196  {
2197  SCIP_Bool success;
2198  SCIP_VAR* targetvar;
2199 
2200  /* copy variable and add this copy to the target SCIP if the copying was valid */
2201  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcevars[i], &targetvar, localvarmap, localconsmap, global, &success) );
2202  assert(success);
2203  assert(targetvar != NULL);
2204  }
2205 
2206  /* fix the variables that should be fixed right away */
2207  for( i = 0; i < nfixedvars; ++i )
2208  {
2209  SCIP_VAR* targetvar;
2210  SCIP_Bool infeasible;
2211  SCIP_Bool fixed;
2212 
2213  /* retrieve target variable as image of the source variable */
2214  targetvar = (SCIP_VAR*) SCIPhashmapGetImage(localvarmap, (void *)fixedvars[i]);
2215  assert(targetvar != NULL);
2216 
2217  /* fix the variable to the specified value */
2218  infeasible = fixed = FALSE;
2219  SCIP_CALL( SCIPfixVar(targetscip, targetvar, fixedvals[i], &infeasible, &fixed) );
2220 
2221  assert(!infeasible);
2222  assert(fixed);
2223  }
2224 
2225  /* integer variables that are fixed to zero or one or have bounds [0,1] will be converted to binaries */
2226 #ifndef NDEBUG
2227  if( original )
2228  {
2229  /* TODO : account for integers converted to binaries
2230  assert(SCIPgetNOrigBinVars(sourcescip) == SCIPgetNOrigBinVars(targetscip));
2231  assert(SCIPgetNOrigIntVars(sourcescip) == SCIPgetNOrigIntVars(targetscip));
2232  assert(SCIPgetNOrigImplVars(sourcescip) == SCIPgetNOrigImplVars(targetscip));
2233  assert(SCIPgetNOrigContVars(sourcescip) == SCIPgetNOrigContVars(targetscip));
2234  */
2235  }
2236  else
2237  {
2238  SCIP_VAR** sourcefixedvars;
2239  int nsourcefixedvars;
2240  int nfixedbinvars;
2241  int nfixedintvars;
2242  int nfixedimplvars;
2243  int nfixedcontvars;
2244 
2245  sourcefixedvars = SCIPgetFixedVars(sourcescip);
2246  nsourcefixedvars = SCIPgetNFixedVars(sourcescip);
2247  nfixedbinvars = 0;
2248  nfixedintvars = 0;
2249  nfixedimplvars = 0;
2250  nfixedcontvars = 0;
2251 
2252  /* count number of fixed variables for all variable types */
2253  for( i = 0; i < nsourcefixedvars; ++i )
2254  {
2255  switch( SCIPvarGetType(sourcefixedvars[i]) )
2256  {
2257  case SCIP_VARTYPE_BINARY:
2258  nfixedbinvars++;
2259  break;
2260  case SCIP_VARTYPE_INTEGER:
2261  nfixedintvars++;
2262  break;
2263  case SCIP_VARTYPE_IMPLINT:
2264  nfixedimplvars++;
2265  break;
2267  nfixedcontvars++;
2268  break;
2269  default:
2270  SCIPerrorMessage("unknown variable type\n");
2271  return SCIP_INVALIDDATA;
2272  }
2273  }
2274  assert(nsourcefixedvars == nfixedbinvars + nfixedintvars + nfixedimplvars + nfixedcontvars);
2275  assert(SCIPgetNBinVars(sourcescip) <= SCIPgetNBinVars(targetscip));
2276  assert(SCIPgetNIntVars(sourcescip) + SCIPgetNBinVars(sourcescip) <= SCIPgetNIntVars(targetscip) + SCIPgetNBinVars(targetscip)
2277  && SCIPgetNIntVars(targetscip) + SCIPgetNBinVars(targetscip) <= SCIPgetNIntVars(sourcescip) + SCIPgetNBinVars(sourcescip) + nfixedbinvars + nfixedintvars );
2278  assert(SCIPgetNImplVars(sourcescip) <= SCIPgetNImplVars(targetscip)
2279  && SCIPgetNImplVars(targetscip) <= SCIPgetNImplVars(sourcescip) + nfixedimplvars);
2280  assert(SCIPgetNContVars(sourcescip) <= SCIPgetNContVars(targetscip)
2281  && SCIPgetNContVars(targetscip) <= SCIPgetNContVars(targetscip) + nfixedcontvars);
2282  }
2283 #endif
2284 
2285  if( uselocalvarmap )
2286  {
2287  /* free hash map */
2288  SCIPhashmapFree(&localvarmap);
2289  }
2290 
2291  if( uselocalconsmap )
2292  {
2293  /* free hash map */
2294  SCIPhashmapFree(&localconsmap);
2295  }
2296 
2297  return SCIP_OKAY;
2298 }
2299 
2300 /** copies all active variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
2301  * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
2302  * variables are not copied
2303  *
2304  * @note the variables are added to the target-SCIP but not captured
2305  *
2306  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2307  * @note Do not change the source SCIP environment during the copying process
2308  *
2309  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2310  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2311  *
2312  * @pre This method can be called if sourcescip is in one of the following stages:
2313  * - \ref SCIP_STAGE_PROBLEM
2314  * - \ref SCIP_STAGE_TRANSFORMED
2315  * - \ref SCIP_STAGE_INITPRESOLVE
2316  * - \ref SCIP_STAGE_PRESOLVING
2317  * - \ref SCIP_STAGE_EXITPRESOLVE
2318  * - \ref SCIP_STAGE_PRESOLVED
2319  * - \ref SCIP_STAGE_INITSOLVE
2320  * - \ref SCIP_STAGE_SOLVING
2321  * - \ref SCIP_STAGE_SOLVED
2322  *
2323  * @pre This method can be called if targetscip is in one of the following stages:
2324  * - \ref SCIP_STAGE_PROBLEM
2325  *
2326  * @note sourcescip stage does not get changed
2327  *
2328  * @note targetscip stage does not get changed
2329  *
2330  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2331  */
2333  SCIP* sourcescip, /**< source SCIP data structure */
2334  SCIP* targetscip, /**< target SCIP data structure */
2335  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2336  * target variables, or NULL */
2337  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2338  * target constraints, or NULL */
2339  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
2340  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
2341  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
2342  SCIP_Bool global /**< should global or local bounds be used? */
2343  )
2344 {
2345  assert(sourcescip != NULL);
2346  assert(targetscip != NULL);
2347 
2348  /* check stages for both, the source and the target SCIP data structure */
2349  SCIP_CALL( checkStage(sourcescip, "SCIPcopyVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2350  SCIP_CALL( checkStage(targetscip, "SCIPcopyVars", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2351 
2352  SCIP_CALL( copyVars(sourcescip, targetscip, varmap, consmap, fixedvars, fixedvals, nfixedvars, FALSE, global) );
2353 
2354  return SCIP_OKAY;
2355 }
2356 
2357 /** copies all original variables from source-SCIP and adds these variable to the target-SCIP; the mapping between these
2358  * variables are stored in the variable hashmap, target-SCIP has to be in problem creation stage, fixed and aggregated
2359  * variables do not get copied
2360  *
2361  * @note the variables are added to the target-SCIP but not captured
2362  *
2363  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2364  * @note Do not change the source SCIP environment during the copying process
2365  *
2366  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2367  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2368  *
2369  * @pre This method can be called if sourcescip is in one of the following stages:
2370  * - \ref SCIP_STAGE_PROBLEM
2371  * - \ref SCIP_STAGE_TRANSFORMED
2372  * - \ref SCIP_STAGE_INITPRESOLVE
2373  * - \ref SCIP_STAGE_PRESOLVING
2374  * - \ref SCIP_STAGE_EXITPRESOLVE
2375  * - \ref SCIP_STAGE_PRESOLVED
2376  * - \ref SCIP_STAGE_INITSOLVE
2377  * - \ref SCIP_STAGE_SOLVING
2378  * - \ref SCIP_STAGE_SOLVED
2379  *
2380  * @pre This method can be called if targetscip is in one of the following stages:
2381  * - \ref SCIP_STAGE_PROBLEM
2382  *
2383  * @note sourcescip stage does not get changed
2384  *
2385  * @note targetscip stage does not get changed
2386  *
2387  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2388  */
2390  SCIP* sourcescip, /**< source SCIP data structure */
2391  SCIP* targetscip, /**< target SCIP data structure */
2392  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables to the corresponding
2393  * target variables, or NULL */
2394  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2395  * target constraints, or NULL */
2396  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
2397  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
2398  int nfixedvars /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
2399  )
2400 {
2401  assert(sourcescip != NULL);
2402  assert(targetscip != NULL);
2403 
2404  /* check stages for both, the source and the target SCIP data structure */
2405  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2406  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigVars", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2407 
2408  SCIP_CALL( copyVars(sourcescip, targetscip, varmap, consmap, fixedvars, fixedvals, nfixedvars, TRUE, TRUE) );
2409 
2410  return SCIP_OKAY;
2411 }
2412 
2413 /** merges the histories of variables from a source SCIP into a target SCIP. The two data structures should point to
2414  * different SCIP instances.
2415  *
2416  * @note the notion of source and target is inverted here; \p sourcescip usually denotes a copied SCIP instance, whereas
2417  * \p targetscip denotes the original instance
2418  */
2420  SCIP* sourcescip, /**< source SCIP data structure */
2421  SCIP* targetscip, /**< target SCIP data structure */
2422  SCIP_VAR** sourcevars, /**< source variables for history merge */
2423  SCIP_VAR** targetvars, /**< target variables for history merge */
2424  int nvars /**< number of variables in both variable arrays */
2425  )
2426 {
2427  int i;
2428 
2429  /* check if target scip has been set to allow merging variable statistics */
2430  if( !targetscip->set->history_allowmerge )
2431  return SCIP_OKAY;
2432 
2433  assert(nvars == 0 || (sourcevars != NULL && targetvars != NULL));
2434  assert(sourcescip != targetscip);
2435 
2436  /* we do not want to copy statistics from a scip that has not really started solving */
2437  if( SCIPgetStage(sourcescip) < SCIP_STAGE_SOLVING )
2438  return SCIP_OKAY;
2439 
2440  /* if the transformation of the source was subject to scaling, the history information cannot be just copied */
2441  if( !SCIPsetIsEQ(targetscip->set, 1.0, SCIPgetOrigObjscale(sourcescip))
2442  || !SCIPsetIsEQ(targetscip->set, 0.0, SCIPgetOrigObjoffset(sourcescip)) )
2443  return SCIP_OKAY;
2444 
2445  /* merge histories of the targetSCIP-variables to the SCIP variables. */
2446  for( i = 0; i < nvars; ++i )
2447  {
2448  SCIP_VARSTATUS sourcevarstatus;
2449 
2450  assert(sourcevars[i]->scip == sourcescip);
2451  assert(targetvars[i]->scip == targetscip);
2452 
2453  sourcevarstatus = SCIPvarGetStatus(sourcevars[i]);
2454 
2455  /* depending on the variable status, we use either the transformed variable history or the history of the col itself */
2456  switch( sourcevarstatus )
2457  {
2459  assert(NULL != SCIPvarGetTransVar(sourcevars[i]));
2460  SCIPvarMergeHistories(targetvars[i], SCIPvarGetTransVar(sourcevars[i]), targetscip->stat);
2461  break;
2462  case SCIP_VARSTATUS_COLUMN:
2463  SCIPvarMergeHistories(targetvars[i], sourcevars[i], targetscip->stat);
2464  break;
2465  default:
2466  /* other variable status are currently not supported for the merging */
2467  break;
2468  } /*lint !e788*/
2469  }
2470 
2471  return SCIP_OKAY;
2472 }
2473 
2474 /** returns copy of the source constraint; if there already is a copy of the source constraint in the constraint hash
2475  * map, it is just returned as target constraint; elsewise a new constraint will be created; this created constraint is
2476  * added to the constraint hash map and returned as target constraint; the variable map is used to map the variables of
2477  * the source SCIP to the variables of the target SCIP
2478  *
2479  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
2480  * be declared feasible even if it violates this particular constraint. This constellation should only be
2481  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
2482  * to the variable's local bounds.
2483  *
2484  * @note The constraint is not added to the target SCIP. You can check whether a constraint is added by calling
2485  * SCIPconsIsAdded(). (If you mix SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add
2486  * explicitly and what is already added.)
2487  *
2488  * @note The constraint is always captured, either during the creation of the copy or after finding the copy of the
2489  * constraint in the constraint hash map
2490  *
2491  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2492  * @note Do not change the source SCIP environment during the copying process
2493  *
2494  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2495  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2496  *
2497  * @pre This method can be called if sourcescip is in one of the following stages:
2498  * - \ref SCIP_STAGE_PROBLEM
2499  * - \ref SCIP_STAGE_TRANSFORMED
2500  * - \ref SCIP_STAGE_INITPRESOLVE
2501  * - \ref SCIP_STAGE_PRESOLVING
2502  * - \ref SCIP_STAGE_EXITPRESOLVE
2503  * - \ref SCIP_STAGE_PRESOLVED
2504  * - \ref SCIP_STAGE_INITSOLVE
2505  * - \ref SCIP_STAGE_SOLVING
2506  * - \ref SCIP_STAGE_SOLVED
2507  *
2508  * @pre This method can be called if targetscip is in one of the following stages:
2509  * - \ref SCIP_STAGE_PROBLEM
2510  * - \ref SCIP_STAGE_TRANSFORMING
2511  * - \ref SCIP_STAGE_INITPRESOLVE
2512  * - \ref SCIP_STAGE_PRESOLVING
2513  * - \ref SCIP_STAGE_EXITPRESOLVE
2514  * - \ref SCIP_STAGE_PRESOLVED
2515  * - \ref SCIP_STAGE_SOLVING
2516  * - \ref SCIP_STAGE_EXITSOLVE
2517  *
2518  * @note sourcescip stage does not get changed
2519  *
2520  * @note targetscip stage does not get changed
2521  *
2522  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2523  */
2525  SCIP* sourcescip, /**< source SCIP data structure */
2526  SCIP* targetscip, /**< target SCIP data structure */
2527  SCIP_CONS* sourcecons, /**< source constraint of the source SCIP */
2528  SCIP_CONS** targetcons, /**< pointer to store the created target constraint */
2529  SCIP_CONSHDLR* sourceconshdlr, /**< source constraint handler for this constraint */
2530  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2531  * variables of the target SCIP, or NULL */
2532  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2533  * target constraints, or NULL */
2534  const char* name, /**< name of constraint, or NULL if the name of the source constraint should be used */
2535  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP? */
2536  SCIP_Bool separate, /**< should the constraint be separated during LP processing? */
2537  SCIP_Bool enforce, /**< should the constraint be enforced during node processing? */
2538  SCIP_Bool check, /**< should the constraint be checked for feasibility? */
2539  SCIP_Bool propagate, /**< should the constraint be propagated during node processing? */
2540  SCIP_Bool local, /**< is constraint only valid locally? */
2541  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)? */
2542  SCIP_Bool dynamic, /**< is constraint subject to aging? */
2543  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
2544  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
2545  * if it may be moved to a more global node? */
2546  SCIP_Bool global, /**< create a global or a local copy? */
2547  SCIP_Bool* valid /**< pointer to store whether the copying was valid or not */
2548  )
2549 {
2550  SCIP_HASHMAP* localvarmap;
2551  SCIP_HASHMAP* localconsmap;
2552  SCIP_Bool uselocalvarmap;
2553  SCIP_Bool uselocalconsmap;
2554 
2555  assert(targetcons != NULL);
2556  assert(sourceconshdlr != NULL);
2557 
2558  SCIP_CALL( checkStage(sourcescip, "SCIPgetConsCopy", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2559  SCIP_CALL( checkStage(targetscip, "SCIPgetConsCopy", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
2560 
2561  uselocalvarmap = (varmap == NULL);
2562  uselocalconsmap = (consmap == NULL);
2563 
2564  /* a variables map and a constraint map is needed to avoid infinite recursion */
2565  if( uselocalvarmap )
2566  {
2567  /* create the variable mapping hash map */
2568  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2569  }
2570  else
2571  localvarmap = varmap;
2572 
2573  *targetcons = NULL;
2574  if( uselocalconsmap )
2575  {
2576  /* create local constraint mapping hash map */
2577  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2578  }
2579  else
2580  {
2581  /* use global map and try to retrieve copied constraint */
2582  localconsmap = consmap;
2583  *targetcons = (SCIP_CONS*) SCIPhashmapGetImage(localconsmap, sourcecons);
2584  }
2585 
2586  if( *targetcons != NULL )
2587  {
2588  /* if found capture existing copy of the constraint */
2589  SCIP_CALL( SCIPcaptureCons(targetscip, *targetcons) );
2590  *valid = TRUE;
2591  }
2592  else
2593  {
2594  /* otherwise create a copy of the constraint */
2595  SCIP_CALL( SCIPconsCopy(targetcons, targetscip->set, name, sourcescip, sourceconshdlr, sourcecons, localvarmap, localconsmap,
2596  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
2597 
2598  /* it is possible for the constraint handler to declare the copy valid although no target constraint was created */
2599  assert(*targetcons == NULL || *valid);
2600 
2601  /* if a target constraint was created */
2602  if( *targetcons != NULL && !uselocalconsmap )
2603  {
2604  /* insert constraint into mapping between source SCIP and the target SCIP */
2605  SCIP_CALL( SCIPhashmapInsert(consmap, sourcecons, *targetcons) );
2606  }
2607  }
2608 
2609  /* free locally allocated hash maps */
2610  if( uselocalvarmap )
2611  {
2612  SCIPhashmapFree(&localvarmap);
2613  }
2614 
2615  if( uselocalconsmap )
2616  {
2617  SCIPhashmapFree(&localconsmap);
2618  }
2619 
2620  return SCIP_OKAY;
2621 }
2622 
2623 /** copies constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
2624  * variables between the source and the target SCIP a hash map can be given; if the variable hash
2625  * map is NULL or necessary variable mapping is missing, the required variables are created in the
2626  * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
2627  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
2628  * between the constraints of the source and target-SCIP is stored
2629  *
2630  * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
2631  * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
2632  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
2633  *
2634  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2635  * @note Do not change the source SCIP environment during the copying process
2636  *
2637  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2638  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2639  *
2640  * @pre This method can be called if sourcescip is in one of the following stages:
2641  * - \ref SCIP_STAGE_PROBLEM
2642  * - \ref SCIP_STAGE_TRANSFORMED
2643  * - \ref SCIP_STAGE_INITPRESOLVE
2644  * - \ref SCIP_STAGE_PRESOLVING
2645  * - \ref SCIP_STAGE_EXITPRESOLVE
2646  * - \ref SCIP_STAGE_PRESOLVED
2647  * - \ref SCIP_STAGE_INITSOLVE
2648  * - \ref SCIP_STAGE_SOLVING
2649  * - \ref SCIP_STAGE_SOLVED
2650  *
2651  * @pre This method can be called if targetscip is in one of the following stages:
2652  * - \ref SCIP_STAGE_PROBLEM
2653  *
2654  * @note sourcescip stage does not get changed
2655  *
2656  * @note targetscip stage does not get changed
2657  *
2658  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2659  */
2661  SCIP* sourcescip, /**< source SCIP data structure */
2662  SCIP* targetscip, /**< target SCIP data structure */
2663  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2664  * variables of the target SCIP, or NULL */
2665  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2666  * target constraints, or NULL */
2667  SCIP_Bool global, /**< create a global or a local copy? */
2668  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
2669  * If TRUE, the modifiable flag of constraints will be copied. */
2670  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
2671  )
2672 {
2673  SCIP_CONSHDLR** sourceconshdlrs;
2674  SCIP_HASHMAP* localvarmap;
2675  SCIP_HASHMAP* localconsmap;
2676  SCIP_Bool uselocalvarmap;
2677  SCIP_Bool uselocalconsmap;
2678  int nsourceconshdlrs;
2679  int i;
2680 
2681  assert(sourcescip != NULL);
2682  assert(targetscip != NULL);
2683  assert(valid != NULL);
2684 
2685  /* check stages for both, the source and the target SCIP data structure */
2686  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2687  SCIP_CALL( checkStage(targetscip, "SCIPcopyConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2688 
2689  /* check if we locally need to create a variable or constraint hash map */
2690  uselocalvarmap = (varmap == NULL);
2691  uselocalconsmap = (consmap == NULL);
2692 
2693  if( uselocalvarmap )
2694  {
2695  /* create the variable mapping hash map */
2696  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2697  }
2698  else
2699  localvarmap = varmap;
2700 
2701  if( uselocalconsmap )
2702  {
2703  /* create the constraint mapping hash map */
2704  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2705  }
2706  else
2707  localconsmap = consmap;
2708 
2709  nsourceconshdlrs = SCIPgetNConshdlrs(sourcescip);
2710  sourceconshdlrs = SCIPgetConshdlrs(sourcescip);
2711  assert(nsourceconshdlrs == 0 || sourceconshdlrs != NULL);
2712  assert(SCIPisTransformed(sourcescip));
2713 
2714  *valid = TRUE;
2715 
2716  /* copy constraints: loop through all (source) constraint handlers */
2717  for( i = 0; i < nsourceconshdlrs; ++i )
2718  {
2719  SCIP_CONS** sourceconss;
2720  SCIP_CONS* targetcons;
2721  int nsourceconss;
2722  int c;
2723 
2724  assert(sourceconshdlrs[i] != NULL);
2725 
2726  /* constraint handlers have to explicitly set the valid pointer to TRUE for every single constraint */
2727 
2728  /* Get all active constraints for copying; this array contains all active constraints;
2729  * constraints are active if they are globally valid and not deleted after presolving OR they
2730  * were locally added during the search and we are currently in a node which belongs to the
2731  * corresponding subtree.
2732  */
2733  nsourceconss = SCIPconshdlrGetNActiveConss(sourceconshdlrs[i]);
2734  sourceconss = SCIPconshdlrGetConss(sourceconshdlrs[i]);
2735 
2736 
2737 #ifdef SCIP_DISABLED_CODE
2738  /* @todo using the following might reduce the number of copied constraints - check whether this is better */
2739  /* Get all checked constraints for copying; this included local constraints */
2740  if( !global )
2741  {
2742  nsourceconss = SCIPconshdlrGetNCheckConss(sourceconshdlrs[i]);
2743  sourceconss = SCIPconshdlrGetCheckConss(sourceconshdlrs[i]);
2744  }
2745 #endif
2746 
2747  assert(nsourceconss == 0 || sourceconss != NULL);
2748 
2749  if( nsourceconss > 0 )
2750  {
2751  SCIPdebugMsg(sourcescip, "Attempting to copy %d %s constraints\n", nsourceconss, SCIPconshdlrGetName(sourceconshdlrs[i]));
2752  }
2753 
2754  /* copy all constraints of one constraint handler */
2755  for( c = 0; c < nsourceconss; ++c )
2756  {
2757  SCIP_Bool singlevalid = FALSE;
2758  /* all constraints have to be active */
2759  assert(sourceconss[c] != NULL);
2760  assert(SCIPconsIsActive(sourceconss[c]));
2761  assert(!SCIPconsIsDeleted(sourceconss[c]));
2762 
2763  /* in case of copying the global problem we have to ignore the local constraints which are active */
2764  if( global && SCIPconsIsLocal(sourceconss[c]) )
2765  {
2766  SCIPdebugMsg(sourcescip, "did not copy local constraint <%s> when creating global copy\n", SCIPconsGetName(sourceconss[c]));
2767  continue;
2768  }
2769 
2770  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
2771  targetcons = NULL;
2772  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconss[c], &targetcons, sourceconshdlrs[i], localvarmap, localconsmap, NULL,
2773  SCIPconsIsInitial(sourceconss[c]), SCIPconsIsSeparated(sourceconss[c]),
2774  SCIPconsIsEnforced(sourceconss[c]), SCIPconsIsChecked(sourceconss[c]),
2775  SCIPconsIsPropagated(sourceconss[c]), FALSE, SCIPconsIsModifiable(sourceconss[c]),
2776  SCIPconsIsDynamic(sourceconss[c]), SCIPconsIsRemovable(sourceconss[c]), FALSE, global, &singlevalid) );
2777 
2778  /* it is possible for a constraint handler to declare the copy valid, although no target constraint was created */
2779  assert(targetcons == NULL || singlevalid);
2780 
2781  /* add the copied constraint to target SCIP if the copying process created a constraint */
2782  if( targetcons != NULL )
2783  {
2784 
2785  if( !enablepricing )
2786  SCIPconsSetModifiable(targetcons, FALSE);
2787 
2788  /* add constraint to target SCIP */
2789  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
2790 
2791  /* add the conflict constraint to the store of targetscip */
2792  if( SCIPconsIsConflict(sourceconss[c]) )
2793  {
2794  /* add the constraint as a conflict to the conflict pool of targetscip */
2795  SCIP_CALL( SCIPconflictstoreAddConflict(targetscip->conflictstore, targetscip->mem->probmem, targetscip->set,
2796  targetscip->stat, NULL, NULL, targetscip->reopt, targetcons, SCIP_CONFTYPE_UNKNOWN, FALSE, -SCIPinfinity(targetscip)) );
2797  }
2798 
2799  /* release constraint once for the creation capture */
2800  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
2801  }
2802  else
2803  {
2804  *valid = (*valid && singlevalid);
2805  SCIPdebugMsg(sourcescip, "Constraint %s not copied, copy is %svalid\n",
2806  SCIPconsGetName(sourceconss[c]), *valid ? "" : "not ");
2807  }
2808  }
2809  }
2810 
2811  if( uselocalvarmap )
2812  {
2813  /* free hash map */
2814  SCIPhashmapFree(&localvarmap);
2815  }
2816 
2817  if( uselocalconsmap )
2818  {
2819  /* free hash map */
2820  SCIPhashmapFree(&localconsmap);
2821  }
2822 
2823  return SCIP_OKAY;
2824 }
2825 
2826 /** copies all original constraints from the source-SCIP and adds these to the target-SCIP; for mapping the
2827  * variables between the source and the target SCIP a hash map can be given; if the variable hash
2828  * map is NULL or necessary variable mapping is missing, the required variables are created in the
2829  * target-SCIP and added to the hash map, if not NULL; all variables which are created are added to
2830  * the target-SCIP but not (user) captured; if the constraint hash map is not NULL the mapping
2831  * between the constraints of the source and target-SCIP is stored
2832  *
2833  * @note the constraints are added to the target-SCIP but are not (user) captured in the target SCIP. (If you mix
2834  * SCIPgetConsCopy() with SCIPcopyConss() you should pay attention to what you add explicitly and what is already
2835  * added.) You can check whether a constraint is added by calling SCIPconsIsAdded().
2836  *
2837  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
2838  * @note Do not change the source SCIP environment during the copying process
2839  *
2840  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2841  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2842  *
2843  * @pre This method can be called if sourcescip is in one of the following stages:
2844  * - \ref SCIP_STAGE_PROBLEM
2845  * - \ref SCIP_STAGE_TRANSFORMED
2846  * - \ref SCIP_STAGE_INITPRESOLVE
2847  * - \ref SCIP_STAGE_PRESOLVING
2848  * - \ref SCIP_STAGE_EXITPRESOLVE
2849  * - \ref SCIP_STAGE_PRESOLVED
2850  * - \ref SCIP_STAGE_INITSOLVE
2851  * - \ref SCIP_STAGE_SOLVING
2852  * - \ref SCIP_STAGE_SOLVED
2853  *
2854  * @pre This method can be called if targetscip is in one of the following stages:
2855  * - \ref SCIP_STAGE_PROBLEM
2856  *
2857  * @note sourcescip stage does not get changed
2858  *
2859  * @note targetscip stage does not get changed
2860  *
2861  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2862  */
2864  SCIP* sourcescip, /**< source SCIP data structure */
2865  SCIP* targetscip, /**< target SCIP data structure */
2866  SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to the corresponding
2867  * variables of the target SCIP, or NULL */
2868  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
2869  * target constraints, or NULL */
2870  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
2871  * If TRUE, the modifiable flag of constraints will be copied. */
2872  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
2873  )
2874 {
2875  SCIP_CONS** sourceconss;
2876  SCIP_HASHMAP* localvarmap;
2877  SCIP_HASHMAP* localconsmap;
2878  SCIP_Bool uselocalvarmap;
2879  SCIP_Bool uselocalconsmap;
2880  int nsourceconss;
2881  int c;
2882 
2883  assert(sourcescip != NULL);
2884  assert(targetscip != NULL);
2885  assert(valid != NULL);
2886 
2887  /* check stages for both, the source and the target SCIP data structure */
2888  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2889  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
2890 
2891  /* check if we locally need to create a variable or constraint hash map */
2892  uselocalvarmap = (varmap == NULL);
2893  uselocalconsmap = (consmap == NULL);
2894 
2895  if( uselocalvarmap )
2896  {
2897  /* create the variable mapping hash map */
2898  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
2899  }
2900  else
2901  localvarmap = varmap;
2902 
2903  if( uselocalconsmap )
2904  {
2905  /* create the constraint mapping hash map */
2906  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
2907  }
2908  else
2909  localconsmap = consmap;
2910 
2911  sourceconss = SCIPgetOrigConss(sourcescip);
2912  nsourceconss = SCIPgetNOrigConss(sourcescip);
2913 
2914  *valid = TRUE;
2915 
2916  SCIPdebugMsg(sourcescip, "Attempting to copy %d original constraints\n", nsourceconss);
2917 
2918  /* copy constraints: loop through all (source) constraint handlers */
2919  for( c = 0; c < nsourceconss; ++c )
2920  {
2921  SCIP_CONS* targetcons;
2922  SCIP_Bool success;
2923 
2924  /* constraint handlers have to explicitly set the success pointer to TRUE */
2925  success = FALSE;
2926 
2927  /* all constraints have to be active */
2928  assert(sourceconss[c] != NULL);
2929  assert(SCIPconsIsOriginal(sourceconss[c]));
2930 
2931  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
2932  targetcons = NULL;
2933  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconss[c], &targetcons, SCIPconsGetHdlr(sourceconss[c]), localvarmap, localconsmap, NULL,
2934  SCIPconsIsInitial(sourceconss[c]), SCIPconsIsSeparated(sourceconss[c]),
2935  SCIPconsIsEnforced(sourceconss[c]), SCIPconsIsChecked(sourceconss[c]),
2936  SCIPconsIsPropagated(sourceconss[c]), FALSE, SCIPconsIsModifiable(sourceconss[c]),
2937  SCIPconsIsDynamic(sourceconss[c]), SCIPconsIsRemovable(sourceconss[c]), FALSE, TRUE, &success) );
2938 
2939  /* add the copied constraint to target SCIP if the copying process was valid */
2940  if( success )
2941  {
2942  assert(targetcons != NULL);
2943 
2944  if( !enablepricing )
2945  SCIPconsSetModifiable(targetcons, FALSE);
2946 
2947  /* add constraint to target SCIP */
2948  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
2949 
2950  /* release constraint once for the creation capture */
2951  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
2952  }
2953  else
2954  {
2955  *valid = FALSE;
2956  SCIPdebugMsg(sourcescip, "failed to copy constraint %s\n", SCIPconsGetName(sourceconss[c]));
2957  }
2958  }
2959 
2960  if( uselocalvarmap )
2961  {
2962  /* free hash map */
2963  SCIPhashmapFree(&localvarmap);
2964  }
2965 
2966  if( uselocalconsmap )
2967  {
2968  /* free hash map */
2969  SCIPhashmapFree(&localconsmap);
2970  }
2971 
2972  return SCIP_OKAY;
2973 }
2974 
2975 
2976 /** convert all active cuts from cutpool to linear constraints
2977  *
2978  * @note Do not change the source SCIP environment during the copying process
2979  *
2980  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2981  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2982  *
2983  * @pre This method can be called if SCIP is in one of the following stages:
2984  * - \ref SCIP_STAGE_PROBLEM
2985  * - \ref SCIP_STAGE_INITPRESOLVE
2986  * - \ref SCIP_STAGE_PRESOLVING
2987  * - \ref SCIP_STAGE_EXITPRESOLVE
2988  * - \ref SCIP_STAGE_PRESOLVED
2989  * - \ref SCIP_STAGE_SOLVING
2990  * - \ref SCIP_STAGE_EXITSOLVE
2991  *
2992  * @note SCIP stage does not get changed
2993  *
2994  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2995  */
2997  SCIP* scip, /**< SCIP data structure */
2998  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
2999  * target variables, or NULL */
3000  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3001  * target constraints, or NULL */
3002  SCIP_Bool global, /**< create a global or a local copy? */
3003  int* ncutsadded /**< pointer to store number of added cuts, or NULL */
3004  )
3005 {
3006  assert(scip != NULL);
3007  assert(scip->set != NULL);
3008 
3009  /* check stages for the SCIP data structure */
3010  SCIP_CALL( checkStage(scip, "SCIPconvertCutsToConss", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
3011 
3012  /* if we do not have any cuts, nothing can be converted */
3013  if( scip->set->stage < SCIP_STAGE_SOLVING )
3014  return SCIP_OKAY;
3015 
3016  /* create out of all active cuts in cutpool linear constraints in targetscip */
3017  SCIP_CALL( SCIPcopyCuts(scip, scip, varmap, consmap, global, ncutsadded) );
3018 
3019  return SCIP_OKAY;
3020 }
3021 
3022 /** copies all active cuts from cutpool of sourcescip to linear constraints in targetscip
3023  *
3024  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3025  * @note Do not change the source SCIP environment during the copying process
3026  *
3027  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3029  *
3030  * @pre This method can be called if sourcescip is in one of the following stages:
3031  * - \ref SCIP_STAGE_PROBLEM
3032  * - \ref SCIP_STAGE_TRANSFORMED
3033  * - \ref SCIP_STAGE_INITPRESOLVE
3034  * - \ref SCIP_STAGE_PRESOLVING
3035  * - \ref SCIP_STAGE_EXITPRESOLVE
3036  * - \ref SCIP_STAGE_PRESOLVED
3037  * - \ref SCIP_STAGE_SOLVING
3038  * - \ref SCIP_STAGE_SOLVED
3039  * - \ref SCIP_STAGE_EXITSOLVE
3040  *
3041  * @pre This method can be called if targetscip is in one of the following stages:
3042  * - \ref SCIP_STAGE_PROBLEM
3043  * - \ref SCIP_STAGE_INITPRESOLVE
3044  * - \ref SCIP_STAGE_PRESOLVING
3045  * - \ref SCIP_STAGE_EXITPRESOLVE
3046  * - \ref SCIP_STAGE_PRESOLVED
3047  * - \ref SCIP_STAGE_SOLVING
3048  * - \ref SCIP_STAGE_EXITSOLVE
3049  *
3050  * @note sourcescip stage does not get changed
3051  *
3052  * @note targetscip stage does not get changed
3053  *
3054  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3055  */
3057  SCIP* sourcescip, /**< source SCIP data structure */
3058  SCIP* targetscip, /**< target SCIP data structure */
3059  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3060  * target variables, or NULL */
3061  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3062  * target constraints, or NULL */
3063  SCIP_Bool global, /**< create a global or a local copy? */
3064  int* ncutsadded /**< pointer to store number of copied cuts, or NULL */
3065  )
3066 {
3067  SCIP_CUT** cuts;
3068  int ncuts;
3069  int nlocalcutsadded;
3070 
3071  assert(sourcescip != NULL);
3072  assert(targetscip != NULL);
3073 
3074  /* check stages for both, the source and the target SCIP data structure */
3075  SCIP_CALL( checkStage(sourcescip, "SCIPcopyCuts", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
3076  SCIP_CALL( checkStage(targetscip, "SCIPcopyCuts", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
3077 
3078  if ( ncutsadded != NULL )
3079  *ncutsadded = 0;
3080  nlocalcutsadded = 0;
3081 
3082  /* if we do not have any cuts, nothing can be converted */
3083  if( sourcescip->set->stage < SCIP_STAGE_SOLVING )
3084  return SCIP_OKAY;
3085 
3086  if( SCIPfindConshdlr(targetscip, "linear") == NULL )
3087  {
3088  SCIPdebugMsg(sourcescip, "No linear constraint handler available. Cannot convert cuts.\n");
3089  return SCIP_OKAY;
3090  }
3091 
3092  /* convert cut from global cut pool */
3093  cuts = SCIPgetPoolCuts(sourcescip);
3094  ncuts = SCIPgetNPoolCuts(sourcescip);
3095 
3096  SCIP_CALL( copyCuts(sourcescip, targetscip, cuts, ncuts, varmap, consmap, global, &nlocalcutsadded) );
3097 
3098  SCIPdebugMsg(sourcescip, "Converted %d active cuts to constraints.\n", nlocalcutsadded);
3099 
3100  /* convert delayed cuts from global delayed cut pool */
3101  cuts = SCIPgetDelayedPoolCuts(sourcescip);
3102  ncuts = SCIPgetNDelayedPoolCuts(sourcescip);
3103 
3104  SCIP_CALL( copyCuts(sourcescip, targetscip, cuts, ncuts, varmap, consmap, global, &nlocalcutsadded) );
3105 
3106  if( ncutsadded != NULL )
3107  *ncutsadded = nlocalcutsadded;
3108 
3109  SCIPdebugMsg(sourcescip, "Converted %d active cuts to constraints.\n", nlocalcutsadded);
3110 
3111  return SCIP_OKAY;
3112 }
3113 
3114 /** copies all active conflicts from the conflict pool of sourcescip and adds them as linear constraints to targetscip
3115  *
3116  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3117  * @note Do not change the source SCIP environment during the copying process
3118  *
3119  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3120  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3121  *
3122  * @pre This method can be called if sourcescip is in one of the following stages:
3123  * - \ref SCIP_STAGE_PROBLEM
3124  * - \ref SCIP_STAGE_TRANSFORMED
3125  * - \ref SCIP_STAGE_INITPRESOLVE
3126  * - \ref SCIP_STAGE_PRESOLVING
3127  * - \ref SCIP_STAGE_EXITPRESOLVE
3128  * - \ref SCIP_STAGE_PRESOLVED
3129  * - \ref SCIP_STAGE_SOLVING
3130  * - \ref SCIP_STAGE_SOLVED
3131  * - \ref SCIP_STAGE_EXITSOLVE
3132  *
3133  * @pre This method can be called if targetscip is in one of the following stages:
3134  * - \ref SCIP_STAGE_PROBLEM
3135  * - \ref SCIP_STAGE_INITPRESOLVE
3136  * - \ref SCIP_STAGE_PRESOLVING
3137  * - \ref SCIP_STAGE_EXITPRESOLVE
3138  * - \ref SCIP_STAGE_PRESOLVED
3139  * - \ref SCIP_STAGE_SOLVING
3140  * - \ref SCIP_STAGE_EXITSOLVE
3141  *
3142  * @note sourcescip stage does not change
3143  *
3144  * @note targetscip stage does not change
3145  *
3146  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3147  */
3149  SCIP* sourcescip, /**< source SCIP data structure */
3150  SCIP* targetscip, /**< target SCIP data structure */
3151  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3152  * target variables, or NULL */
3153  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3154  * target constraints, or NULL */
3155  SCIP_Bool global, /**< create a global or a local copy? */
3156  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance?
3157  * If TRUE, the modifiable flag of constraints will be copied. */
3158  SCIP_Bool* valid /**< pointer to store whether all constraints were validly copied */
3159  )
3160 {
3161  SCIP_CONS** sourceconfs;
3162  SCIP_HASHMAP* localvarmap;
3163  SCIP_HASHMAP* localconsmap;
3164  SCIP_Bool uselocalvarmap;
3165  SCIP_Bool uselocalconsmap;
3166  SCIP_Bool success;
3167  int sourceconfssize;
3168  int nsourceconfs;
3169  int c;
3170 
3171  assert(sourcescip != NULL);
3172  assert(targetscip != NULL);
3173 
3174  /* check stages for both, the source and the target SCIP data structure */
3175  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3176  SCIP_CALL( checkStage(targetscip, "SCIPcopyConss", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
3177 
3178  /* check if we locally need to create a variable or constraint hash map */
3179  uselocalvarmap = (varmap == NULL);
3180  uselocalconsmap = (consmap == NULL);
3181 
3182  if( uselocalvarmap )
3183  {
3184  /* create the variable mapping hash map */
3185  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
3186  }
3187  else
3188  localvarmap = varmap;
3189 
3190  if( uselocalconsmap )
3191  {
3192  /* create the constraint mapping hash map */
3193  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
3194  }
3195  else
3196  localconsmap = consmap;
3197 
3198  /* get number of conflicts stored in the conflict pool */
3199  sourceconfssize = SCIPconflictstoreGetNConflictsInStore(sourcescip->conflictstore);
3200 
3201  /* allocate buffer */
3202  SCIP_CALL( SCIPallocBufferArray(sourcescip, &sourceconfs, sourceconfssize) );
3203 
3204  /* get all conflicts stored in the conflict pool */
3205  SCIP_CALL( SCIPconflictstoreGetConflicts(sourcescip->conflictstore, sourceconfs, sourceconfssize, &nsourceconfs) );
3206  assert(nsourceconfs <= sourceconfssize);
3207 
3208  assert(SCIPisTransformed(sourcescip));
3209 
3210  /* copy conflicts */
3211  for( c = 0; c < nsourceconfs; ++c )
3212  {
3213  SCIP_CONS* targetcons;
3214 
3215  /* all constraints have to be active */
3216  assert(sourceconfs[c] != NULL);
3217  assert(SCIPconsIsActive(sourceconfs[c]));
3218  assert(!SCIPconsIsDeleted(sourceconfs[c]));
3219  assert(SCIPconsIsConflict(sourceconfs[c]));
3220 
3221  /* in case of copying the global problem we have to ignore the local constraints which are active */
3222  if( global && SCIPconsIsLocal(sourceconfs[c]) )
3223  {
3224  SCIPdebugMsg(sourcescip, "did not copy local constraint <%s> when creating global copy\n", SCIPconsGetName(sourceconfs[c]));
3225  continue;
3226  }
3227 
3228  /* use the copy constructor of the constraint handler and creates and captures the constraint if possible */
3229  targetcons = NULL;
3230  SCIP_CALL( SCIPgetConsCopy(sourcescip, targetscip, sourceconfs[c], &targetcons, SCIPconsGetHdlr(sourceconfs[c]),
3231  localvarmap, localconsmap, NULL, SCIPconsIsInitial(sourceconfs[c]), SCIPconsIsSeparated(sourceconfs[c]),
3232  SCIPconsIsEnforced(sourceconfs[c]), SCIPconsIsChecked(sourceconfs[c]),
3233  SCIPconsIsPropagated(sourceconfs[c]), FALSE, SCIPconsIsModifiable(sourceconfs[c]),
3234  SCIPconsIsDynamic(sourceconfs[c]), SCIPconsIsRemovable(sourceconfs[c]), FALSE, global, &success) );
3235 
3236  /* add the copied constraint to target SCIP if the copying process was valid */
3237  if( success )
3238  {
3239  assert(targetcons != NULL);
3240 
3241  if( !enablepricing )
3242  SCIPconsSetModifiable(targetcons, FALSE);
3243 
3244  /* add constraint to target SCIP */
3245  SCIP_CALL( SCIPaddCons(targetscip, targetcons) );
3246 
3247  /* release constraint once for the creation capture */
3248  SCIP_CALL( SCIPreleaseCons(targetscip, &targetcons) );
3249  }
3250  else
3251  {
3252  *valid = FALSE;
3253  SCIPdebugMsg(sourcescip, "failed to copy constraint %s\n", SCIPconsGetName(sourceconfs[c]));
3254  }
3255  }
3256 
3257  if( uselocalvarmap )
3258  {
3259  /* free hash map */
3260  SCIPhashmapFree(&localvarmap);
3261  }
3262 
3263  if( uselocalconsmap )
3264  {
3265  /* free hash map */
3266  SCIPhashmapFree(&localconsmap);
3267  }
3268 
3269  return SCIP_OKAY;
3270 }
3271 
3272 /** copies implications and cliques of sourcescip to targetscip
3273  *
3274  * This function should be called for a targetscip in transformed stage. It can save time in presolving of the
3275  * targetscip, since implications and cliques are copied.
3276  *
3277  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3278  * @note Do not change the source SCIP environment during the copying process
3279  *
3280  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3281  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3282  *
3283  * @pre This method can be called if sourcescip is in one of the following stages:
3284  * - \ref SCIP_STAGE_TRANSFORMED
3285  * - \ref SCIP_STAGE_INITPRESOLVE
3286  * - \ref SCIP_STAGE_PRESOLVING
3287  * - \ref SCIP_STAGE_EXITPRESOLVE
3288  * - \ref SCIP_STAGE_PRESOLVED
3289  * - \ref SCIP_STAGE_SOLVING
3290  * - \ref SCIP_STAGE_SOLVED
3291  * - \ref SCIP_STAGE_EXITSOLVE
3292  *
3293  * @pre This method can be called if targetscip is in one of the following stages:
3294  * - \ref SCIP_STAGE_TRANSFORMED
3295  * - \ref SCIP_STAGE_INITPRESOLVE
3296  * - \ref SCIP_STAGE_PRESOLVING
3297  * - \ref SCIP_STAGE_EXITPRESOLVE
3298  * - \ref SCIP_STAGE_PRESOLVED
3299  * - \ref SCIP_STAGE_INITSOLVE
3300  * - \ref SCIP_STAGE_SOLVING
3301  *
3302  * @note sourcescip stage does not get changed
3303  *
3304  * @note targetscip stage does not get changed
3305  *
3306  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3307  */
3309  SCIP* sourcescip, /**< source SCIP data structure */
3310  SCIP* targetscip, /**< target SCIP data structure */
3311  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3312  * target variables, or NULL */
3313  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3314  * target constraints, or NULL */
3315  SCIP_Bool global, /**< create a global or a local copy? */
3316  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
3317  int* nbdchgs, /**< pointer to store the number of performed bound changes, or NULL */
3318  int* ncopied /**< pointer to store number of copied implications and cliques, or NULL */
3319  )
3320 {
3321  SCIP_CLIQUE** cliques;
3322  SCIP_VAR** sourcevars;
3323  SCIP_Bool success;
3324  int nvars;
3325  int nbinvars;
3326  int ncliques;
3327  int j;
3328  int c;
3329 
3330  assert( sourcescip != NULL );
3331  assert( targetscip != NULL );
3332  assert( sourcescip != targetscip );
3333  assert( infeasible != NULL );
3334 
3335  /* check stages for both, the source and the target SCIP data structure */
3336  SCIP_CALL( checkStage(sourcescip, "SCIPcopyImplicationsCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
3337  SCIP_CALL( checkStage(targetscip, "SCIPcopyImplicationsCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
3338 
3339  if ( ncopied != NULL )
3340  *ncopied = 0;
3341  if ( nbdchgs != NULL )
3342  *nbdchgs = 0;
3343 
3344  /* get all active variables */
3345  SCIP_CALL( SCIPgetVarsData(sourcescip, &sourcevars, &nvars, &nbinvars, NULL, NULL, NULL) );
3346 
3347  /* stop if no possible variables for cliques exist */
3348  if ( nbinvars == 0 )
3349  return SCIP_OKAY;
3350 
3351  /* get cliques */
3352  ncliques = SCIPgetNCliques(sourcescip);
3353  if ( ncliques > 0 )
3354  {
3355  SCIP_VAR** targetclique;
3356 
3357  /* get space for target cliques */
3358  SCIP_CALL( SCIPallocBufferArray(targetscip, &targetclique, nvars) );
3359  cliques = SCIPgetCliques(sourcescip);
3360 
3361  /* loop through all cliques */
3362  for (c = 0; c < ncliques; ++c)
3363  {
3364  SCIP_VAR** cliquevars;
3365  SCIP_Bool* cliquevals;
3366  int cliquesize;
3367  int nboundchg = 0;
3368 
3369  assert( cliques[c] != NULL );
3370  cliquevals = SCIPcliqueGetValues(cliques[c]);
3371  cliquevars = SCIPcliqueGetVars(cliques[c]);
3372  cliquesize = SCIPcliqueGetNVars(cliques[c]);
3373 
3374  /* get target variables of clique */
3375  for (j = 0; j < cliquesize; ++j)
3376  {
3377  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, cliquevars[j], &targetclique[j], varmap, consmap, global, &success) );
3378  if ( ! success )
3379  {
3380  SCIPdebugMsg(sourcescip, "Getting copy for variable <%s> failed.\n", SCIPvarGetName(cliquevars[j]));
3381  SCIPfreeBufferArray(targetscip, &targetclique);
3382  return SCIP_OKAY;
3383  }
3384  }
3385 
3386  /* create clique */
3387  SCIP_CALL( SCIPaddClique(targetscip, targetclique, cliquevals, cliquesize, SCIPcliqueIsEquation(cliques[c]),
3388  infeasible, &nboundchg) );
3389 
3390  if ( *infeasible )
3391  {
3392  SCIPfreeBufferArray(targetscip, &targetclique);
3393  return SCIP_OKAY;
3394  }
3395  if ( ncopied != NULL )
3396  ++(*ncopied);
3397  if ( nbdchgs != NULL )
3398  *nbdchgs += nboundchg;
3399  }
3400  SCIPfreeBufferArray(targetscip, &targetclique);
3401  }
3402 
3403  /* create binary implications */
3404  for (j = 0; j < nbinvars; ++j)
3405  {
3406  SCIP_VAR* sourcevar;
3407  SCIP_VAR* targetvar;
3408  SCIP_Bool d;
3409 
3410  sourcevar = sourcevars[j];
3411  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, sourcevar, &targetvar, varmap, consmap, global, &success) );
3412  if ( ! success )
3413  {
3414  SCIPdebugMsg(sourcescip, "Getting copy for variable <%s> failed.\n", SCIPvarGetName(sourcevar));
3415  return SCIP_OKAY;
3416  }
3417 
3418  /* consider both possible implications */
3419  for (d = 0; d <= 1; ++d)
3420  {
3421  SCIP_BOUNDTYPE* impltypes;
3422  SCIP_VAR** implvars;
3423  SCIP_Real* implbounds;
3424  int nimpls;
3425  int l;
3426 
3427  nimpls = SCIPvarGetNImpls(sourcevar, d);
3428  if ( nimpls == 0 )
3429  continue;
3430 
3431  impltypes = SCIPvarGetImplTypes(sourcevar, d);
3432  implvars = SCIPvarGetImplVars(sourcevar, d);
3433  implbounds = SCIPvarGetImplBounds(sourcevar, d);
3434 
3435  /* create implications */
3436  for (l = 0; l < nimpls; ++l)
3437  {
3438  SCIP_VAR* implvar;
3439  int nboundchg = 0;
3440 
3441  SCIP_CALL( SCIPgetVarCopy(sourcescip, targetscip, implvars[l], &implvar, varmap, consmap, global, &success) );
3442  if ( ! success )
3443  {
3444  SCIPdebugMsg(sourcescip, "Getting copy for variable <%s> failed.\n", SCIPvarGetName(implvars[l]));
3445  return SCIP_OKAY;
3446  }
3447 
3448  SCIP_CALL( SCIPaddVarImplication(targetscip, targetvar, d, implvar, impltypes[l], implbounds[l], infeasible, &nboundchg) );
3449  if ( *infeasible )
3450  return SCIP_OKAY;
3451  if ( ncopied != NULL )
3452  ++(*ncopied);
3453  if ( nbdchgs != NULL )
3454  *nbdchgs += nboundchg;
3455  }
3456  }
3457  }
3458 
3459  return SCIP_OKAY;
3460 }
3461 
3462 /** copies parameter settings from sourcescip to targetscip
3463  *
3464  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3465  * @note Do not change the source SCIP environment during the copying process
3466  *
3467  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3468  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3469  *
3470  * @pre This method can be called if sourcescip is in one of the following stages:
3471  * - \ref SCIP_STAGE_PROBLEM
3472  * - \ref SCIP_STAGE_TRANSFORMED
3473  * - \ref SCIP_STAGE_INITPRESOLVE
3474  * - \ref SCIP_STAGE_PRESOLVING
3475  * - \ref SCIP_STAGE_EXITPRESOLVE
3476  * - \ref SCIP_STAGE_PRESOLVED
3477  * - \ref SCIP_STAGE_INITSOLVE
3478  * - \ref SCIP_STAGE_SOLVING
3479  * - \ref SCIP_STAGE_SOLVED
3480  *
3481  * @pre This method can be called if targetscip is in one of the following stages:
3482  * - \ref SCIP_STAGE_INIT
3483  * - \ref SCIP_STAGE_PROBLEM
3484  * - \ref SCIP_STAGE_FREE
3485  *
3486  * @note sourcescip stage does not get changed
3487  *
3488  * @note targetscip stage does not get changed
3489  *
3490  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3491  */
3493  SCIP* sourcescip, /**< source SCIP data structure */
3494  SCIP* targetscip /**< target SCIP data structure */
3495  )
3496 {
3497  assert(sourcescip != NULL);
3498  assert(targetscip != NULL);
3499  assert(sourcescip->set != NULL);
3500  assert(targetscip->set != NULL);
3501 
3502  /* check stages for both, the source and the target SCIP data structure */
3503  SCIP_CALL( checkStage(sourcescip, "SCIPcopyParamSettings", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3504  SCIP_CALL( checkStage(targetscip, "SCIPcopyParamSettings", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3505 
3506  SCIP_CALL( SCIPsetCopyParams(sourcescip->set, targetscip->set, targetscip->messagehdlr) );
3507 
3508  return SCIP_OKAY;
3509 }
3510 
3511 /** gets depth of current scip instance (increased by each copy call)
3512  *
3513  * @return Depth of subscip of SCIP is returned.
3514  *
3515  * @pre This method can be called if SCIP is in one of the following stages:
3516  * - \ref SCIP_STAGE_PROBLEM
3517  * - \ref SCIP_STAGE_TRANSFORMING
3518  * - \ref SCIP_STAGE_TRANSFORMED
3519  * - \ref SCIP_STAGE_INITPRESOLVE
3520  * - \ref SCIP_STAGE_PRESOLVING
3521  * - \ref SCIP_STAGE_EXITPRESOLVE
3522  * - \ref SCIP_STAGE_PRESOLVED
3523  * - \ref SCIP_STAGE_INITSOLVE
3524  * - \ref SCIP_STAGE_SOLVING
3525  * - \ref SCIP_STAGE_SOLVED
3526  * - \ref SCIP_STAGE_EXITSOLVE
3527  * - \ref SCIP_STAGE_FREETRANS
3528  *
3529  * @note SCIP stage does not get changed
3530  *
3531  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3532  */
3534  SCIP* scip /**< SCIP data structure */
3535  )
3536 {
3537  assert( scip != NULL );
3538  assert( scip->stat != NULL );
3539 
3540  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSubscipDepth", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
3541 
3542  return scip->stat->subscipdepth;
3543 }
3544 
3545 /** copies source SCIP data into target SCIP data structure
3546  *
3547  * distinguishes between
3548  * - local and global copies
3549  * - copies of the original or transformed problem
3550  *
3551  * Allows for constraint compression by specifying a number of source variables
3552  * and values that should be fixed in the copy.
3553  */
3554 static
3556  SCIP* sourcescip, /**< source SCIP data structure */
3557  SCIP* targetscip, /**< target SCIP data structure */
3558  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3559  * target variables, or NULL */
3560  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3561  * target constraints, or NULL */
3562  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
3563  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
3564  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
3565  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
3566  SCIP_Bool useconscompression, /**< should constraint compression be used when constraints are created? */
3567  SCIP_Bool global, /**< create a global or a local copy? */
3568  SCIP_Bool original, /**< copy original or transformed problem? if TRUE, a copy using local bounds is not possible */
3569  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3570  * plugins will be copied and activated, and the modifiable flag of
3571  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3572  * there are pricers present */
3573  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3574  SCIP_Bool* valid /**< pointer to store whether the copying was valid or not, or NULL */
3575  )
3576 {
3577  SCIP_HASHMAP* localvarmap;
3578  SCIP_HASHMAP* localconsmap;
3579  SCIP_Real startcopytime;
3580  SCIP_Real copytime;
3581  SCIP_Bool uselocalvarmap;
3582  SCIP_Bool uselocalconsmap;
3583  SCIP_Bool consscopyvalid;
3584  SCIP_Bool localvalid;
3585  SCIP_Bool msghdlrquiet;
3586  char name[SCIP_MAXSTRLEN];
3587 
3588  assert(sourcescip != NULL);
3589  assert(targetscip != NULL);
3590  assert(suffix != NULL);
3591  assert(global || !original);
3592 
3593  /* get time before start of copy procedure */
3594  startcopytime = SCIPclockGetTime(sourcescip->stat->copyclock);
3595 
3596  /* start time measuring */
3597  SCIPclockStart(sourcescip->stat->copyclock, sourcescip->set);
3598 
3599  /* copy all plugins */
3600  SCIP_CALL( SCIPcopyPlugins(sourcescip, targetscip, TRUE, enablepricing, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
3601  TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, passmessagehdlr, &localvalid) );
3602 
3603  /* in case there are active pricers and pricing is disabled the target SCIP will not be a valid copy of the source
3604  * SCIP
3605  */
3606  if( ! enablepricing && SCIPgetNActivePricers(sourcescip) > 0 )
3607  localvalid = FALSE;
3608 
3609  SCIPdebugMsg(sourcescip, "Copying plugins was%s valid.\n", localvalid ? "" : " not");
3610 
3611  uselocalvarmap = (varmap == NULL);
3612  uselocalconsmap = (consmap == NULL);
3613 
3614  if( uselocalvarmap )
3615  {
3616  /* create the variable mapping hash map */
3617  SCIP_CALL( SCIPhashmapCreate(&localvarmap, SCIPblkmem(targetscip), SCIPgetNVars(sourcescip)) );
3618  }
3619  else
3620  localvarmap = varmap;
3621 
3622  if( uselocalconsmap )
3623  {
3624  /* create the constraint mapping hash map */
3625  SCIP_CALL( SCIPhashmapCreate(&localconsmap, SCIPblkmem(targetscip), SCIPgetNConss(sourcescip)) );
3626  }
3627  else
3628  localconsmap = consmap;
3629 
3630  /* construct name for the target SCIP using the source problem name and the given suffix string */
3631  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPgetProbName(sourcescip), suffix);
3632 
3633  /* store the quiet state of the message handler, if existent */
3634  msghdlrquiet = SCIPmessagehdlrIsQuiet(targetscip->messagehdlr);
3635 
3636  /* explicitly suppress output when copying parameters */
3637  SCIPsetMessagehdlrQuiet(targetscip, TRUE);
3638  /* copy all settings */
3639  SCIP_CALL( SCIPcopyParamSettings(sourcescip, targetscip) );
3640 
3641  /* restore original quiet state */
3642  SCIPsetMessagehdlrQuiet(targetscip, msghdlrquiet);
3643 
3644  /* create problem in the target SCIP copying the source original or transformed problem data */
3645  if( original )
3646  {
3647  SCIP_CALL( SCIPcopyOrigProb(sourcescip, targetscip, localvarmap, localconsmap, name) );
3648  }
3649  else
3650  {
3651  SCIP_CALL( SCIPcopyProb(sourcescip, targetscip, localvarmap, localconsmap, global, name) );
3652  }
3653 
3654  /* copy original or transformed variables and perform fixings if needed */
3655  SCIP_CALL( copyVars(sourcescip, targetscip, localvarmap, localconsmap, fixedvars, fixedvals, nfixedvars, original, global) );
3656 
3657  /* if fixed variables are directly specified or inferred from local bounds,
3658  * enable constraint compression
3659  */
3660  if( useconscompression && (nfixedvars > 0 || !global) )
3661  {
3662  SCIP_CALL( SCIPenableConsCompression(targetscip) );
3663 
3664  /* domain reductions yield a copy that is no longer guaranteed to be valid */
3665  localvalid = FALSE;
3666  }
3667 
3668  /* copy all (original) constraints */
3669  if( original )
3670  {
3671  SCIP_CALL( SCIPcopyOrigConss(sourcescip, targetscip, localvarmap, localconsmap, enablepricing, &consscopyvalid) );
3672  }
3673  else
3674  {
3675  SCIP_CALL( SCIPcopyConss(sourcescip, targetscip, localvarmap, localconsmap, global, enablepricing, &consscopyvalid) );
3676  }
3677 
3678  SCIPdebugMsg(sourcescip, "Copying constraints was%s valid.\n", consscopyvalid ? "" : " not");
3679 
3680  localvalid = localvalid && consscopyvalid;
3681 
3682  if( uselocalvarmap )
3683  {
3684  /* free hash map */
3685  SCIPhashmapFree(&localvarmap);
3686  }
3687 
3688  if( uselocalconsmap )
3689  {
3690  /* free hash map */
3691  SCIPhashmapFree(&localconsmap);
3692  }
3693 
3694  /* stop time measuring */
3695  SCIPclockStop(sourcescip->stat->copyclock, sourcescip->set);
3696 
3697  /* get time after copying procedure */
3698  copytime = SCIPclockGetTime(sourcescip->stat->copyclock) - startcopytime;
3699 
3700  if( copytime > sourcescip->stat->maxcopytime )
3701  sourcescip->stat->maxcopytime = copytime;
3702  if( copytime < sourcescip->stat->mincopytime )
3703  sourcescip->stat->mincopytime = copytime;
3704 
3705  /* increase copy counter */
3706  ++(sourcescip->stat->ncopies);
3707 
3708  targetscip->concurrent = sourcescip->concurrent;
3709  SCIP_CALL( SCIPsyncstoreRelease(&targetscip->syncstore) );
3710  targetscip->syncstore = sourcescip->syncstore;
3711  SCIP_CALL( SCIPsyncstoreCapture(targetscip->syncstore) );
3712 
3713  /* return the information about a valid copy to the user */
3714  if( valid != NULL )
3715  *valid = localvalid;
3716 
3717  return SCIP_OKAY;
3718 }
3719 
3720 /** copies source SCIP to target SCIP; the copying process is done in the following order:
3721  * 1) copy the plugins
3722  * 2) copy the settings
3723  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
3724  * 4) copy all active variables
3725  * 5) copy all constraints
3726  *
3727  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3728  *
3729  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3730  * Also, 'passmessagehdlr' should be set to FALSE.
3731  * @note Do not change the source SCIP environment during the copying process
3732  *
3733  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3734  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3735  *
3736  * @pre This method can be called if sourcescip is in one of the following stages:
3737  * - \ref SCIP_STAGE_PROBLEM
3738  * - \ref SCIP_STAGE_TRANSFORMED
3739  * - \ref SCIP_STAGE_INITPRESOLVE
3740  * - \ref SCIP_STAGE_PRESOLVING
3741  * - \ref SCIP_STAGE_EXITPRESOLVE
3742  * - \ref SCIP_STAGE_PRESOLVED
3743  * - \ref SCIP_STAGE_INITSOLVE
3744  * - \ref SCIP_STAGE_SOLVING
3745  * - \ref SCIP_STAGE_SOLVED
3746  *
3747  * @pre This method can be called if targetscip is in one of the following stages:
3748  * - \ref SCIP_STAGE_INIT
3749  * - \ref SCIP_STAGE_FREE
3750  *
3751  * @note sourcescip stage does not get changed
3752  *
3753  * @note targetscip stage does not get changed
3754  *
3755  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3756  */
3758  SCIP* sourcescip, /**< source SCIP data structure */
3759  SCIP* targetscip, /**< target SCIP data structure */
3760  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3761  * target variables, or NULL */
3762  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3763  * target constraints, or NULL */
3764  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
3765  SCIP_Bool global, /**< create a global or a local copy? */
3766  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3767  * plugins will be copied and activated, and the modifiable flag of
3768  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3769  * there are pricers present */
3770  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3771  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
3772  )
3773 {
3774  SCIP_VAR** fixedvars = NULL;
3775  SCIP_Real* fixedvals = NULL;
3776  int nfixedvars = 0;
3777  SCIP_Bool original = FALSE;
3778  SCIP_Bool useconscompression = FALSE;
3779 
3780  assert(sourcescip != NULL);
3781  assert(targetscip != NULL);
3782  assert(suffix != NULL);
3783 
3784  /* check stages for both, the source and the target SCIP data structure */
3785  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConsCompression", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3786  SCIP_CALL( checkStage(targetscip, "SCIPcopyConsCompression", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3787 
3788  /* copy source SCIP data into target SCIP data structure */
3789  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
3790  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
3791 
3792  return SCIP_OKAY;
3793 }
3794 
3795 /** copies source SCIP to target SCIP but compresses constraints
3796  *
3797  * constraint compression is performed by removing fixed variables immediately
3798  * during constraint creation if the involved constraint handlers support
3799  * compression
3800  *
3801  * the copying process is done in the following order:
3802  * 1) copy the plugins
3803  * 2) copy the settings
3804  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
3805  * 4) copy all active variables
3806  * a) fix all variable copies specified by \p fixedvars, \p fixedvals, and \p nfixedvars
3807  * b) enable constraint compression
3808  * 5) copy all constraints
3809  *
3810  * @note: in case that a combination of local bounds and explicit fixing values should be used,
3811  * the fixing value of a variable is prefered if local bounds and fixing value disagree.
3812  *
3813  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3814  *
3815  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3816  * Also, 'passmessagehdlr' should be set to FALSE.
3817  * @note Do not change the source SCIP environment during the copying process
3818  *
3819  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3820  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3821  *
3822  * @pre This method can be called if sourcescip is in one of the following stages:
3823  * - \ref SCIP_STAGE_PROBLEM
3824  * - \ref SCIP_STAGE_TRANSFORMED
3825  * - \ref SCIP_STAGE_INITPRESOLVE
3826  * - \ref SCIP_STAGE_PRESOLVING
3827  * - \ref SCIP_STAGE_EXITPRESOLVE
3828  * - \ref SCIP_STAGE_PRESOLVED
3829  * - \ref SCIP_STAGE_INITSOLVE
3830  * - \ref SCIP_STAGE_SOLVING
3831  * - \ref SCIP_STAGE_SOLVED
3832  *
3833  * @pre This method can be called if targetscip is in one of the following stages:
3834  * - \ref SCIP_STAGE_INIT
3835  * - \ref SCIP_STAGE_FREE
3836  *
3837  * @note sourcescip stage does not get changed
3838  *
3839  * @note targetscip stage does not get changed
3840  *
3841  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3842  */
3844  SCIP* sourcescip, /**< source SCIP data structure */
3845  SCIP* targetscip, /**< target SCIP data structure */
3846  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3847  * target variables, or NULL */
3848  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3849  * target constraints, or NULL */
3850  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
3851  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
3852  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
3853  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
3854  SCIP_Bool global, /**< create a global or a local copy? */
3855  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3856  * plugins will be copied and activated, and the modifiable flag of
3857  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3858  * there are pricers present */
3859  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3860  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
3861  )
3862 {
3863  SCIP_Bool original = FALSE;
3864  SCIP_Bool useconscompression = TRUE;
3865 
3866  assert(sourcescip != NULL);
3867  assert(targetscip != NULL);
3868  assert(suffix != NULL);
3869 
3870  /* check stages for both, the source and the target SCIP data structure */
3871  SCIP_CALL( checkStage(sourcescip, "SCIPcopyConsCompression", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3872  SCIP_CALL( checkStage(targetscip, "SCIPcopyConsCompression", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3873 
3874  /* copy the source problem data */
3875  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
3876  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
3877 
3878  return SCIP_OKAY;
3879 }
3880 
3881 
3882 /** copies source SCIP original problem to target SCIP; the copying process is done in the following order:
3883  * 1) copy the plugins
3884  * 2) copy the settings
3885  * 3) create problem data in target-SCIP and copy the original problem data of the source-SCIP
3886  * 4) copy all original variables
3887  * 5) copy all original constraints
3888  *
3889  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3890  *
3891  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3892  * Also, 'passmessagehdlr' should be set to FALSE.
3893  * @note Do not change the source SCIP environment during the copying process
3894  *
3895  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3896  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3897  *
3898  * @pre This method can be called if sourcescip is in one of the following stages:
3899  * - \ref SCIP_STAGE_PROBLEM
3900  * - \ref SCIP_STAGE_TRANSFORMED
3901  * - \ref SCIP_STAGE_INITPRESOLVE
3902  * - \ref SCIP_STAGE_PRESOLVING
3903  * - \ref SCIP_STAGE_EXITPRESOLVE
3904  * - \ref SCIP_STAGE_PRESOLVED
3905  * - \ref SCIP_STAGE_INITSOLVE
3906  * - \ref SCIP_STAGE_SOLVING
3907  * - \ref SCIP_STAGE_SOLVED
3908  *
3909  * @pre This method can be called if targetscip is in one of the following stages:
3910  * - \ref SCIP_STAGE_INIT
3911  * - \ref SCIP_STAGE_FREE
3912  *
3913  * @note sourcescip stage does not get changed
3914  *
3915  * @note targetscip stage does not get changed
3916  *
3917  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
3918  */
3920  SCIP* sourcescip, /**< source SCIP data structure */
3921  SCIP* targetscip, /**< target SCIP data structure */
3922  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
3923  * target variables, or NULL */
3924  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
3925  * target constraints, or NULL */
3926  const char* suffix, /**< suffix which will be added to the names of the target SCIP, might be empty */
3927  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
3928  * plugins will be copied and activated, and the modifiable flag of
3929  * constraints will be respected. If FALSE, valid will be set to FALSE, when
3930  * there are pricers present */
3931  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
3932  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
3933  )
3934 {
3935  SCIP_VAR** fixedvars = NULL;
3936  SCIP_Real* fixedvals = NULL;
3937  int nfixedvars = 0;
3938  SCIP_Bool global = TRUE;
3939  SCIP_Bool original = TRUE;
3940  SCIP_Bool useconscompression = FALSE;
3941 
3942  assert(sourcescip != NULL);
3943  assert(targetscip != NULL);
3944  assert(suffix != NULL);
3945 
3946  /* check stages for both, the source and the target SCIP data structure */
3947  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3948  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrig", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
3949 
3950  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
3951  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
3952 
3953  return SCIP_OKAY;
3954 }
3955 
3956 /** copies source SCIP original problem to target SCIP but compresses constraints
3957  *
3958  * constraint compression is performed by removing fixed variables immediately
3959  * during constraint creation if the involved constraint handlers support
3960  * compression
3961  *
3962  * the copying process is done in the following order:
3963  * 1) copy the plugins
3964  * 2) copy the settings
3965  * 3) create problem data in target-SCIP and copy the problem data of the source-SCIP
3966  * 4) copy all original variables
3967  * a) fix all variable copies specified by \p fixedvars, \p fixedvals, and \p nfixedvars
3968  * b) enable constraint compression
3969  * 5) copy all constraints
3970  *
3971  * @note all variables and constraints which are created in the target-SCIP are not (user) captured
3972  *
3973  * @note In a multi thread case, you need to lock the copying procedure from outside with a mutex.
3974  * Also, 'passmessagehdlr' should be set to FALSE.
3975  * @note Do not change the source SCIP environment during the copying process
3976  *
3977  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3978  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3979  *
3980  * @pre This method can be called if sourcescip is in one of the following stages:
3981  * - \ref SCIP_STAGE_PROBLEM
3982  * - \ref SCIP_STAGE_TRANSFORMED
3983  * - \ref SCIP_STAGE_INITPRESOLVE
3984  * - \ref SCIP_STAGE_PRESOLVING
3985  * - \ref SCIP_STAGE_EXITPRESOLVE
3986  * - \ref SCIP_STAGE_PRESOLVED
3987  * - \ref SCIP_STAGE_INITSOLVE
3988  * - \ref SCIP_STAGE_SOLVING
3989  * - \ref SCIP_STAGE_SOLVED
3990  *
3991  * @pre This method can be called if targetscip is in one of the following stages:
3992  * - \ref SCIP_STAGE_INIT
3993  * - \ref SCIP_STAGE_FREE
3994  *
3995  * @note sourcescip stage does not get changed
3996  *
3997  * @note targetscip stage does not get changed
3998  *
3999  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
4000  */
4002  SCIP* sourcescip, /**< source SCIP data structure */
4003  SCIP* targetscip, /**< target SCIP data structure */
4004  SCIP_HASHMAP* varmap, /**< a hashmap to store the mapping of source variables corresponding
4005  * target variables, or NULL */
4006  SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
4007  * target constraints, or NULL */
4008  const char* suffix, /**< optional suffix for problem name inside the target SCIP */
4009  SCIP_VAR** fixedvars, /**< source variables whose copies should be fixed in the target SCIP environment, or NULL */
4010  SCIP_Real* fixedvals, /**< array of fixing values for target SCIP variables, or NULL */
4011  int nfixedvars, /**< number of source variables whose copies should be fixed in the target SCIP environment, or NULL */
4012  SCIP_Bool enablepricing, /**< should pricing be enabled in copied SCIP instance? If TRUE, pricer
4013  * plugins will be copied and activated, and the modifiable flag of
4014  * constraints will be respected. If FALSE, valid will be set to FALSE, when
4015  * there are pricers present */
4016  SCIP_Bool passmessagehdlr, /**< should the message handler be passed */
4017  SCIP_Bool* valid /**< pointer to store whether the copying was valid, or NULL */
4018  )
4019 {
4020  SCIP_Bool original = TRUE;
4021  SCIP_Bool global = TRUE;
4022  SCIP_Bool useconscompression = TRUE;
4023 
4024  assert(sourcescip != NULL);
4025  assert(targetscip != NULL);
4026  assert(suffix != NULL);
4027 
4028  /* check stages for both, the source and the target SCIP data structure */
4029  SCIP_CALL( checkStage(sourcescip, "SCIPcopyOrigConsCompression", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
4030  SCIP_CALL( checkStage(targetscip, "SCIPcopyOrigConsCompression", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
4031 
4032  /* copy the source problem data */
4033  SCIP_CALL( doCopy(sourcescip, targetscip, varmap, consmap, suffix, fixedvars, fixedvals, nfixedvars,
4034  useconscompression, global, original, enablepricing, passmessagehdlr, valid) );
4035 
4036  SCIP_CALL( SCIPsyncstoreRelease(&targetscip->syncstore) );
4037  targetscip->syncstore = sourcescip->syncstore;
4038  SCIP_CALL( SCIPsyncstoreCapture(targetscip->syncstore) );
4039 
4040  return SCIP_OKAY;
4041 }
4042 
4043 /** return updated time limit for a sub-SCIP */
4044 static
4046  SCIP* sourcescip, /**< source SCIP data structure */
4047  SCIP_Real* timelimit /**< pointer to store sub-SCIP time limit */
4048  )
4049 {
4050  SCIP_CALL( SCIPgetRealParam(sourcescip, "limits/time", timelimit) );
4051  if( !SCIPisInfinity(sourcescip, *timelimit) )
4052  (*timelimit) -= SCIPgetSolvingTime(sourcescip);
4053 
4054  return SCIP_OKAY;
4055 }
4056 
4057 /** return updated memory limit for a sub-SCIP */
4058 static
4060  SCIP* sourcescip, /**< source SCIP data structure */
4061  SCIP_Real* memorylimit /**< pointer to store sub-SCIP memory limit */
4062  )
4063 {
4064  SCIP_CALL( SCIPgetRealParam(sourcescip, "limits/memory", memorylimit) );
4065 
4066  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
4067  if( !SCIPisInfinity(sourcescip, *memorylimit) )
4068  (*memorylimit) -= (SCIPgetMemUsed(sourcescip) + SCIPgetMemExternEstim(sourcescip))/1048576.0;
4069 
4070  return SCIP_OKAY;
4071 }
4072 
4073 /** checks if there is enough time and memory left for copying the sourcescip into a sub-SCIP and solve the sub-SCIP
4074  *
4075  * This is the case if the time and memory limit that would be passed to the sub-SCIP are larger than 0.0
4076  *
4077  * @pre This method can be called if sourcescip is in one of the following stages:
4078  * - \ref SCIP_STAGE_PROBLEM
4079  * - \ref SCIP_STAGE_TRANSFORMED
4080  * - \ref SCIP_STAGE_INITPRESOLVE
4081  * - \ref SCIP_STAGE_PRESOLVING
4082  * - \ref SCIP_STAGE_EXITPRESOLVE
4083  * - \ref SCIP_STAGE_PRESOLVED
4084  * - \ref SCIP_STAGE_INITSOLVE
4085  * - \ref SCIP_STAGE_SOLVING
4086  * - \ref SCIP_STAGE_SOLVED
4087  *
4088  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
4089  */
4091  SCIP* sourcescip, /**< source SCIP data structure */
4092  SCIP_Bool* success /**< pointer to store whether there is time and memory left to copy the
4093  * problem and run the sub-SCIP */
4094  )
4095 {
4096  SCIP_Real timelimit;
4097  SCIP_Real memorylimit;
4098 
4099  SCIP_CALL( getCopyTimelimit(sourcescip, &timelimit) );
4100  SCIP_CALL( getCopyMemlimit(sourcescip, &memorylimit) );
4101 
4102  *success = timelimit > 0.0 && memorylimit > 2.0 * SCIPgetMemExternEstim(sourcescip) / 1048576.0;
4103 
4104  return SCIP_OKAY;
4105 }
4106 
4107 /** copies limits from source SCIP to target SCIP
4108  *
4109  * @note time and memory limit are reduced by the amount already spent in the source SCIP before installing the limit
4110  * in the target SCIP
4111  * @note all other limits are disabled and need to be enabled afterwards, if needed
4112  *
4113  * @pre This method can be called if sourcescip is in one of the following stages:
4114  * - \ref SCIP_STAGE_PROBLEM
4115  * - \ref SCIP_STAGE_TRANSFORMED
4116  * - \ref SCIP_STAGE_INITPRESOLVE
4117  * - \ref SCIP_STAGE_PRESOLVING
4118  * - \ref SCIP_STAGE_EXITPRESOLVE
4119  * - \ref SCIP_STAGE_PRESOLVED
4120  * - \ref SCIP_STAGE_INITSOLVE
4121  * - \ref SCIP_STAGE_SOLVING
4122  * - \ref SCIP_STAGE_SOLVED
4123  *
4124  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
4125  */
4127  SCIP* sourcescip, /**< source SCIP data structure */
4128  SCIP* targetscip /**< target SCIP data structure */
4129  )
4130 {
4131  SCIP_Real timelimit;
4132  SCIP_Real memorylimit;
4133 
4134  SCIP_CALL( getCopyTimelimit(sourcescip, &timelimit) );
4135  SCIP_CALL( getCopyMemlimit(sourcescip, &memorylimit) );
4136 
4137  /* avoid negative limits */
4138  if( timelimit < 0.0 )
4139  timelimit = 0.0;
4140  if( memorylimit < 0.0 )
4141  memorylimit = 0.0;
4142 
4143  /* set time and memory limit to the adjusted values */
4144  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/time", timelimit) );
4145  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/memory", memorylimit) );
4146 
4147  /* disable all other limits */
4148  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/absgap", 0.0) );
4149  SCIP_CALL( SCIPsetIntParam(targetscip, "limits/bestsol", -1) );
4150  SCIP_CALL( SCIPsetRealParam(targetscip, "limits/gap", 0.0) );
4151  SCIP_CALL( SCIPsetLongintParam(targetscip, "limits/nodes", -1LL) );
4152  SCIP_CALL( SCIPsetIntParam(targetscip, "limits/restarts", -1) );
4153  SCIP_CALL( SCIPsetIntParam(targetscip, "limits/solutions", -1) );
4154  SCIP_CALL( SCIPsetLongintParam(targetscip, "limits/stallnodes", -1LL) );
4155  SCIP_CALL( SCIPsetLongintParam(targetscip, "limits/totalnodes", -1LL) );
4156 
4157  /* the soft time limit event handler might not be included so we need to check if the parameter exists */
4158  if( SCIPgetParam(targetscip, "limits/softtime") != NULL )
4159  {
4160  SCIP_CALL( SCIPsetLongintParam(targetscip, "limits/totalnodes", -1LL) );
4161  }
4162 
4163  return SCIP_OKAY;
4164 }
4165 
4166 
4167 /*
4168  * parameter settings
4169  */
4170 
4171 /** creates a SCIP_Bool parameter, sets it to its default value, and adds it to the parameter set
4172  *
4173  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4174  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4175  */
4177  SCIP* scip, /**< SCIP data structure */
4178  const char* name, /**< name of the parameter */
4179  const char* desc, /**< description of the parameter */
4180  SCIP_Bool* valueptr, /**< pointer to store the current parameter value, or NULL */
4181  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4182  SCIP_Bool defaultvalue, /**< default value of the parameter */
4183  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4184  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4185  )
4186 {
4187  assert(scip != NULL);
4188  assert(scip->set != NULL);
4189  assert(scip->mem != NULL);
4190 
4191  SCIP_CALL( SCIPsetAddBoolParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4192  defaultvalue, paramchgd, paramdata) );
4193 
4194  return SCIP_OKAY;
4195 }
4196 
4197 /** creates a int parameter, sets it to its default value, and adds it to the parameter set
4198  *
4199  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4200  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4201  */
4203  SCIP* scip, /**< SCIP data structure */
4204  const char* name, /**< name of the parameter */
4205  const char* desc, /**< description of the parameter */
4206  int* valueptr, /**< pointer to store the current parameter value, or NULL */
4207  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4208  int defaultvalue, /**< default value of the parameter */
4209  int minvalue, /**< minimum value for parameter */
4210  int maxvalue, /**< maximum value for parameter */
4211  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4212  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4213  )
4214 {
4215  assert(scip != NULL);
4216  assert(scip->set != NULL);
4217  assert(scip->mem != NULL);
4218 
4219  SCIP_CALL( SCIPsetAddIntParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4220  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
4221 
4222  return SCIP_OKAY;
4223 }
4224 
4225 /** creates a SCIP_Longint parameter, sets it to its default value, and adds it to the parameter set
4226  *
4227  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4228  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4229  */
4231  SCIP* scip, /**< SCIP data structure */
4232  const char* name, /**< name of the parameter */
4233  const char* desc, /**< description of the parameter */
4234  SCIP_Longint* valueptr, /**< pointer to store the current parameter value, or NULL */
4235  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4236  SCIP_Longint defaultvalue, /**< default value of the parameter */
4237  SCIP_Longint minvalue, /**< minimum value for parameter */
4238  SCIP_Longint maxvalue, /**< maximum value for parameter */
4239  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4240  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4241  )
4242 {
4243  assert(scip != NULL);
4244  assert(scip->set != NULL);
4245  assert(scip->mem != NULL);
4246 
4247  SCIP_CALL( SCIPsetAddLongintParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4248  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
4249 
4250  return SCIP_OKAY;
4251 }
4252 
4253 /** creates a SCIP_Real parameter, sets it to its default value, and adds it to the parameter set
4254  *
4255  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4256  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4257  */
4259  SCIP* scip, /**< SCIP data structure */
4260  const char* name, /**< name of the parameter */
4261  const char* desc, /**< description of the parameter */
4262  SCIP_Real* valueptr, /**< pointer to store the current parameter value, or NULL */
4263  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4264  SCIP_Real defaultvalue, /**< default value of the parameter */
4265  SCIP_Real minvalue, /**< minimum value for parameter */
4266  SCIP_Real maxvalue, /**< maximum value for parameter */
4267  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4268  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4269  )
4270 {
4271  assert(scip != NULL);
4272  assert(scip->set != NULL);
4273  assert(scip->mem != NULL);
4274 
4275  SCIP_CALL( SCIPsetAddRealParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4276  defaultvalue, minvalue, maxvalue, paramchgd, paramdata) );
4277 
4278  return SCIP_OKAY;
4279 }
4280 
4281 /** creates a char parameter, sets it to its default value, and adds it to the parameter set
4282  *
4283  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4284  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4285  */
4287  SCIP* scip, /**< SCIP data structure */
4288  const char* name, /**< name of the parameter */
4289  const char* desc, /**< description of the parameter */
4290  char* valueptr, /**< pointer to store the current parameter value, or NULL */
4291  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4292  char defaultvalue, /**< default value of the parameter */
4293  const char* allowedvalues, /**< array with possible parameter values, or NULL if not restricted */
4294  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4295  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4296  )
4297 {
4298  assert(scip != NULL);
4299  assert(scip->set != NULL);
4300  assert(scip->mem != NULL);
4301 
4302  SCIP_CALL( SCIPsetAddCharParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4303  defaultvalue, allowedvalues, paramchgd, paramdata) );
4304 
4305  return SCIP_OKAY;
4306 }
4307 
4308 /** creates a string(char*) parameter, sets it to its default value, and adds it to the parameter set
4309  *
4310  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4311  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4312  */
4314  SCIP* scip, /**< SCIP data structure */
4315  const char* name, /**< name of the parameter */
4316  const char* desc, /**< description of the parameter */
4317  char** valueptr, /**< pointer to store the current parameter value, or NULL; if not NULL then *valueptr should be NULL */
4318  SCIP_Bool isadvanced, /**< is this parameter an advanced parameter? */
4319  const char* defaultvalue, /**< default value of the parameter */
4320  SCIP_DECL_PARAMCHGD ((*paramchgd)), /**< change information method of parameter */
4321  SCIP_PARAMDATA* paramdata /**< locally defined parameter specific data */
4322  )
4323 {
4324  assert(scip != NULL);
4325  assert(scip->set != NULL);
4326  assert(scip->mem != NULL);
4327 
4328  SCIP_CALL( SCIPsetAddStringParam(scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, valueptr, isadvanced,
4329  defaultvalue, paramchgd, paramdata) );
4330 
4331  return SCIP_OKAY;
4332 }
4333 
4334 /** gets the fixing status of an existing parameter
4335  *
4336  * @return TRUE if the parameter is fixed to a value, otherwise FALSE.
4337  */
4339  SCIP* scip, /**< SCIP data structure */
4340  const char* name /**< name of the parameter */
4341  )
4342 {
4343  assert(scip != NULL);
4344  assert(scip->set != NULL);
4345 
4346  return SCIPsetIsParamFixed(scip->set, name);
4347 }
4348 
4349 /** returns the pointer to the SCIP parameter with the given name
4350  *
4351  * @return pointer to the parameter with the given name
4352  */
4354  SCIP* scip, /**< SCIP data structure */
4355  const char* name /**< name of the parameter */
4356  )
4357 {
4358  assert(scip != NULL);
4359  assert(scip->set != NULL);
4360 
4361  return SCIPsetGetParam(scip->set, name);
4362 }
4363 
4364 /** gets the value of an existing SCIP_Bool parameter
4365  *
4366  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4367  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4368  */
4370  SCIP* scip, /**< SCIP data structure */
4371  const char* name, /**< name of the parameter */
4372  SCIP_Bool* value /**< pointer to store the parameter */
4373  )
4374 {
4375  assert(scip != NULL);
4376  assert(scip->set != NULL);
4377 
4378  SCIP_CALL( SCIPsetGetBoolParam(scip->set, name, value) );
4379 
4380  return SCIP_OKAY;
4381 }
4382 
4383 /** gets the value of an existing int parameter
4384  *
4385  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4386  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4387  */
4389  SCIP* scip, /**< SCIP data structure */
4390  const char* name, /**< name of the parameter */
4391  int* value /**< pointer to store the parameter */
4392  )
4393 {
4394  assert(scip != NULL);
4395  assert(scip->set != NULL);
4396 
4397  SCIP_CALL( SCIPsetGetIntParam(scip->set, name, value) );
4398 
4399  return SCIP_OKAY;
4400 }
4401 
4402 /** gets the value of an existing SCIP_Longint parameter
4403  *
4404  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4405  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4406  */
4408  SCIP* scip, /**< SCIP data structure */
4409  const char* name, /**< name of the parameter */
4410  SCIP_Longint* value /**< pointer to store the parameter */
4411  )
4412 {
4413  assert(scip != NULL);
4414  assert(scip->set != NULL);
4415 
4416  SCIP_CALL( SCIPsetGetLongintParam(scip->set, name, value) );
4417 
4418  return SCIP_OKAY;
4419 }
4420 
4421 /** gets the value of an existing SCIP_Real parameter
4422  *
4423  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4424  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4425  */
4427  SCIP* scip, /**< SCIP data structure */
4428  const char* name, /**< name of the parameter */
4429  SCIP_Real* value /**< pointer to store the parameter */
4430  )
4431 {
4432  assert(scip != NULL);
4433  assert(scip->set != NULL);
4434 
4435  SCIP_CALL( SCIPsetGetRealParam(scip->set, name, value) );
4436 
4437  return SCIP_OKAY;
4438 }
4439 
4440 /** gets the value of an existing char parameter
4441  *
4442  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4443  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4444  */
4446  SCIP* scip, /**< SCIP data structure */
4447  const char* name, /**< name of the parameter */
4448  char* value /**< pointer to store the parameter */
4449  )
4450 {
4451  assert(scip != NULL);
4452  assert(scip->set != NULL);
4453 
4454  SCIP_CALL( SCIPsetGetCharParam(scip->set, name, value) );
4455 
4456  return SCIP_OKAY;
4457 }
4458 
4459 /** gets the value of an existing string(char*) parameter
4460  *
4461  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4462  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4463  */
4465  SCIP* scip, /**< SCIP data structure */
4466  const char* name, /**< name of the parameter */
4467  char** value /**< pointer to store the parameter */
4468  )
4469 {
4470  assert(scip != NULL);
4471  assert(scip->set != NULL);
4472 
4473  SCIP_CALL( SCIPsetGetStringParam(scip->set, name, value) );
4474 
4475  return SCIP_OKAY;
4476 }
4477 
4478 /** fixes the value of an existing parameter
4479  *
4480  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4481  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4482  *
4483  * @note: Be careful with this method! Some general settings, e.g., the time or node limit, should not be fixed because
4484  * they have to be changed for sub-SCIPs.
4485  */
4487  SCIP* scip, /**< SCIP data structure */
4488  const char* name /**< name of the parameter */
4489  )
4490 {
4491  assert(scip != NULL);
4492  assert(scip->set != NULL);
4493 
4494  SCIP_CALL( SCIPsetChgParamFixed(scip->set, name, TRUE) );
4495 
4496  return SCIP_OKAY;
4497 }
4498 
4499 /** unfixes the value of an existing parameter
4500  *
4501  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4502  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4503  */
4505  SCIP* scip, /**< SCIP data structure */
4506  const char* name /**< name of the parameter */
4507  )
4508 {
4509  assert(scip != NULL);
4510  assert(scip->set != NULL);
4511 
4512  SCIP_CALL( SCIPsetChgParamFixed(scip->set, name, FALSE) );
4513 
4514  return SCIP_OKAY;
4515 }
4516 
4517 /** changes the value of an existing parameter
4518  *
4519  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4520  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4521  */
4523  SCIP* scip, /**< SCIP data structure */
4524  const char* name, /**< name of the parameter */
4525  void* value /**< new value of the parameter */
4526  )
4527 {
4528  assert(scip != NULL);
4529  assert(scip->set != NULL);
4530 
4531  SCIP_CALL( SCIPsetSetParam(scip->set, scip->messagehdlr, name, value) );
4532 
4533  return SCIP_OKAY;
4534 }
4535 
4536 /** changes the value of an existing SCIP_Bool parameter
4537  *
4538  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4539  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4540  */
4542  SCIP* scip, /**< SCIP data structure */
4543  SCIP_PARAM* param, /**< parameter */
4544  SCIP_Bool value /**< new value of the parameter */
4545  )
4546 {
4547  SCIP_RETCODE retcode;
4548 
4549  assert(scip != NULL);
4550  assert(scip->set != NULL);
4551 
4552  retcode = SCIPsetChgBoolParam(scip->set, scip->messagehdlr, param, value);
4553 
4554  if( retcode != SCIP_PARAMETERWRONGVAL )
4555  {
4556  SCIP_CALL( retcode );
4557  }
4558 
4559  return retcode;
4560 }
4561 
4562 /** changes the value of an existing SCIP_Bool 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  SCIP_Bool value /**< new value of the parameter */
4571  )
4572 {
4573  assert(scip != NULL);
4574  assert(scip->set != NULL);
4575 
4576  SCIP_CALL( SCIPsetSetBoolParam(scip->set, scip->messagehdlr, name, value) );
4577 
4578  return SCIP_OKAY;
4579 }
4580 
4581 /** checks whether the value of an existing SCIP_Bool parameter is valid */
4583  SCIP* scip, /**< SCIP data structure */
4584  SCIP_PARAM* param, /**< parameter */
4585  SCIP_Bool value /**< value to check */
4586  )
4587 {
4588  assert(scip != NULL);
4589  assert(param != NULL);
4590 
4591  return SCIPparamIsValidBool(param, value);
4592 }
4593 
4594 /** changes the value of an existing int parameter
4595  *
4596  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4597  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4598  */
4600  SCIP* scip, /**< SCIP data structure */
4601  SCIP_PARAM* param, /**< parameter */
4602  int value /**< new value of the parameter */
4603  )
4604 {
4605  SCIP_RETCODE retcode;
4606 
4607  assert(scip != NULL);
4608  assert(scip->set != NULL);
4609 
4610  retcode = SCIPsetChgIntParam(scip->set, scip->messagehdlr, param, value);
4611 
4612  if( retcode != SCIP_PARAMETERWRONGVAL )
4613  {
4614  SCIP_CALL( retcode );
4615  }
4616 
4617  return retcode;
4618 }
4619 
4620 /** changes the value of an existing int parameter
4621  *
4622  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4623  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4624  */
4626  SCIP* scip, /**< SCIP data structure */
4627  const char* name, /**< name of the parameter */
4628  int value /**< new value of the parameter */
4629  )
4630 {
4631  assert(scip != NULL);
4632  assert(scip->set != NULL);
4633 
4634  SCIP_CALL( SCIPsetSetIntParam(scip->set, scip->messagehdlr, name, value) );
4635 
4636  return SCIP_OKAY;
4637 }
4638 
4639 /** checks whether parameter value of an existing int paramter is valid */
4641  SCIP* scip, /**< SCIP data structure */
4642  SCIP_PARAM* param, /**< parameter */
4643  int value /**< value to check */
4644  )
4645 {
4646  assert(scip != NULL);
4647  assert(param != NULL);
4648 
4649  return SCIPparamIsValidInt(param, value);
4650 }
4651 
4652 /** changes the value of an existing SCIP_Longint parameter
4653  *
4654  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4655  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4656  */
4658  SCIP* scip, /**< SCIP data structure */
4659  SCIP_PARAM* param, /**< parameter */
4660  SCIP_Longint value /**< new value of the parameter */
4661  )
4662 {
4663  SCIP_RETCODE retcode;
4664 
4665  assert(scip != NULL);
4666  assert(scip->set != NULL);
4667 
4668  retcode = SCIPsetChgLongintParam(scip->set, scip->messagehdlr, param, value);
4669 
4670  if( retcode != SCIP_PARAMETERWRONGVAL )
4671  {
4672  SCIP_CALL( retcode );
4673  }
4674 
4675  return retcode;
4676 }
4677 
4678 /** changes the value of an existing SCIP_Longint parameter
4679  *
4680  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4681  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4682  */
4684  SCIP* scip, /**< SCIP data structure */
4685  const char* name, /**< name of the parameter */
4686  SCIP_Longint value /**< new value of the parameter */
4687  )
4688 {
4689  assert(scip != NULL);
4690  assert(scip->set != NULL);
4691 
4692  SCIP_CALL( SCIPsetSetLongintParam(scip->set, scip->messagehdlr, name, value) );
4693 
4694  return SCIP_OKAY;
4695 }
4696 
4697 /** checks whether parameter value of an existing SCIP_Longint paramter is valid */
4699  SCIP* scip, /**< SCIP data structure */
4700  SCIP_PARAM* param, /**< parameter */
4701  SCIP_Longint value /**< value to check */
4702  )
4703 {
4704  assert(scip != NULL);
4705  assert(param != NULL);
4706 
4707  return SCIPparamIsValidLongint(param, value);
4708 }
4709 
4710 /** changes the value of an existing SCIP_Real parameter
4711  *
4712  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4713  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4714  */
4716  SCIP* scip, /**< SCIP data structure */
4717  SCIP_PARAM* param, /**< parameter */
4718  SCIP_Real value /**< new value of the parameter */
4719  )
4720 {
4721  SCIP_RETCODE retcode;
4722 
4723  assert(scip != NULL);
4724  assert(scip->set != NULL);
4725 
4726  retcode = SCIPsetChgRealParam(scip->set, scip->messagehdlr, param, value);
4727 
4728  if( retcode != SCIP_PARAMETERWRONGVAL )
4729  {
4730  SCIP_CALL( retcode );
4731  }
4732 
4733  return retcode;
4734 }
4735 
4736 /** changes the value of an existing SCIP_Real parameter
4737  *
4738  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4739  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4740  */
4742  SCIP* scip, /**< SCIP data structure */
4743  const char* name, /**< name of the parameter */
4744  SCIP_Real value /**< new value of the parameter */
4745  )
4746 {
4747  assert(scip != NULL);
4748  assert(scip->set != NULL);
4749 
4750  SCIP_CALL( SCIPsetSetRealParam(scip->set, scip->messagehdlr, name, value) );
4751 
4752  return SCIP_OKAY;
4753 }
4754 
4755 /** checks whether parameter value of an existing SCIP_Real paramter is valid */
4757  SCIP* scip, /**< SCIP data structure */
4758  SCIP_PARAM* param, /**< parameter */
4759  SCIP_Real value /**< value to check */
4760  )
4761 {
4762  assert(scip != NULL);
4763  assert(param != NULL);
4764 
4765  return SCIPparamIsValidReal(param, value);
4766 }
4767 
4768 /** changes the value of an existing char parameter
4769  *
4770  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4771  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4772  */
4774  SCIP* scip, /**< SCIP data structure */
4775  SCIP_PARAM* param, /**< parameter */
4776  char value /**< new value of the parameter */
4777  )
4778 {
4779  SCIP_RETCODE retcode;
4780 
4781  assert(scip != NULL);
4782  assert(scip->set != NULL);
4783 
4784  retcode = SCIPsetChgCharParam(scip->set, scip->messagehdlr, param, value);
4785 
4786  if( retcode != SCIP_PARAMETERWRONGVAL )
4787  {
4788  SCIP_CALL( retcode );
4789  }
4790 
4791  return retcode;
4792 }
4793 
4794 /** changes the value of an existing char parameter
4795  *
4796  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4797  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4798  */
4800  SCIP* scip, /**< SCIP data structure */
4801  const char* name, /**< name of the parameter */
4802  char value /**< new value of the parameter */
4803  )
4804 {
4805  assert(scip != NULL);
4806  assert(scip->set != NULL);
4807 
4808  SCIP_CALL( SCIPsetSetCharParam(scip->set, scip->messagehdlr, name, value) );
4809 
4810  return SCIP_OKAY;
4811 }
4812 
4813 /** checks whether parameter value for a given SCIP_Real parameter is valid */
4815  SCIP* scip, /**< SCIP data structure */
4816  SCIP_PARAM* param, /**< parameter */
4817  const char value /**< value to check */
4818  )
4819 {
4820  assert(scip != NULL);
4821  assert(param != NULL);
4822 
4823  return SCIPparamIsValidChar(param, value);
4824 }
4825 
4826 /** changes the value of an existing string(char*) parameter
4827  *
4828  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4829  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4830  */
4832  SCIP* scip, /**< SCIP data structure */
4833  SCIP_PARAM* param, /**< parameter */
4834  const char* value /**< new value of the parameter */
4835  )
4836 {
4837  SCIP_RETCODE retcode;
4838 
4839  assert(scip != NULL);
4840  assert(scip->set != NULL);
4841 
4842  retcode = SCIPsetChgStringParam(scip->set, scip->messagehdlr, param, value);
4843 
4844  if( retcode != SCIP_PARAMETERWRONGVAL )
4845  {
4846  SCIP_CALL( retcode );
4847  }
4848 
4849  return retcode;
4850 }
4851 
4852 /** changes the value of an existing string(char*) parameter
4853  *
4854  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4855  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4856  */
4858  SCIP* scip, /**< SCIP data structure */
4859  const char* name, /**< name of the parameter */
4860  const char* value /**< new value of the parameter */
4861  )
4862 {
4863  assert(scip != NULL);
4864  assert(scip->set != NULL);
4865 
4866  SCIP_CALL( SCIPsetSetStringParam(scip->set, scip->messagehdlr, name, value) );
4867 
4868  return SCIP_OKAY;
4869 }
4870 
4871 /** checks whether parameter value for a given string parameter is valid */
4873  SCIP* scip, /**< SCIP data structure */
4874  SCIP_PARAM* param, /**< parameter */
4875  const char* value /**< value to check */
4876  )
4877 {
4878  assert(scip != NULL);
4879  assert(param != NULL);
4880 
4881  return SCIPparamIsValidString(param, value);
4882 }
4883 
4884 /** reads parameters from a file
4885  *
4886  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4887  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4888  */
4890  SCIP* scip, /**< SCIP data structure */
4891  const char* filename /**< file name */
4892  )
4893 {
4894  assert(scip != NULL);
4895  assert(scip->set != NULL);
4896 
4897  SCIP_CALL( SCIPsetReadParams(scip->set, scip->messagehdlr, filename) );
4898 
4899  return SCIP_OKAY;
4900 }
4901 
4902 /** writes a single parameter to a file
4903  *
4904  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4905  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4906  */
4908  SCIP* scip, /**< SCIP data structure */
4909  SCIP_PARAM* param, /**< parameter */
4910  const char* filename, /**< file name, or NULL for stdout */
4911  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4912  SCIP_Bool onlychanged /**< should only those parameters be written that are changed from their
4913  * default value?
4914  */
4915  )
4916 {
4917  assert(scip != NULL);
4918  assert(param != NULL);
4919 
4920  SCIP_CALL( SCIPparamWrite(param, scip->messagehdlr, filename, comments, onlychanged) );
4921 
4922  return SCIP_OKAY;
4923 }
4924 
4925 /** writes all parameters in the parameter set to a file
4926  *
4927  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4928  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4929  */
4931  SCIP* scip, /**< SCIP data structure */
4932  const char* filename, /**< file name, or NULL for stdout */
4933  SCIP_Bool comments, /**< should parameter descriptions be written as comments? */
4934  SCIP_Bool onlychanged /**< should only those parameters be written that are changed from their
4935  * default value?
4936  */
4937  )
4938 {
4939  assert(scip != NULL);
4940  assert(scip->set != NULL);
4941 
4942  SCIP_CALL( SCIPsetWriteParams(scip->set, scip->messagehdlr, filename, comments, onlychanged) );
4943 
4944  return SCIP_OKAY;
4945 }
4946 
4947 /** resets a single parameter to its default value
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* name /**< name of the parameter */
4955  )
4956 {
4957  assert(scip != NULL);
4958  assert(scip->set != NULL);
4959 
4960  SCIP_CALL( SCIPsetResetParam(scip->set, scip->messagehdlr, name) );
4961 
4962  return SCIP_OKAY;
4963 }
4964 
4965 /** resets all parameters to their default values
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  )
4973 {
4974  assert(scip != NULL);
4975  assert(scip->set != NULL);
4976 
4977  SCIP_CALL( SCIPsetResetParams(scip->set, scip->messagehdlr) );
4978 
4979  return SCIP_OKAY;
4980 }
4981 
4982 /** sets parameters to
4983  *
4984  * - \ref SCIP_PARAMEMPHASIS_DEFAULT to use default values (see also SCIPresetParams())
4985  * - \ref SCIP_PARAMEMPHASIS_COUNTER to get feasible and "fast" counting process
4986  * - \ref SCIP_PARAMEMPHASIS_CPSOLVER to get CP like search (e.g. no LP relaxation)
4987  * - \ref SCIP_PARAMEMPHASIS_EASYCIP to solve easy problems fast
4988  * - \ref SCIP_PARAMEMPHASIS_FEASIBILITY to detect feasibility fast
4989  * - \ref SCIP_PARAMEMPHASIS_HARDLP to be capable to handle hard LPs
4990  * - \ref SCIP_PARAMEMPHASIS_OPTIMALITY to prove optimality fast
4991  * - \ref SCIP_PARAMEMPHASIS_PHASEFEAS to find feasible solutions during a 3 phase solution process
4992  * - \ref SCIP_PARAMEMPHASIS_PHASEIMPROVE to find improved solutions during a 3 phase solution process
4993  * - \ref SCIP_PARAMEMPHASIS_PHASEPROOF to proof optimality during a 3 phase solution process
4994  *
4995  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
4996  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
4997  */
4999  SCIP* scip, /**< SCIP data structure */
5000  SCIP_PARAMEMPHASIS paramemphasis, /**< parameter settings */
5001  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5002  )
5003 {
5004  assert(scip != NULL);
5005  assert(scip->set != NULL);
5006 
5007  SCIP_CALL( SCIPsetSetEmphasis(scip->set, scip->messagehdlr, paramemphasis, quiet) );
5008 
5009  return SCIP_OKAY;
5010 }
5011 
5012 /** sets parameters to deactivate separators and heuristics that use auxiliary SCIP instances; should be called for
5013  * auxiliary SCIP instances to avoid recursion
5014  *
5015  * @note only deactivates plugins which could cause recursion, some plugins which use sub-SCIPs stay activated
5016  *
5017  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5018  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5019  */
5021  SCIP* scip, /**< (auxiliary) SCIP data structure */
5022  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5023  )
5024 {
5025  assert(scip != NULL);
5026  assert(scip->set != NULL);
5027 
5028  SCIP_CALL( SCIPsetSetSubscipsOff(scip->set, scip->messagehdlr, quiet) );
5029 
5030  return SCIP_OKAY;
5031 }
5032 
5033 /** sets heuristic parameters values to
5034  *
5035  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all heuristic parameters
5036  * - SCIP_PARAMSETTING_FAST such that the time spend for heuristic is decreased
5037  * - SCIP_PARAMSETTING_AGGRESSIVE such that the heuristic are called more aggregative
5038  * - SCIP_PARAMSETTING_OFF which turn off all heuristics
5039  *
5040  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5041  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5042  */
5044  SCIP* scip, /**< SCIP data structure */
5045  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
5046  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5047  )
5048 {
5049  assert(scip != NULL);
5050  assert(scip->set != NULL);
5051  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
5052  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
5053 
5054  SCIP_CALL( SCIPsetSetHeuristics(scip->set, scip->messagehdlr, paramsetting, quiet) );
5055 
5056  return SCIP_OKAY;
5057 }
5058 
5059 /** sets presolving parameters to
5060  *
5061  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all presolving parameters
5062  * - SCIP_PARAMSETTING_FAST such that the time spend for presolving is decreased
5063  * - SCIP_PARAMSETTING_AGGRESSIVE such that the presolving is more aggregative
5064  * - SCIP_PARAMSETTING_OFF which turn off all presolving
5065  *
5066  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5067  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5068  */
5070  SCIP* scip, /**< SCIP data structure */
5071  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
5072  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5073  )
5074 {
5075  assert(scip != NULL);
5076  assert(scip->set != NULL);
5077  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
5078  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
5079 
5080  SCIP_CALL( SCIPsetSetPresolving(scip->set, scip->messagehdlr, paramsetting, quiet) );
5081 
5082  return SCIP_OKAY;
5083 }
5084 
5085 /** sets separating parameters to
5086  *
5087  * - SCIP_PARAMSETTING_DEFAULT which are the default values of all separating parameters
5088  * - SCIP_PARAMSETTING_FAST such that the time spend for separating is decreased
5089  * - SCIP_PARAMSETTING_AGGRESSIVE such that the separating is done more aggregative
5090  * - SCIP_PARAMSETTING_OFF which turn off all separating
5091  *
5092  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5093  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5094  */
5096  SCIP* scip, /**< SCIP data structure */
5097  SCIP_PARAMSETTING paramsetting, /**< parameter settings */
5098  SCIP_Bool quiet /**< should the parameter be set quiet (no output) */
5099  )
5100 {
5101  assert(scip != NULL);
5102  assert(scip->set != NULL);
5103  assert(paramsetting == SCIP_PARAMSETTING_DEFAULT || paramsetting == SCIP_PARAMSETTING_FAST
5104  || paramsetting == SCIP_PARAMSETTING_AGGRESSIVE || paramsetting == SCIP_PARAMSETTING_OFF);
5105 
5106  SCIP_CALL( SCIPsetSetSeparating(scip->set, scip->messagehdlr, paramsetting, quiet) );
5107 
5108  return SCIP_OKAY;
5109 }
5110 
5111 /** returns the array of all available SCIP parameters
5112  *
5113  * @return SCIP_PARAM* array, containing all SCIP parameters.
5114  */
5116  SCIP* scip /**< SCIP data structure */
5117  )
5118 {
5119  assert(scip != NULL);
5120  assert(scip->set != NULL);
5121 
5122  return SCIPsetGetParams(scip->set);
5123 }
5124 
5125 /** returns the total number of all available SCIP parameters
5126  *
5127  * @return number of all SCIP parameters.
5128  */
5130  SCIP* scip /**< SCIP data structure */
5131  )
5132 {
5133  assert(scip != NULL);
5134  assert(scip->set != NULL);
5135 
5136  return SCIPsetGetNParams(scip->set);
5137 }
5138 
5139 
5140 
5141 
5142 /*
5143  * SCIP user functionality methods: managing plugins
5144  */
5145 
5146 /** creates a reader and includes it in SCIP
5147  *
5148  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5149  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5150  *
5151  * @pre This method can be called if SCIP is in one of the following stages:
5152  * - \ref SCIP_STAGE_INIT
5153  * - \ref SCIP_STAGE_PROBLEM
5154  *
5155  * @note method has all reader callbacks as arguments and is thus changed every time a new callback is added
5156  * in future releases; consider using SCIPincludeReaderBasic() and setter functions
5157  * if you seek for a method which is less likely to change in future releases
5158  */
5160  SCIP* scip, /**< SCIP data structure */
5161  const char* name, /**< name of reader */
5162  const char* desc, /**< description of reader */
5163  const char* extension, /**< file extension that reader processes */
5164  SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
5165  SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
5166  SCIP_DECL_READERREAD ((*readerread)), /**< read method */
5167  SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
5168  SCIP_READERDATA* readerdata /**< reader data */
5169  )
5170 {
5171  SCIP_READER* reader;
5172 
5173  SCIP_CALL( checkStage(scip, "SCIPincludeReader", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5174 
5175  /* check whether reader is already present */
5176  if( SCIPfindReader(scip, name) != NULL )
5177  {
5178  SCIPerrorMessage("reader <%s> already included.\n", name);
5179  return SCIP_INVALIDDATA;
5180  }
5181 
5182  SCIP_CALL( SCIPreaderCreate(&reader, name, desc, extension, readercopy, readerfree, readerread, readerwrite, readerdata) );
5183  SCIP_CALL( SCIPsetIncludeReader(scip->set, reader) );
5184 
5185  return SCIP_OKAY;
5186 }
5187 
5188 /** creates a reader and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
5189  * Optional callbacks can be set via specific setter functions, see
5190  * SCIPsetReaderCopy(), SCIPsetReaderFree(), SCIPsetReaderRead(), SCIPsetReaderWrite().
5191  *
5192  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5193  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5194  *
5195  * @pre This method can be called if SCIP is in one of the following stages:
5196  * - \ref SCIP_STAGE_INIT
5197  * - \ref SCIP_STAGE_PROBLEM
5198  *
5199  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeReader() instead
5200  */
5202  SCIP* scip, /**< SCIP data structure */
5203  SCIP_READER** readerptr, /**< reference to reader pointer, or NULL */
5204  const char* name, /**< name of reader */
5205  const char* desc, /**< description of reader */
5206  const char* extension, /**< file extension that reader processes */
5207  SCIP_READERDATA* readerdata /**< reader data */
5208  )
5209 {
5210  SCIP_READER* reader;
5211 
5212  SCIP_CALL( checkStage(scip, "SCIPincludeReaderBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5213 
5214  /* check whether reader is already present */
5215  if( SCIPfindReader(scip, name) != NULL )
5216  {
5217  SCIPerrorMessage("reader <%s> already included.\n", name);
5218  return SCIP_INVALIDDATA;
5219  }
5220 
5221  SCIP_CALL( SCIPreaderCreate(&reader, name, desc, extension, NULL, NULL, NULL, NULL, readerdata) );
5222  SCIP_CALL( SCIPsetIncludeReader(scip->set, reader) );
5223 
5224  if( readerptr != NULL )
5225  *readerptr = reader;
5226 
5227  return SCIP_OKAY;
5228 }
5229 
5230 /** set copy method of reader
5231  *
5232  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5233  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5234  *
5235  * @pre This method can be called if SCIP is in one of the following stages:
5236  * - \ref SCIP_STAGE_INIT
5237  * - \ref SCIP_STAGE_PROBLEM
5238  */
5240  SCIP* scip, /**< SCIP data structure */
5241  SCIP_READER* reader, /**< reader */
5242  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
5243  )
5244 {
5245  assert(scip != NULL);
5246 
5247  SCIP_CALL( checkStage(scip, "SCIPsetReaderCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5248 
5249  SCIPreaderSetCopy(reader, readercopy);
5250 
5251  return SCIP_OKAY;
5252 }
5253 
5254 /** set deinitialization method of reader
5255  *
5256  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5257  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5258  *
5259  * @pre This method can be called if SCIP is in one of the following stages:
5260  * - \ref SCIP_STAGE_INIT
5261  * - \ref SCIP_STAGE_PROBLEM
5262  */
5264  SCIP* scip, /**< SCIP data structure */
5265  SCIP_READER* reader, /**< reader */
5266  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
5267  )
5268 {
5269  assert(scip != NULL);
5270 
5271  SCIP_CALL( checkStage(scip, "SCIPsetReaderFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5272 
5273  SCIPreaderSetFree(reader, readerfree);
5274 
5275  return SCIP_OKAY;
5276 }
5277 
5278 /** set read method of reader
5279  *
5280  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5281  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5282  *
5283  * @pre This method can be called if SCIP is in one of the following stages:
5284  * - \ref SCIP_STAGE_INIT
5285  * - \ref SCIP_STAGE_PROBLEM
5286  */
5288  SCIP* scip, /**< SCIP data structure */
5289  SCIP_READER* reader, /**< reader */
5290  SCIP_DECL_READERREAD ((*readerread)) /**< read method of reader */
5291  )
5292 {
5293  assert(scip != NULL);
5294 
5295  SCIP_CALL( checkStage(scip, "SCIPsetReaderRead", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5296 
5297  SCIPreaderSetRead(reader, readerread);
5298 
5299  return SCIP_OKAY;
5300 }
5301 
5302 /** set write method of reader
5303  *
5304  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5305  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5306  *
5307  * @pre This method can be called if SCIP is in one of the following stages:
5308  * - \ref SCIP_STAGE_INIT
5309  * - \ref SCIP_STAGE_PROBLEM
5310  */
5312  SCIP* scip, /**< SCIP data structure */
5313  SCIP_READER* reader, /**< reader */
5314  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method of reader */
5315  )
5316 {
5317  assert(scip != NULL);
5318 
5319  SCIP_CALL( checkStage(scip, "SCIPsetReaderWrite", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5320 
5321  SCIPreaderSetWrite(reader, readerwrite);
5322 
5323  return SCIP_OKAY;
5324 }
5325 
5326 /** returns the reader of the given name, or NULL if not existing */
5328  SCIP* scip, /**< SCIP data structure */
5329  const char* name /**< name of reader */
5330  )
5331 {
5332  assert(scip != NULL);
5333  assert(scip->set != NULL);
5334  assert(name != NULL);
5335 
5336  return SCIPsetFindReader(scip->set, name);
5337 }
5338 
5339 /** returns the array of currently available readers */
5341  SCIP* scip /**< SCIP data structure */
5342  )
5343 {
5344  assert(scip != NULL);
5345  assert(scip->set != NULL);
5346 
5347  return scip->set->readers;
5348 }
5349 
5350 /** returns the number of currently available readers */
5352  SCIP* scip /**< SCIP data structure */
5353  )
5354 {
5355  assert(scip != NULL);
5356  assert(scip->set != NULL);
5357 
5358  return scip->set->nreaders;
5359 }
5360 
5361 /** creates a variable pricer and includes it in SCIP
5362  * To use the variable pricer for solving a problem, it first has to be activated with a call to SCIPactivatePricer().
5363  * This should be done during the problem creation stage.
5364  *
5365  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5366  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5367  *
5368  * @pre This method can be called if SCIP is in one of the following stages:
5369  * - \ref SCIP_STAGE_INIT
5370  * - \ref SCIP_STAGE_PROBLEM
5371  *
5372  * @note method has all pricer callbacks as arguments and is thus changed every time a new callback is added
5373  * in future releases; consider using SCIPincludePricerBasic() and setter functions
5374  * if you seek for a method which is less likely to change in future releases
5375  */
5377  SCIP* scip, /**< SCIP data structure */
5378  const char* name, /**< name of variable pricer */
5379  const char* desc, /**< description of variable pricer */
5380  int priority, /**< priority of the variable pricer */
5381  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
5382  * problem variables with negative reduced costs are found?
5383  * if this is set to FALSE it may happen that the pricer produces columns
5384  * that already exist in the problem (which are also priced in by the
5385  * default problem variable pricing in the same round) */
5386  SCIP_DECL_PRICERCOPY ((*pricercopy)), /**< copy method of variable pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
5387  SCIP_DECL_PRICERFREE ((*pricerfree)), /**< destructor of variable pricer */
5388  SCIP_DECL_PRICERINIT ((*pricerinit)), /**< initialize variable pricer */
5389  SCIP_DECL_PRICEREXIT ((*pricerexit)), /**< deinitialize variable pricer */
5390  SCIP_DECL_PRICERINITSOL((*pricerinitsol)),/**< solving process initialization method of variable pricer */
5391  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)),/**< solving process deinitialization method of variable pricer */
5392  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
5393  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
5394  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
5395  )
5396 {
5397  SCIP_PRICER* pricer;
5398 
5399  SCIP_CALL( checkStage(scip, "SCIPincludePricer", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5400 
5401  /* check whether pricer is already present */
5402  if( SCIPfindPricer(scip, name) != NULL )
5403  {
5404  SCIPerrorMessage("pricer <%s> already included.\n", name);
5405  return SCIP_INVALIDDATA;
5406  }
5407 
5408  SCIP_CALL( SCIPpricerCreate(&pricer, scip->set, scip->messagehdlr, scip->mem->setmem,
5409  name, desc, priority, delay,
5410  pricercopy,
5411  pricerfree, pricerinit, pricerexit, pricerinitsol, pricerexitsol, pricerredcost, pricerfarkas, pricerdata) );
5412  SCIP_CALL( SCIPsetIncludePricer(scip->set, pricer) );
5413 
5414  return SCIP_OKAY;
5415 }
5416 
5417 /** creates a variable pricer and includes it in SCIP with all non-fundamental callbacks set to NULL;
5418  * if needed, these can be added afterwards via setter functions SCIPsetPricerCopy(), SCIPsetPricerFree(),
5419  * SCIPsetPricerInity(), SCIPsetPricerExit(), SCIPsetPricerInitsol(), SCIPsetPricerExitsol(),
5420  * SCIPsetPricerFarkas();
5421  *
5422  * To use the variable pricer for solving a problem, it first has to be activated with a call to SCIPactivatePricer().
5423  * This should be done during the problem creation stage.
5424  *
5425  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5426  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5427  *
5428  * @pre This method can be called if SCIP is in one of the following stages:
5429  * - \ref SCIP_STAGE_INIT
5430  * - \ref SCIP_STAGE_PROBLEM
5431  *
5432  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePricer() instead
5433  */
5435  SCIP* scip, /**< SCIP data structure */
5436  SCIP_PRICER** pricerptr, /**< reference to a pricer, or NULL */
5437  const char* name, /**< name of variable pricer */
5438  const char* desc, /**< description of variable pricer */
5439  int priority, /**< priority of the variable pricer */
5440  SCIP_Bool delay, /**< should the pricer be delayed until no other pricers or already existing
5441  * problem variables with negative reduced costs are found?
5442  * if this is set to FALSE it may happen that the pricer produces columns
5443  * that already exist in the problem (which are also priced in by the
5444  * default problem variable pricing in the same round) */
5445  SCIP_DECL_PRICERREDCOST((*pricerredcost)),/**< reduced cost pricing method of variable pricer for feasible LPs */
5446  SCIP_DECL_PRICERFARKAS((*pricerfarkas)), /**< Farkas pricing method of variable pricer for infeasible LPs */
5447  SCIP_PRICERDATA* pricerdata /**< variable pricer data */
5448  )
5449 {
5450  SCIP_PRICER* pricer;
5451 
5452  SCIP_CALL( checkStage(scip, "SCIPincludePricerBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5453 
5454  /* check whether pricer is already present */
5455  if( SCIPfindPricer(scip, name) != NULL )
5456  {
5457  SCIPerrorMessage("pricer <%s> already included.\n", name);
5458  return SCIP_INVALIDDATA;
5459  }
5460 
5461  SCIP_CALL( SCIPpricerCreate(&pricer, scip->set, scip->messagehdlr, scip->mem->setmem,
5462  name, desc, priority, delay,
5463  NULL,
5464  NULL, NULL, NULL, NULL, NULL, pricerredcost, pricerfarkas, pricerdata) );
5465  SCIP_CALL( SCIPsetIncludePricer(scip->set, pricer) );
5466 
5467  if( pricerptr != NULL )
5468  *pricerptr = pricer;
5469 
5470  return SCIP_OKAY;
5471 }
5472 
5473 /** sets copy method of pricer
5474  *
5475  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5476  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5477  *
5478  * @pre This method can be called if SCIP is in one of the following stages:
5479  * - \ref SCIP_STAGE_INIT
5480  * - \ref SCIP_STAGE_PROBLEM
5481  */
5483  SCIP* scip, /**< SCIP data structure */
5484  SCIP_PRICER* pricer, /**< pricer */
5485  SCIP_DECL_PRICERCOPY ((*pricercopy)) /**< copy method of pricer or NULL if you don't want to copy your plugin into sub-SCIPs */
5486  )
5487 {
5488  SCIP_CALL( checkStage(scip, "SCIPsetPricerCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5489 
5490  assert(pricer != NULL);
5491 
5492  SCIPpricerSetCopy(pricer, pricercopy);
5493 
5494  return SCIP_OKAY;
5495 }
5496 
5497 /** sets destructor method of pricer
5498  *
5499  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5500  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5501  *
5502  * @pre This method can be called if SCIP is in one of the following stages:
5503  * - \ref SCIP_STAGE_INIT
5504  * - \ref SCIP_STAGE_PROBLEM
5505  */
5507  SCIP* scip, /**< SCIP data structure */
5508  SCIP_PRICER* pricer, /**< pricer */
5509  SCIP_DECL_PRICERFREE ((*pricerfree)) /**< destructor of pricer */
5510  )
5511 {
5512  SCIP_CALL( checkStage(scip, "SCIPsetPricerFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5513 
5514  assert(pricer != NULL);
5515 
5516  SCIPpricerSetFree(pricer, pricerfree);
5517 
5518  return SCIP_OKAY;
5519 }
5520 
5521 /** sets initialization method of pricer
5522  *
5523  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5524  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5525  *
5526  * @pre This method can be called if SCIP is in one of the following stages:
5527  * - \ref SCIP_STAGE_INIT
5528  * - \ref SCIP_STAGE_PROBLEM
5529  */
5531  SCIP* scip, /**< SCIP data structure */
5532  SCIP_PRICER* pricer, /**< pricer */
5533  SCIP_DECL_PRICERINIT ((*pricerinit)) /**< initialize pricer */
5534  )
5535 {
5536  SCIP_CALL( checkStage(scip, "SCIPsetPricerInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5537 
5538  assert(pricer != NULL);
5539 
5540  SCIPpricerSetInit(pricer, pricerinit);
5541 
5542  return SCIP_OKAY;
5543 }
5544 
5545 /** sets deinitialization method of pricer
5546  *
5547  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5548  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5549  *
5550  * @pre This method can be called if SCIP is in one of the following stages:
5551  * - \ref SCIP_STAGE_INIT
5552  * - \ref SCIP_STAGE_PROBLEM
5553  */
5555  SCIP* scip, /**< SCIP data structure */
5556  SCIP_PRICER* pricer, /**< pricer */
5557  SCIP_DECL_PRICEREXIT ((*pricerexit)) /**< deinitialize pricer */
5558  )
5559 {
5560  SCIP_CALL( checkStage(scip, "SCIPsetPricerExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5561 
5562  assert(pricer != NULL);
5563 
5564  SCIPpricerSetExit(pricer, pricerexit);
5565 
5566  return SCIP_OKAY;
5567 }
5568 
5569 /** sets solving process initialization method of pricer
5570  *
5571  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5572  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5573  *
5574  * @pre This method can be called if SCIP is in one of the following stages:
5575  * - \ref SCIP_STAGE_INIT
5576  * - \ref SCIP_STAGE_PROBLEM
5577  */
5579  SCIP* scip, /**< SCIP data structure */
5580  SCIP_PRICER* pricer, /**< pricer */
5581  SCIP_DECL_PRICERINITSOL ((*pricerinitsol))/**< solving process initialization method of pricer */
5582  )
5583 {
5584  SCIP_CALL( checkStage(scip, "SCIPsetPricerInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5585 
5586  assert(pricer != NULL);
5587 
5588  SCIPpricerSetInitsol(pricer, pricerinitsol);
5589 
5590  return SCIP_OKAY;
5591 }
5592 
5593 /** sets solving process deinitialization method of pricer
5594  *
5595  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5596  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5597  *
5598  * @pre This method can be called if SCIP is in one of the following stages:
5599  * - \ref SCIP_STAGE_INIT
5600  * - \ref SCIP_STAGE_PROBLEM
5601  */
5603  SCIP* scip, /**< SCIP data structure */
5604  SCIP_PRICER* pricer, /**< pricer */
5605  SCIP_DECL_PRICEREXITSOL((*pricerexitsol)) /**< solving process deinitialization method of pricer */
5606  )
5607 {
5608  SCIP_CALL( checkStage(scip, "SCIPsetPricerExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5609 
5610  assert(pricer != NULL);
5611 
5612  SCIPpricerSetExitsol(pricer, pricerexitsol);
5613 
5614  return SCIP_OKAY;
5615 }
5616 
5617 /** returns the variable pricer of the given name, or NULL if not existing */
5619  SCIP* scip, /**< SCIP data structure */
5620  const char* name /**< name of variable pricer */
5621  )
5622 {
5623  assert(scip != NULL);
5624  assert(scip->set != NULL);
5625  assert(name != NULL);
5626 
5627  return SCIPsetFindPricer(scip->set, name);
5628 }
5629 
5630 /** returns the array of currently available variable pricers; active pricers are in the first slots of the array */
5632  SCIP* scip /**< SCIP data structure */
5633  )
5634 {
5635  assert(scip != NULL);
5636  assert(scip->set != NULL);
5637 
5638  SCIPsetSortPricers(scip->set);
5639 
5640  return scip->set->pricers;
5641 }
5642 
5643 /** returns the number of currently available variable pricers */
5645  SCIP* scip /**< SCIP data structure */
5646  )
5647 {
5648  assert(scip != NULL);
5649  assert(scip->set != NULL);
5650 
5651  return scip->set->npricers;
5652 }
5653 
5654 /** returns the number of currently active variable pricers, that are used in the LP solving loop */
5656  SCIP* scip /**< SCIP data structure */
5657  )
5658 {
5659  assert(scip != NULL);
5660  assert(scip->set != NULL);
5661 
5662  return scip->set->nactivepricers;
5663 }
5664 
5665 /** sets the priority priority of a variable pricer */
5667  SCIP* scip, /**< SCIP data structure */
5668  SCIP_PRICER* pricer, /**< variable pricer */
5669  int priority /**< new priority of the variable pricer */
5670  )
5671 {
5672  assert(scip != NULL);
5673  assert(scip->set != NULL);
5674 
5675  SCIPpricerSetPriority(pricer, scip->set, priority);
5676 
5677  return SCIP_OKAY;
5678 }
5679 
5680 /** activates pricer to be used for the current problem
5681  * This method should be called during the problem creation stage for all pricers that are necessary to solve
5682  * the problem model.
5683  * The pricers are automatically deactivated when the problem is freed.
5684  *
5685  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5686  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5687  *
5688  * @pre This method can be called if SCIP is in one of the following stages:
5689  * - \ref SCIP_STAGE_PROBLEM
5690  */
5692  SCIP* scip, /**< SCIP data structure */
5693  SCIP_PRICER* pricer /**< variable pricer */
5694  )
5695 {
5696  SCIP_CALL( checkStage(scip, "SCIPactivatePricer", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5697 
5698  SCIP_CALL( SCIPpricerActivate(pricer, scip->set) );
5699 
5700  return SCIP_OKAY;
5701 }
5702 
5703 /** deactivates pricer
5704  *
5705  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5706  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5707  *
5708  * @pre This method can be called if SCIP is in one of the following stages:
5709  * - \ref SCIP_STAGE_PROBLEM
5710  * - \ref SCIP_STAGE_EXITSOLVE
5711  */
5713  SCIP* scip, /**< SCIP data structure */
5714  SCIP_PRICER* pricer /**< variable pricer */
5715  )
5716 {
5717  SCIP_CALL( checkStage(scip, "SCIPdeactivatePricer", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE) );
5718 
5719  SCIP_CALL( SCIPpricerDeactivate(pricer, scip->set) );
5720 
5721  return SCIP_OKAY;
5722 }
5723 
5724 /** creates a constraint handler and includes it in SCIP.
5725  *
5726  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5727  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5728  *
5729  * @pre This method can be called if SCIP is in one of the following stages:
5730  * - \ref SCIP_STAGE_INIT
5731  * - \ref SCIP_STAGE_PROBLEM
5732  *
5733  * @note method has all constraint handler callbacks as arguments and is thus changed every time a new
5734  * callback is added
5735  * in future releases; consider using SCIPincludeConshdlrBasic() and setter functions
5736  * if you seek for a method which is less likely to change in future releases
5737  */
5739  SCIP* scip, /**< SCIP data structure */
5740  const char* name, /**< name of constraint handler */
5741  const char* desc, /**< description of constraint handler */
5742  int sepapriority, /**< priority of the constraint handler for separation */
5743  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
5744  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
5745  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
5746  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
5747  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
5748  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
5749  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
5750  SCIP_Bool delaysepa, /**< should separation method be delayed, if other separators found cuts? */
5751  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
5752  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
5753  SCIP_PROPTIMING proptiming, /**< positions in the node solving loop where propagation method of constraint handlers should be executed */
5754  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the constraint handler's presolving method */
5755  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
5756  SCIP_DECL_CONSFREE ((*consfree)), /**< destructor of constraint handler */
5757  SCIP_DECL_CONSINIT ((*consinit)), /**< initialize constraint handler */
5758  SCIP_DECL_CONSEXIT ((*consexit)), /**< deinitialize constraint handler */
5759  SCIP_DECL_CONSINITPRE ((*consinitpre)), /**< presolving initialization method of constraint handler */
5760  SCIP_DECL_CONSEXITPRE ((*consexitpre)), /**< presolving deinitialization method of constraint handler */
5761  SCIP_DECL_CONSINITSOL ((*consinitsol)), /**< solving process initialization method of constraint handler */
5762  SCIP_DECL_CONSEXITSOL ((*consexitsol)), /**< solving process deinitialization method of constraint handler */
5763  SCIP_DECL_CONSDELETE ((*consdelete)), /**< free specific constraint data */
5764  SCIP_DECL_CONSTRANS ((*constrans)), /**< transform constraint data into data belonging to the transformed problem */
5765  SCIP_DECL_CONSINITLP ((*consinitlp)), /**< initialize LP with relaxations of "initial" constraints */
5766  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
5767  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
5768  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
5769  SCIP_DECL_CONSENFORELAX ((*consenforelax)), /**< enforcing constraints for relaxation solutions */
5770  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
5771  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
5772  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
5773  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method */
5774  SCIP_DECL_CONSRESPROP ((*consresprop)), /**< propagation conflict resolving method */
5775  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
5776  SCIP_DECL_CONSACTIVE ((*consactive)), /**< activation notification method */
5777  SCIP_DECL_CONSDEACTIVE((*consdeactive)), /**< deactivation notification method */
5778  SCIP_DECL_CONSENABLE ((*consenable)), /**< enabling notification method */
5779  SCIP_DECL_CONSDISABLE ((*consdisable)), /**< disabling notification method */
5780  SCIP_DECL_CONSDELVARS ((*consdelvars)), /**< variable deletion method */
5781  SCIP_DECL_CONSPRINT ((*consprint)), /**< constraint display method */
5782  SCIP_DECL_CONSCOPY ((*conscopy)), /**< constraint copying method */
5783  SCIP_DECL_CONSPARSE ((*consparse)), /**< constraint parsing method */
5784  SCIP_DECL_CONSGETVARS ((*consgetvars)), /**< constraint get variables method */
5785  SCIP_DECL_CONSGETNVARS((*consgetnvars)), /**< constraint get number of variable method */
5786  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), /**< constraint handler diving solution enforcement method */
5787  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
5788  )
5789 {
5790  SCIP_CONSHDLR* conshdlr;
5791 
5792  SCIP_CALL( checkStage(scip, "SCIPincludeConshdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5793 
5794  /* check whether constraint handler is already present */
5795  if( SCIPfindConshdlr(scip, name) != NULL )
5796  {
5797  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
5798  return SCIP_INVALIDDATA;
5799  }
5800 
5801  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
5802  name, desc, sepapriority, enfopriority, chckpriority, sepafreq, propfreq, eagerfreq, maxprerounds,
5803  delaysepa, delayprop, needscons, proptiming, presoltiming, conshdlrcopy,
5804  consfree, consinit, consexit, consinitpre, consexitpre, consinitsol, consexitsol,
5805  consdelete, constrans, consinitlp, conssepalp, conssepasol, consenfolp, consenforelax, consenfops, conscheck, consprop,
5806  conspresol, consresprop, conslock, consactive, consdeactive, consenable, consdisable, consdelvars, consprint,
5807  conscopy, consparse, consgetvars, consgetnvars, consgetdivebdchgs, conshdlrdata) );
5808  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
5809 
5810  return SCIP_OKAY;
5811 }
5812 
5813 /** creates a constraint handler and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
5814  * Optional callbacks can be set via specific setter functions, see SCIPsetConshdlrInit(), SCIPsetConshdlrExit(),
5815  * SCIPsetConshdlrCopy(), SCIPsetConshdlrFree(), SCIPsetConshdlrInitsol(), SCIPsetConshdlrExitsol(),
5816  * SCIPsetConshdlrInitpre(), SCIPsetConshdlrExitpre(), SCIPsetConshdlrPresol(), SCIPsetConshdlrDelete(),
5817  * SCIPsetConshdlrDelvars(), SCIPsetConshdlrInitlp(), SCIPsetConshdlrActive(), SCIPsetConshdlrDeactive(),
5818  * SCIPsetConshdlrEnable(), SCIPsetConshdlrDisable(), SCIPsetConshdlrResprop(), SCIPsetConshdlrTrans(),
5819  * SCIPsetConshdlrPrint(), SCIPsetConshdlrParse(), SCIPsetConshdlrGetVars(), SCIPsetConshdlrGetNVars(), and
5820  * SCIPsetConshdlrGetDiveBdChgs().
5821  *
5822  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5823  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5824  *
5825  * @pre This method can be called if SCIP is in one of the following stages:
5826  * - \ref SCIP_STAGE_INIT
5827  * - \ref SCIP_STAGE_PROBLEM
5828  *
5829  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeConshdlr() instead
5830  */
5832  SCIP* scip, /**< SCIP data structure */
5833  SCIP_CONSHDLR** conshdlrptr, /**< reference to a constraint handler pointer, or NULL */
5834  const char* name, /**< name of constraint handler */
5835  const char* desc, /**< description of constraint handler */
5836  int enfopriority, /**< priority of the constraint handler for constraint enforcing */
5837  int chckpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
5838  int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
5839  * propagation and enforcement, -1 for no eager evaluations, 0 for first only */
5840  SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
5841  SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
5842  SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
5843  SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
5844  SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
5845  SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
5846  )
5847 {
5848  SCIP_CONSHDLR* conshdlr;
5849 
5850  SCIP_CALL( checkStage(scip, "SCIPincludeConshdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5851 
5852  /* check whether constraint handler is already present */
5853  if( SCIPfindConshdlr(scip, name) != NULL )
5854  {
5855  SCIPerrorMessage("constraint handler <%s> already included.\n", name);
5856  return SCIP_INVALIDDATA;
5857  }
5858 
5859  SCIP_CALL( SCIPconshdlrCreate(&conshdlr, scip->set, scip->messagehdlr, scip->mem->setmem,
5860  name, desc, 0, enfopriority, chckpriority, -1, -1, eagerfreq, 0,
5861  FALSE, FALSE, needscons,
5863  NULL,
5864  NULL, NULL, NULL, NULL, NULL, NULL, NULL,
5865  NULL, NULL, NULL, NULL, NULL, consenfolp, NULL, consenfops, conscheck, NULL,
5866  NULL, NULL, conslock, NULL, NULL, NULL, NULL, NULL, NULL,
5867  NULL, NULL, NULL, NULL, NULL, conshdlrdata) );
5868  SCIP_CALL( SCIPsetIncludeConshdlr(scip->set, conshdlr) );
5869 
5870  if( conshdlrptr != NULL )
5871  *conshdlrptr = conshdlr;
5872 
5873  return SCIP_OKAY;
5874 }
5875 
5876 /** sets all separation related callbacks/parameters of the constraint handler
5877  *
5878  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5879  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5880  *
5881  * @pre This method can be called if SCIP is in one of the following stages:
5882  * - \ref SCIP_STAGE_INIT
5883  * - \ref SCIP_STAGE_PROBLEM
5884  */
5886  SCIP* scip, /**< SCIP data structure */
5887  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5888  SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
5889  SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
5890  int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
5891  int sepapriority, /**< priority of the constraint handler for separation */
5892  SCIP_Bool delaysepa /**< should separation method be delayed, if other separators found cuts? */
5893  )
5894 {
5895  int oldsepapriority;
5896  const char* name;
5897  char paramname[SCIP_MAXSTRLEN];
5898 
5899  assert(scip != NULL);
5900  assert(conshdlr != NULL);
5901 
5902  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrSepa", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5903 
5904  oldsepapriority = SCIPconshdlrGetSepaPriority(conshdlr);
5905  SCIPconshdlrSetSepa(conshdlr, conssepalp, conssepasol, sepafreq, sepapriority, delaysepa);
5906 
5907  /* change the position of the constraint handler in the constraint handler array w.r.t. its new sepa priority */
5908  if( oldsepapriority != sepapriority )
5909  SCIPsetReinsertConshdlrSepaPrio(scip->set, conshdlr, oldsepapriority);
5910 
5911  name = SCIPconshdlrGetName(conshdlr);
5912 
5913  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/sepafreq", name);
5914  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, sepafreq) );
5915 
5916  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delaysepa", name);
5917  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delaysepa) );
5918 
5919  return SCIP_OKAY;
5920 }
5921 
5922 /** sets both the propagation callback and the propagation frequency of the constraint handler
5923  *
5924  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5925  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5926  *
5927  * @pre This method can be called if SCIP is in one of the following stages:
5928  * - \ref SCIP_STAGE_INIT
5929  * - \ref SCIP_STAGE_PROBLEM
5930  */
5932  SCIP* scip, /**< SCIP data structure */
5933  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5934  SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
5935  int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
5936  SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
5937  SCIP_PROPTIMING proptiming /**< positions in the node solving loop where propagation should be executed */
5938  )
5939 {
5940  const char* name;
5941  char paramname[SCIP_MAXSTRLEN];
5942 
5943  assert(scip != NULL);
5944  assert(conshdlr != NULL);
5945 
5946  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrProp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5947 
5948  SCIPconshdlrSetProp(conshdlr, consprop, propfreq, delayprop, proptiming);
5949 
5950  name = SCIPconshdlrGetName(conshdlr);
5951 
5952  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/propfreq", name);
5953  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, propfreq) );
5954 
5955  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/proptiming", name);
5956  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) proptiming) );
5957 
5958  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/delayprop", name);
5959  SCIP_CALL( SCIPsetSetDefaultBoolParam(scip->set, paramname, delayprop) );
5960 
5961  return SCIP_OKAY;
5962 }
5963 
5964 /** sets relaxation enforcement method of the constraint handler
5965  *
5966  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5967  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5968  *
5969  * @pre This method can be called if SCIP is in one of the following stages:
5970  * - \ref SCIP_STAGE_INIT
5971  * - \ref SCIP_STAGE_PROBLEM
5972  */
5974  SCIP* scip, /**< SCIP data structure */
5975  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
5976  SCIP_DECL_CONSENFORELAX ((*consenforelax)) /**< enforcement method for relaxation solution of constraint handler (might be NULL) */
5977  )
5978 {
5979  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrEnforelax", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
5980 
5981  assert(conshdlr != NULL);
5982 
5983  SCIPconshdlrSetEnforelax(conshdlr, consenforelax);
5984 
5985  return SCIP_OKAY;
5986 }
5987 
5988 /** sets copy method of both the constraint handler and each associated constraint
5989  *
5990  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
5991  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
5992  *
5993  * @pre This method can be called if SCIP is in one of the following stages:
5994  * - \ref SCIP_STAGE_INIT
5995  * - \ref SCIP_STAGE_PROBLEM
5996  */
5998  SCIP* scip, /**< SCIP data structure */
5999  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6000  SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
6001  SCIP_DECL_CONSCOPY ((*conscopy)) /**< constraint copying method */
6002  )
6003 {
6004  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6005 
6006  assert(conshdlr != NULL);
6007 
6008  SCIPconshdlrSetCopy(conshdlr, conshdlrcopy, conscopy);
6009 
6010  return SCIP_OKAY;
6011 }
6012 
6013 /** sets destructor method of constraint handler
6014  *
6015  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6016  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6017  *
6018  * @pre This method can be called if SCIP is in one of the following stages:
6019  * - \ref SCIP_STAGE_INIT
6020  * - \ref SCIP_STAGE_PROBLEM
6021  */
6023  SCIP* scip, /**< SCIP data structure */
6024  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6025  SCIP_DECL_CONSFREE ((*consfree)) /**< destructor of constraint handler */
6026  )
6027 {
6028  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6029 
6030  assert(conshdlr != NULL);
6031 
6032  SCIPconshdlrSetFree(conshdlr, consfree);
6033 
6034  return SCIP_OKAY;
6035 }
6036 
6037 /** sets initialization method of constraint handler
6038  *
6039  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6040  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6041  *
6042  * @pre This method can be called if SCIP is in one of the following stages:
6043  * - \ref SCIP_STAGE_INIT
6044  * - \ref SCIP_STAGE_PROBLEM
6045  */
6047  SCIP* scip, /**< SCIP data structure */
6048  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6049  SCIP_DECL_CONSINIT ((*consinit)) /**< initialize constraint handler */
6050  )
6051 {
6052  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6053 
6054  assert(conshdlr != NULL);
6055 
6056  SCIPconshdlrSetInit(conshdlr, consinit);
6057 
6058  return SCIP_OKAY;
6059 }
6060 
6061 /** sets deinitialization method of constraint handler
6062  *
6063  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6064  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6065  *
6066  * @pre This method can be called if SCIP is in one of the following stages:
6067  * - \ref SCIP_STAGE_INIT
6068  * - \ref SCIP_STAGE_PROBLEM
6069  */
6071  SCIP* scip, /**< SCIP data structure */
6072  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6073  SCIP_DECL_CONSEXIT ((*consexit)) /**< deinitialize constraint handler */
6074  )
6075 {
6076  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6077 
6078  assert(conshdlr != NULL);
6079 
6080  SCIPconshdlrSetExit(conshdlr, consexit);
6081 
6082  return SCIP_OKAY;
6083 }
6084 
6085 /** sets solving process initialization method of constraint handler
6086  *
6087  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6088  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6089  *
6090  * @pre This method can be called if SCIP is in one of the following stages:
6091  * - \ref SCIP_STAGE_INIT
6092  * - \ref SCIP_STAGE_PROBLEM
6093  */
6095  SCIP* scip, /**< SCIP data structure */
6096  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6097  SCIP_DECL_CONSINITSOL((*consinitsol)) /**< solving process initialization method of constraint handler */
6098  )
6099 {
6100  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6101 
6102  assert(conshdlr != NULL);
6103 
6104  SCIPconshdlrSetInitsol(conshdlr, consinitsol);
6105 
6106  return SCIP_OKAY;
6107 }
6108 
6109 /** sets solving process deinitialization method of constraint handler
6110  *
6111  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6112  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6113  *
6114  * @pre This method can be called if SCIP is in one of the following stages:
6115  * - \ref SCIP_STAGE_INIT
6116  * - \ref SCIP_STAGE_PROBLEM
6117  */
6119  SCIP* scip, /**< SCIP data structure */
6120  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6121  SCIP_DECL_CONSEXITSOL ((*consexitsol))/**< solving process deinitialization method of constraint handler */
6122  )
6123 {
6124  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6125 
6126  assert(conshdlr != NULL);
6127 
6128  SCIPconshdlrSetExitsol(conshdlr, consexitsol);
6129 
6130  return SCIP_OKAY;
6131 }
6132 
6133 /** sets preprocessing initialization method of constraint handler
6134  *
6135  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6136  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6137  *
6138  * @pre This method can be called if SCIP is in one of the following stages:
6139  * - \ref SCIP_STAGE_INIT
6140  * - \ref SCIP_STAGE_PROBLEM
6141  */
6143  SCIP* scip, /**< SCIP data structure */
6144  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6145  SCIP_DECL_CONSINITPRE((*consinitpre)) /**< preprocessing initialization method of constraint handler */
6146  )
6147 {
6148  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6149 
6150  assert(conshdlr != NULL);
6151 
6152  SCIPconshdlrSetInitpre(conshdlr, consinitpre);
6153 
6154  return SCIP_OKAY;
6155 }
6156 
6157 /** sets preprocessing deinitialization method of constraint handler
6158  *
6159  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6160  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6161  *
6162  * @pre This method can be called if SCIP is in one of the following stages:
6163  * - \ref SCIP_STAGE_INIT
6164  * - \ref SCIP_STAGE_PROBLEM
6165  */
6167  SCIP* scip, /**< SCIP data structure */
6168  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6169  SCIP_DECL_CONSEXITPRE((*consexitpre)) /**< preprocessing deinitialization method of constraint handler */
6170  )
6171 {
6172  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6173 
6174  assert(conshdlr != NULL);
6175 
6176  SCIPconshdlrSetExitpre(conshdlr, consexitpre);
6177 
6178  return SCIP_OKAY;
6179 }
6180 
6181 /** sets presolving method of constraint handler
6182  *
6183  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6184  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6185  *
6186  * @pre This method can be called if SCIP is in one of the following stages:
6187  * - \ref SCIP_STAGE_INIT
6188  * - \ref SCIP_STAGE_PROBLEM
6189  */
6191  SCIP* scip, /**< SCIP data structure */
6192  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6193  SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method of constraint handler */
6194  int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
6195  SCIP_PRESOLTIMING presoltiming /**< timing mask of the constraint handler's presolving method */
6196  )
6197 {
6198  const char* name;
6199  char paramname[SCIP_MAXSTRLEN];
6200 
6201  assert(scip != NULL);
6202  assert(conshdlr != NULL);
6203 
6204  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrPresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6205 
6206  SCIP_CALL( SCIPconshdlrSetPresol(conshdlr, conspresol, maxprerounds, presoltiming) );
6207 
6208  name = SCIPconshdlrGetName(conshdlr);
6209 
6210  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/maxprerounds", name);
6211  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, maxprerounds) );
6212 
6213  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "constraints/%s/presoltiming", name);
6214  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) presoltiming) );
6215 
6216  return SCIP_OKAY;
6217 }
6218 
6219 /** sets method of constraint handler to free specific constraint data
6220  *
6221  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6222  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6223  *
6224  * @pre This method can be called if SCIP is in one of the following stages:
6225  * - \ref SCIP_STAGE_INIT
6226  * - \ref SCIP_STAGE_PROBLEM
6227  */
6229  SCIP* scip, /**< SCIP data structure */
6230  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6231  SCIP_DECL_CONSDELETE ((*consdelete)) /**< free specific constraint data */
6232  )
6233 {
6234  assert(scip != NULL);
6235  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDelete", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6236 
6237  SCIPconshdlrSetDelete(conshdlr, consdelete);
6238 
6239  return SCIP_OKAY;
6240 }
6241 
6242 /** sets method of constraint handler to transform constraint data into data belonging to the transformed problem
6243  *
6244  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6245  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6246  *
6247  * @pre This method can be called if SCIP is in one of the following stages:
6248  * - \ref SCIP_STAGE_INIT
6249  * - \ref SCIP_STAGE_PROBLEM
6250  */
6252  SCIP* scip, /**< SCIP data structure */
6253  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6254  SCIP_DECL_CONSTRANS ((*constrans)) /**< transform constraint data into data belonging to the transformed problem */
6255  )
6256 {
6257  assert(scip != NULL);
6258  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrTrans", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6259 
6260  SCIPconshdlrSetTrans(conshdlr, constrans);
6261 
6262  return SCIP_OKAY;
6263 }
6264 
6265 /** sets method of constraint handler to initialize LP with relaxations of "initial" constraints
6266  *
6267  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6268  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6269  *
6270  * @pre This method can be called if SCIP is in one of the following stages:
6271  * - \ref SCIP_STAGE_INIT
6272  * - \ref SCIP_STAGE_PROBLEM
6273  */
6275  SCIP* scip, /**< SCIP data structure */
6276  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6277  SCIP_DECL_CONSINITLP ((*consinitlp)) /**< initialize LP with relaxations of "initial" constraints */
6278  )
6279 {
6280  assert(scip != NULL);
6281  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrInitlp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6282 
6283  SCIPconshdlrSetInitlp(conshdlr, consinitlp);
6284 
6285  return SCIP_OKAY;
6286 }
6287 
6288 /** sets propagation conflict resolving method of constraint handler
6289  *
6290  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6291  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6292  *
6293  * @pre This method can be called if SCIP is in one of the following stages:
6294  * - \ref SCIP_STAGE_INIT
6295  * - \ref SCIP_STAGE_PROBLEM
6296  */
6298  SCIP* scip, /**< SCIP data structure */
6299  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6300  SCIP_DECL_CONSRESPROP ((*consresprop)) /**< propagation conflict resolving method */
6301  )
6302 {
6303  assert(scip != NULL);
6304  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrResprop", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6305 
6306  SCIPconshdlrSetResprop(conshdlr, consresprop);
6307 
6308  return SCIP_OKAY;
6309 }
6310 
6311 /** sets activation notification method of constraint handler
6312  *
6313  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6314  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6315  *
6316  * @pre This method can be called if SCIP is in one of the following stages:
6317  * - \ref SCIP_STAGE_INIT
6318  * - \ref SCIP_STAGE_PROBLEM
6319  */
6321  SCIP* scip, /**< SCIP data structure */
6322  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6323  SCIP_DECL_CONSACTIVE ((*consactive)) /**< activation notification method */
6324  )
6325 {
6326  assert(scip != NULL);
6327  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrActive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6328 
6329  SCIPconshdlrSetActive(conshdlr, consactive);
6330 
6331  return SCIP_OKAY;
6332 }
6333 
6334 /** sets deactivation notification method of constraint handler
6335  *
6336  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6337  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6338  *
6339  * @pre This method can be called if SCIP is in one of the following stages:
6340  * - \ref SCIP_STAGE_INIT
6341  * - \ref SCIP_STAGE_PROBLEM
6342  */
6344  SCIP* scip, /**< SCIP data structure */
6345  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6346  SCIP_DECL_CONSDEACTIVE((*consdeactive)) /**< deactivation notification method */
6347  )
6348 {
6349  assert(scip != NULL);
6350  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDeactive", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6351 
6352  SCIPconshdlrSetDeactive(conshdlr, consdeactive);
6353 
6354  return SCIP_OKAY;
6355 }
6356 
6357 /** sets enabling notification method of constraint handler
6358  *
6359  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6360  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6361  *
6362  * @pre This method can be called if SCIP is in one of the following stages:
6363  * - \ref SCIP_STAGE_INIT
6364  * - \ref SCIP_STAGE_PROBLEM
6365  */
6367  SCIP* scip, /**< SCIP data structure */
6368  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6369  SCIP_DECL_CONSENABLE ((*consenable)) /**< enabling notification method */
6370  )
6371 {
6372  assert(scip != NULL);
6373  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrEnable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6374 
6375  SCIPconshdlrSetEnable(conshdlr, consenable);
6376 
6377  return SCIP_OKAY;
6378 }
6379 
6380 /** sets disabling notification method of constraint handler
6381  *
6382  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6383  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6384  *
6385  * @pre This method can be called if SCIP is in one of the following stages:
6386  * - \ref SCIP_STAGE_INIT
6387  * - \ref SCIP_STAGE_PROBLEM
6388  */
6390  SCIP* scip, /**< SCIP data structure */
6391  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6392  SCIP_DECL_CONSDISABLE ((*consdisable)) /**< disabling notification method */
6393  )
6394 {
6395  assert(scip != NULL);
6396  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDisable", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6397 
6398  SCIPconshdlrSetDisable(conshdlr, consdisable);
6399 
6400  return SCIP_OKAY;
6401 }
6402 
6403 /** sets variable deletion method of constraint handler
6404  *
6405  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6406  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6407  *
6408  * @pre This method can be called if SCIP is in one of the following stages:
6409  * - \ref SCIP_STAGE_INIT
6410  * - \ref SCIP_STAGE_PROBLEM
6411  */
6413  SCIP* scip, /**< SCIP data structure */
6414  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6415  SCIP_DECL_CONSDELVARS ((*consdelvars)) /**< variable deletion method */
6416  )
6417 {
6418  assert(scip != NULL);
6419  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrDelvars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6420 
6421  SCIPconshdlrSetDelvars(conshdlr, consdelvars);
6422 
6423  return SCIP_OKAY;
6424 }
6425 
6426 /** sets constraint display method of constraint handler
6427  *
6428  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6429  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6430  *
6431  * @pre This method can be called if SCIP is in one of the following stages:
6432  * - \ref SCIP_STAGE_INIT
6433  * - \ref SCIP_STAGE_PROBLEM
6434  */
6436  SCIP* scip, /**< SCIP data structure */
6437  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6438  SCIP_DECL_CONSPRINT ((*consprint)) /**< constraint display method */
6439  )
6440 {
6441  assert(scip != NULL);
6442  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrPrint", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6443 
6444  SCIPconshdlrSetPrint(conshdlr, consprint);
6445 
6446  return SCIP_OKAY;
6447 }
6448 
6449 /** sets constraint parsing method of constraint handler
6450  *
6451  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6452  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6453  *
6454  * @pre This method can be called if SCIP is in one of the following stages:
6455  * - \ref SCIP_STAGE_INIT
6456  * - \ref SCIP_STAGE_PROBLEM
6457  */
6459  SCIP* scip, /**< SCIP data structure */
6460  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6461  SCIP_DECL_CONSPARSE ((*consparse)) /**< constraint parsing method */
6462  )
6463 {
6464  assert(scip != NULL);
6465  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrParse", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6466 
6467  SCIPconshdlrSetParse(conshdlr, consparse);
6468 
6469  return SCIP_OKAY;
6470 }
6471 
6472 /** sets constraint variable getter method of constraint handler
6473  *
6474  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6475  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6476  *
6477  * @pre This method can be called if SCIP is in one of the following stages:
6478  * - \ref SCIP_STAGE_INIT
6479  * - \ref SCIP_STAGE_PROBLEM
6480  */
6482  SCIP* scip, /**< SCIP data structure */
6483  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6484  SCIP_DECL_CONSGETVARS ((*consgetvars)) /**< constraint variable getter method */
6485  )
6486 {
6487  assert(scip != NULL);
6488  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6489 
6490  SCIPconshdlrSetGetVars(conshdlr, consgetvars);
6491 
6492  return SCIP_OKAY;
6493 }
6494 
6495 /** sets constraint variable number getter method of constraint handler
6496  *
6497  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6498  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6499  *
6500  * @pre This method can be called if SCIP is in one of the following stages:
6501  * - \ref SCIP_STAGE_INIT
6502  * - \ref SCIP_STAGE_PROBLEM
6503  */
6505  SCIP* scip, /**< SCIP data structure */
6506  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6507  SCIP_DECL_CONSGETNVARS((*consgetnvars)) /**< constraint variable number getter method */
6508  )
6509 {
6510  assert(scip != NULL);
6511  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetNVars", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6512 
6513  SCIPconshdlrSetGetNVars(conshdlr, consgetnvars);
6514 
6515  return SCIP_OKAY;
6516 }
6517 
6518 /** sets diving bound change method of constraint handler
6519  *
6520  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
6521  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
6522  *
6523  * @pre This method can be called if SCIP is in one of the following stages:
6524  * - \ref SCIP_STAGE_INIT
6525  * - \ref SCIP_STAGE_PROBLEM
6526  */
6528  SCIP* scip, /**< SCIP data structure */
6529  SCIP_CONSHDLR* conshdlr, /**< constraint handler */
6530  SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)) /**< constraint handler diving solution enforcement method */
6531  )
6532 {
6533  assert(scip != NULL);
6534  SCIP_CALL( checkStage(scip, "SCIPsetConshdlrGetDiveBdChgs", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6535 
6536  SCIPconshdlrSetGetDiveBdChgs(conshdlr, consgetdivebdchgs);
6537 
6538  return SCIP_OKAY;
6539 }
6540 /** returns the constraint handler of the given name, or NULL if not existing */
6542  SCIP* scip, /**< SCIP data structure */
6543  const char* name /**< name of constraint handler */
6544  )
6545 {
6546  assert(scip != NULL);
6547  assert(scip->set != NULL);
6548  assert(name != NULL);
6549 
6550  return SCIPsetFindConshdlr(scip->set, name);
6551 }
6552 
6553 /** returns the array of currently available constraint handlers */
6555  SCIP* scip /**< SCIP data structure */
6556  )
6557 {
6558  assert(scip != NULL);
6559  assert(scip->set != NULL);
6560 
6561  return scip->set->conshdlrs;
6562 }
6563 
6564 /** returns the number of currently available constraint handlers */
6566  SCIP* scip /**< SCIP data structure */
6567  )
6568 {
6569  assert(scip != NULL);
6570  assert(scip->set != NULL);
6571 
6572  return scip->set->nconshdlrs;
6573 }
6574 
6575 /** creates a conflict handler and includes it in SCIP
6576  *
6577  * @note method has all conflict handler callbacks as arguments and is thus changed every time a new
6578  * callback is added
6579  * in future releases; consider using SCIPincludeConflicthdlrBasic() and setter functions
6580  * if you seek for a method which is less likely to change in future releases
6581  */
6583  SCIP* scip, /**< SCIP data structure */
6584  const char* name, /**< name of conflict handler */
6585  const char* desc, /**< description of conflict handler */
6586  int priority, /**< priority of the conflict handler */
6587  SCIP_DECL_CONFLICTCOPY((*conflictcopy)), /**< copy method of conflict handler or NULL if you don't want to copy your plugin into sub-SCIPs */
6588  SCIP_DECL_CONFLICTFREE((*conflictfree)), /**< destructor of conflict handler */
6589  SCIP_DECL_CONFLICTINIT((*conflictinit)), /**< initialize conflict handler */
6590  SCIP_DECL_CONFLICTEXIT((*conflictexit)), /**< deinitialize conflict handler */
6591  SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)),/**< solving process initialization method of conflict handler */
6592  SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)),/**< solving process deinitialization method of conflict handler */
6593  SCIP_DECL_CONFLICTEXEC((*conflictexec)), /**< conflict processing method of conflict handler */
6594  SCIP_CONFLICTHDLRDATA* conflicthdlrdata /**< conflict handler data */
6595  )
6596 {
6597  SCIP_CONFLICTHDLR* conflicthdlr;
6598 
6599  SCIP_CALL( checkStage(scip, "SCIPincludeConflicthdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6600 
6601  /* check whether conflict handler is already present */
6602  if( SCIPfindConflicthdlr(scip, name) != NULL )
6603  {
6604  SCIPerrorMessage("conflict handler <%s> already included.\n", name);
6605  return SCIP_INVALIDDATA;
6606  }
6607 
6608  SCIP_CALL( SCIPconflicthdlrCreate(&conflicthdlr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
6609  conflictcopy,
6610  conflictfree, conflictinit, conflictexit, conflictinitsol, conflictexitsol, conflictexec,
6611  conflicthdlrdata) );
6612  SCIP_CALL( SCIPsetIncludeConflicthdlr(scip->set, conflicthdlr) );
6613 
6614  return SCIP_OKAY;
6615 }
6616 
6617 /** creates a conflict handler and includes it in SCIP with its most fundamental callbacks. All non-fundamental
6618  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
6619  * Optional callbacks can be set via specific setter functions SCIPsetConflicthdlrCopy(), SCIPsetConflicthdlrFree(),
6620  * SCIPsetConflicthdlrInit(), SCIPsetConflicthdlrExit(), SCIPsetConflicthdlrInitsol(),
6621  * and SCIPsetConflicthdlrExitsol()
6622  *
6623  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeConflicthdlr() instead
6624  */
6626  SCIP* scip, /**< SCIP data structure */
6627  SCIP_CONFLICTHDLR** conflicthdlrptr, /**< reference to a conflict handler pointer, or NULL */
6628  const char* name, /**< name of conflict handler */
6629  const char* desc, /**< description of conflict handler */
6630  int priority, /**< priority of the conflict handler */
6631  SCIP_DECL_CONFLICTEXEC((*conflictexec)), /**< conflict processing method of conflict handler */
6632  SCIP_CONFLICTHDLRDATA* conflicthdlrdata /**< conflict handler data */
6633  )
6634 {
6635  SCIP_CONFLICTHDLR* conflicthdlr;
6636 
6637  SCIP_CALL( checkStage(scip, "SCIPincludeConflicthdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6638 
6639  /* check whether conflict handler is already present */
6640  if( SCIPfindConflicthdlr(scip, name) != NULL )
6641  {
6642  SCIPerrorMessage("conflict handler <%s> already included.\n", name);
6643  return SCIP_INVALIDDATA;
6644  }
6645 
6646  SCIP_CALL( SCIPconflicthdlrCreate(&conflicthdlr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
6647  NULL, NULL, NULL, NULL, NULL, NULL, conflictexec, conflicthdlrdata) );
6648  SCIP_CALL( SCIPsetIncludeConflicthdlr(scip->set, conflicthdlr) );
6649 
6650  if( conflicthdlrptr != NULL )
6651  *conflicthdlrptr = conflicthdlr;
6652 
6653  return SCIP_OKAY;
6654 }
6655 
6656 /** set copy method of conflict handler */
6658  SCIP* scip, /**< SCIP data structure */
6659  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6660  SCIP_DECL_CONFLICTCOPY((*conflictcopy)) /**< copy method of conflict handler */
6661  )
6662 {
6663  assert(scip != NULL);
6664 
6665  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6666 
6667  SCIPconflicthdlrSetCopy(conflicthdlr, conflictcopy);
6668 
6669  return SCIP_OKAY;
6670 }
6671 
6672 /** set destructor of conflict handler */
6674  SCIP* scip, /**< SCIP data structure */
6675  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6676  SCIP_DECL_CONFLICTFREE((*conflictfree)) /**< destructor of conflict handler */
6677  )
6678 {
6679  assert(scip != NULL);
6680 
6681  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6682 
6683  SCIPconflicthdlrSetFree(conflicthdlr, conflictfree);
6684 
6685  return SCIP_OKAY;
6686 }
6687 
6688 /** set initialization method of conflict handler */
6690  SCIP* scip, /**< SCIP data structure */
6691  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6692  SCIP_DECL_CONFLICTINIT((*conflictinit)) /**< initialize conflict handler */
6693  )
6694 {
6695  assert(scip != NULL);
6696 
6697  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6698 
6699  SCIPconflicthdlrSetInit(conflicthdlr, conflictinit);
6700 
6701  return SCIP_OKAY;
6702 }
6703 
6704 /** set deinitialization method of conflict handler */
6706  SCIP* scip, /**< SCIP data structure */
6707  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6708  SCIP_DECL_CONFLICTEXIT((*conflictexit)) /**< deinitialize conflict handler */
6709  )
6710 {
6711  assert(scip != NULL);
6712 
6713  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6714 
6715  SCIPconflicthdlrSetExit(conflicthdlr, conflictexit);
6716 
6717  return SCIP_OKAY;
6718 }
6719 
6720 /** set solving process initialization method of conflict handler */
6722  SCIP* scip, /**< SCIP data structure */
6723  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6724  SCIP_DECL_CONFLICTINITSOL((*conflictinitsol))/**< solving process initialization method of conflict handler */
6725  )
6726 {
6727  assert(scip != NULL);
6728 
6729  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6730 
6731  SCIPconflicthdlrSetInitsol(conflicthdlr, conflictinitsol);
6732 
6733  return SCIP_OKAY;
6734 }
6735 
6736 /** set solving process deinitialization method of conflict handler */
6738  SCIP* scip, /**< SCIP data structure */
6739  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6740  SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol))/**< solving process deinitialization method of conflict handler */
6741  )
6742 {
6743  assert(scip != NULL);
6744 
6745  SCIP_CALL( checkStage(scip, "SCIPsetConflicthdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6746 
6747  SCIPconflicthdlrSetExitsol(conflicthdlr, conflictexitsol);
6748 
6749  return SCIP_OKAY;
6750 }
6751 
6752 /** returns the conflict handler of the given name, or NULL if not existing */
6754  SCIP* scip, /**< SCIP data structure */
6755  const char* name /**< name of conflict handler */
6756  )
6757 {
6758  assert(scip != NULL);
6759  assert(scip->set != NULL);
6760  assert(name != NULL);
6761 
6762  return SCIPsetFindConflicthdlr(scip->set, name);
6763 }
6764 
6765 /** returns the array of currently available conflict handlers */
6767  SCIP* scip /**< SCIP data structure */
6768  )
6769 {
6770  assert(scip != NULL);
6771  assert(scip->set != NULL);
6772 
6774 
6775  return scip->set->conflicthdlrs;
6776 }
6777 
6778 /** returns the number of currently available conflict handlers */
6780  SCIP* scip /**< SCIP data structure */
6781  )
6782 {
6783  assert(scip != NULL);
6784  assert(scip->set != NULL);
6785 
6786  return scip->set->nconflicthdlrs;
6787 }
6788 
6789 /** sets the priority of a conflict handler */
6791  SCIP* scip, /**< SCIP data structure */
6792  SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
6793  int priority /**< new priority of the conflict handler */
6794  )
6795 {
6796  assert(scip != NULL);
6797  assert(scip->set != NULL);
6798 
6799  SCIPconflicthdlrSetPriority(conflicthdlr, scip->set, priority);
6800 
6801  return SCIP_OKAY;
6802 }
6803 
6804 /** creates a presolver and includes it in SCIP.
6805  *
6806  * @note method has all presolver callbacks as arguments and is thus changed every time a new
6807  * callback is added
6808  * in future releases; consider using SCIPincludePresolBasic() and setter functions
6809  * if you seek for a method which is less likely to change in future releases
6810  */
6812  SCIP* scip, /**< SCIP data structure */
6813  const char* name, /**< name of presolver */
6814  const char* desc, /**< description of presolver */
6815  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
6816  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
6817  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
6818  SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
6819  SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
6820  SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
6821  SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
6822  SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
6823  SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
6824  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
6825  SCIP_PRESOLDATA* presoldata /**< presolver data */
6826  )
6827 {
6828  SCIP_PRESOL* presol;
6829 
6830  SCIP_CALL( checkStage(scip, "SCIPincludePresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6831 
6832  /* check whether presolver is already present */
6833  if( SCIPfindPresol(scip, name) != NULL )
6834  {
6835  SCIPerrorMessage("presolver <%s> already included.\n", name);
6836  return SCIP_INVALIDDATA;
6837  }
6838 
6839  SCIP_CALL( SCIPpresolCreate(&presol, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
6840  maxrounds, timing, presolcopy,
6841  presolfree, presolinit, presolexit, presolinitpre, presolexitpre, presolexec, presoldata) );
6842  SCIP_CALL( SCIPsetIncludePresol(scip->set, presol) );
6843 
6844  return SCIP_OKAY;
6845 }
6846 
6847 /** creates a presolver and includes it in SCIP with its fundamental callback. All non-fundamental (or optional)
6848  * callbacks as, e.g., init and exit callbacks, will be set to NULL. Optional callbacks can be set via specific setter
6849  * functions. These are SCIPsetPresolCopy(), SCIPsetPresolFree(), SCIPsetPresolInit(), SCIPsetPresolExit(),
6850  * SCIPsetPresolInitpre(), and SCIPsetPresolExitPre().
6851  *
6852  * @note if you want to set all callbacks with a single method call, consider using SCIPincludePresol() instead
6853  */
6855  SCIP* scip, /**< SCIP data structure */
6856  SCIP_PRESOL** presolptr, /**< reference to presolver, or NULL */
6857  const char* name, /**< name of presolver */
6858  const char* desc, /**< description of presolver */
6859  int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
6860  int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
6861  SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
6862  SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
6863  SCIP_PRESOLDATA* presoldata /**< presolver data */
6864  )
6865 {
6866  SCIP_PRESOL* presol;
6867 
6868  SCIP_CALL( checkStage(scip, "SCIPincludePresolBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6869 
6870  /* check whether presolver is already present */
6871  if( SCIPfindPresol(scip, name) != NULL )
6872  {
6873  SCIPerrorMessage("presolver <%s> already included.\n", name);
6874  return SCIP_INVALIDDATA;
6875  }
6876 
6877  SCIP_CALL( SCIPpresolCreate(&presol, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, maxrounds, timing,
6878  NULL,
6879  NULL, NULL, NULL, NULL, NULL, presolexec, presoldata) );
6880  SCIP_CALL( SCIPsetIncludePresol(scip->set, presol) );
6881 
6882  if( presolptr != NULL )
6883  *presolptr = presol;
6884 
6885  return SCIP_OKAY;
6886 }
6887 
6888 /** sets copy method of presolver */
6890  SCIP* scip, /**< SCIP data structure */
6891  SCIP_PRESOL* presol, /**< presolver */
6892  SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
6893  )
6894 {
6895  SCIP_CALL( checkStage(scip, "SCIPsetPresolCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6896 
6897  assert(presol != NULL);
6898 
6899  SCIPpresolSetCopy(presol, presolcopy);
6900 
6901  return SCIP_OKAY;
6902 }
6903 
6904 /** sets destructor method of presolver */
6906  SCIP* scip, /**< SCIP data structure */
6907  SCIP_PRESOL* presol, /**< presolver */
6908  SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
6909  )
6910 {
6911  SCIP_CALL( checkStage(scip, "SCIPsetPresolFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6912 
6913  assert(presol != NULL);
6914 
6915  SCIPpresolSetFree(presol, presolfree);
6916 
6917  return SCIP_OKAY;
6918 }
6919 
6920 /** sets initialization method of presolver */
6922  SCIP* scip, /**< SCIP data structure */
6923  SCIP_PRESOL* presol, /**< presolver */
6924  SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
6925  )
6926 {
6927  SCIP_CALL( checkStage(scip, "SCIPsetPresolInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6928 
6929  assert(presol != NULL);
6930 
6931  SCIPpresolSetInit(presol, presolinit);
6932 
6933  return SCIP_OKAY;
6934 }
6935 
6936 /** sets deinitialization method of presolver */
6938  SCIP* scip, /**< SCIP data structure */
6939  SCIP_PRESOL* presol, /**< presolver */
6940  SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
6941  )
6942 {
6943  SCIP_CALL( checkStage(scip, "SCIPsetPresolExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6944 
6945  assert(presol != NULL);
6946 
6947  SCIPpresolSetExit(presol, presolexit);
6948 
6949  return SCIP_OKAY;
6950 }
6951 
6952 /** sets solving process initialization method of presolver */
6954  SCIP* scip, /**< SCIP data structure */
6955  SCIP_PRESOL* presol, /**< presolver */
6956  SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
6957  )
6958 {
6959  SCIP_CALL( checkStage(scip, "SCIPsetPresolInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6960 
6961  assert(presol != NULL);
6962 
6963  SCIPpresolSetInitpre(presol, presolinitpre);
6964 
6965  return SCIP_OKAY;
6966 }
6967 
6968 /** sets solving process deinitialization method of presolver */
6970  SCIP* scip, /**< SCIP data structure */
6971  SCIP_PRESOL* presol, /**< presolver */
6972  SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
6973  )
6974 {
6975  SCIP_CALL( checkStage(scip, "SCIPsetPresolExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
6976 
6977  assert(presol != NULL);
6978 
6979  SCIPpresolSetExitpre(presol, presolexitpre);
6980 
6981  return SCIP_OKAY;
6982 }
6983 
6984 /** returns the presolver of the given name, or NULL if not existing */
6986  SCIP* scip, /**< SCIP data structure */
6987  const char* name /**< name of presolver */
6988  )
6989 {
6990  assert(scip != NULL);
6991  assert(scip->set != NULL);
6992  assert(name != NULL);
6993 
6994  return SCIPsetFindPresol(scip->set, name);
6995 }
6996 
6997 /** returns the array of currently available presolvers */
6999  SCIP* scip /**< SCIP data structure */
7000  )
7001 {
7002  assert(scip != NULL);
7003  assert(scip->set != NULL);
7004 
7005  SCIPsetSortPresols(scip->set);
7006 
7007  return scip->set->presols;
7008 }
7009 
7010 /** returns the number of currently available presolvers */
7012  SCIP* scip /**< SCIP data structure */
7013  )
7014 {
7015  assert(scip != NULL);
7016  assert(scip->set != NULL);
7017 
7018  return scip->set->npresols;
7019 }
7020 
7021 /** sets the priority of a presolver */
7023  SCIP* scip, /**< SCIP data structure */
7024  SCIP_PRESOL* presol, /**< presolver */
7025  int priority /**< new priority of the presolver */
7026  )
7027 {
7028  assert(scip != NULL);
7029  assert(scip->set != NULL);
7030 
7031  SCIPpresolSetPriority(presol, scip->set, priority);
7032 
7033  return SCIP_OKAY;
7034 }
7035 
7036 /** creates a relaxation handler and includes it in SCIP
7037  *
7038  * @note method has all relaxation handler callbacks as arguments and is thus changed every time a new
7039  * callback is added
7040  * in future releases; consider using SCIPincludeRelaxBasic() and setter functions
7041  * if you seek for a method which is less likely to change in future releases
7042  */
7044  SCIP* scip, /**< SCIP data structure */
7045  const char* name, /**< name of relaxation handler */
7046  const char* desc, /**< description of relaxation handler */
7047  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
7048  int freq, /**< frequency for calling relaxation handler */
7049  SCIP_Bool includeslp, /**< does the relaxator contain all cuts in the LP? */
7050  SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
7051  SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxation handler */
7052  SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxation handler */
7053  SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxation handler */
7054  SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxation handler */
7055  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxation handler */
7056  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
7057  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
7058  )
7059 {
7060  SCIP_RELAX* relax;
7061 
7062  SCIP_CALL( checkStage(scip, "SCIPincludeRelax", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7063 
7064  /* check whether relaxation handler is already present */
7065  if( SCIPfindRelax(scip, name) != NULL )
7066  {
7067  SCIPerrorMessage("relaxation handler <%s> already included.\n", name);
7068  return SCIP_INVALIDDATA;
7069  }
7070 
7071  SCIP_CALL( SCIPrelaxCreate(&relax, scip->set, scip->messagehdlr, scip->mem->setmem,
7072  name, desc, priority, freq, includeslp,
7073  relaxcopy,
7074  relaxfree, relaxinit, relaxexit, relaxinitsol, relaxexitsol, relaxexec, relaxdata) );
7075  SCIP_CALL( SCIPsetIncludeRelax(scip->set, relax) );
7076 
7077  return SCIP_OKAY;
7078 }
7079 
7080 /** creates a relaxation handler and includes it in SCIP. All non fundamental
7081  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
7082  * Optional callbacks can be set via specific setter functions, see SCIPsetRelaxInit(), SCIPsetRelaxExit(),
7083  * SCIPsetRelaxCopy(), SCIPsetRelaxFree(), SCIPsetRelaxInitsol(), and SCIPsetRelaxExitsol()
7084  *
7085  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeRelax() instead
7086  */
7088  SCIP* scip, /**< SCIP data structure */
7089  SCIP_RELAX** relaxptr, /**< reference to relaxation pointer, or NULL */
7090  const char* name, /**< name of relaxation handler */
7091  const char* desc, /**< description of relaxation handler */
7092  int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */
7093  int freq, /**< frequency for calling relaxation handler */
7094  SCIP_Bool includeslp, /**< does the relaxator contain all cuts in the LP? */
7095  SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */
7096  SCIP_RELAXDATA* relaxdata /**< relaxation handler data */
7097  )
7098 {
7099  SCIP_RELAX* relax;
7100 
7101  SCIP_CALL( checkStage(scip, "SCIPincludeRelaxBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7102 
7103  /* check whether relaxation handler is already present */
7104  if( SCIPfindRelax(scip, name) != NULL )
7105  {
7106  SCIPerrorMessage("relaxation handler <%s> already included.\n", name);
7107  return SCIP_INVALIDDATA;
7108  }
7109 
7110  SCIP_CALL( SCIPrelaxCreate(&relax, scip->set, scip->messagehdlr, scip->mem->setmem,
7111  name, desc, priority, freq, includeslp,
7112  NULL, NULL, NULL, NULL, NULL, NULL, relaxexec, relaxdata) );
7113  SCIP_CALL( SCIPsetIncludeRelax(scip->set, relax) );
7114 
7115  if( relaxptr != NULL )
7116  *relaxptr = relax;
7117 
7118  return SCIP_OKAY;
7119 }
7120 
7121 /** sets copy method of relaxation handler */
7123  SCIP* scip, /**< SCIP data structure */
7124  SCIP_RELAX* relax, /**< relaxation handler */
7125  SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */
7126  )
7127 {
7128  SCIP_CALL( checkStage(scip, "SCIPsetRelaxCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7129 
7130  assert(relax != NULL);
7131 
7132  SCIPrelaxSetCopy(relax, relaxcopy);
7133 
7134  return SCIP_OKAY;
7135 }
7136 
7137 /** sets destructor method of relaxation handler */
7139  SCIP* scip, /**< SCIP data structure */
7140  SCIP_RELAX* relax, /**< relaxation handler */
7141  SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */
7142  )
7143 {
7144  SCIP_CALL( checkStage(scip, "SCIPsetRelaxFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7145 
7146  assert(relax != NULL);
7147 
7148  SCIPrelaxSetFree(relax, relaxfree);
7149 
7150  return SCIP_OKAY;
7151 }
7152 
7153 /** sets initialization method of relaxation handler */
7155  SCIP* scip, /**< SCIP data structure */
7156  SCIP_RELAX* relax, /**< relaxation handler */
7157  SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */
7158  )
7159 {
7160  SCIP_CALL( checkStage(scip, "SCIPsetRelaxInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7161 
7162  assert(relax != NULL);
7163 
7164  SCIPrelaxSetInit(relax, relaxinit);
7165 
7166  return SCIP_OKAY;
7167 }
7168 
7169 /** sets deinitialization method of relaxation handler */
7171  SCIP* scip, /**< SCIP data structure */
7172  SCIP_RELAX* relax, /**< relaxation handler */
7173  SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */
7174  )
7175 {
7176  SCIP_CALL( checkStage(scip, "SCIPsetRelaxExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7177 
7178  assert(relax != NULL);
7179 
7180  SCIPrelaxSetExit(relax, relaxexit);
7181 
7182  return SCIP_OKAY;
7183 }
7184 
7185 /** sets solving process initialization method of relaxation handler */
7187  SCIP* scip, /**< SCIP data structure */
7188  SCIP_RELAX* relax, /**< relaxation handler */
7189  SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */
7190  )
7191 {
7192  SCIP_CALL( checkStage(scip, "SCIPsetRelaxInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7193 
7194  assert(relax != NULL);
7195 
7196  SCIPrelaxSetInitsol(relax, relaxinitsol);
7197 
7198  return SCIP_OKAY;
7199 }
7200 
7201 /** sets solving process deinitialization method of relaxation handler */
7203  SCIP* scip, /**< SCIP data structure */
7204  SCIP_RELAX* relax, /**< relaxation handler */
7205  SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization method of relaxation handler */
7206  )
7207 {
7208  SCIP_CALL( checkStage(scip, "SCIPsetRelaxExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7209 
7210  assert(relax != NULL);
7211 
7212  SCIPrelaxSetExitsol(relax, relaxexitsol);
7213 
7214  return SCIP_OKAY;
7215 }
7216 
7217 
7218 /** returns the relaxation handler of the given name, or NULL if not existing */
7220  SCIP* scip, /**< SCIP data structure */
7221  const char* name /**< name of relaxation handler */
7222  )
7223 {
7224  assert(scip != NULL);
7225  assert(scip->set != NULL);
7226  assert(name != NULL);
7227 
7228  return SCIPsetFindRelax(scip->set, name);
7229 }
7230 
7231 /** returns the array of currently available relaxation handlers */
7233  SCIP* scip /**< SCIP data structure */
7234  )
7235 {
7236  assert(scip != NULL);
7237  assert(scip->set != NULL);
7238 
7239  SCIPsetSortRelaxs(scip->set);
7240 
7241  return scip->set->relaxs;
7242 }
7243 
7244 /** returns the number of currently available relaxation handlers */
7246  SCIP* scip /**< SCIP data structure */
7247  )
7248 {
7249  assert(scip != NULL);
7250  assert(scip->set != NULL);
7251 
7252  return scip->set->nrelaxs;
7253 }
7254 
7255 /** sets the priority of a relaxation handler */
7257  SCIP* scip, /**< SCIP data structure */
7258  SCIP_RELAX* relax, /**< relaxation handler */
7259  int priority /**< new priority of the relaxation handler */
7260  )
7261 {
7262  assert(scip != NULL);
7263  assert(scip->set != NULL);
7264 
7265  SCIPrelaxSetPriority(relax, scip->set, priority);
7266 
7267  return SCIP_OKAY;
7268 }
7269 
7270 /** creates a separator and includes it in SCIP.
7271  *
7272  * @note method has all separator callbacks as arguments and is thus changed every time a new
7273  * callback is added
7274  * in future releases; consider using SCIPincludeSepaBasic() and setter functions
7275  * if you seek for a method which is less likely to change in future releases
7276  */
7278  SCIP* scip, /**< SCIP data structure */
7279  const char* name, /**< name of separator */
7280  const char* desc, /**< description of separator */
7281  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
7282  int freq, /**< frequency for calling separator */
7283  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
7284  * to best node's dual bound for applying separation */
7285  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
7286  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
7287  SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
7288  SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */
7289  SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */
7290  SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */
7291  SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */
7292  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */
7293  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
7294  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
7295  SCIP_SEPADATA* sepadata /**< separator data */
7296  )
7297 {
7298  SCIP_SEPA* sepa;
7299 
7300  SCIP_CALL( checkStage(scip, "SCIPincludeSepa", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7301 
7302  /* check whether separator is already present */
7303  if( SCIPfindSepa(scip, name) != NULL )
7304  {
7305  SCIPerrorMessage("separator <%s> already included.\n", name);
7306  return SCIP_INVALIDDATA;
7307  }
7308 
7309  SCIP_CALL( SCIPsepaCreate(&sepa, scip->set, scip->messagehdlr, scip->mem->setmem,
7310  name, desc, priority, freq, maxbounddist, usessubscip, delay,
7311  sepacopy,
7312  sepafree, sepainit, sepaexit, sepainitsol, sepaexitsol, sepaexeclp, sepaexecsol, sepadata) );
7313  SCIP_CALL( SCIPsetIncludeSepa(scip->set, sepa) );
7314 
7315  return SCIP_OKAY;
7316 }
7317 
7318 /** creates a separator and includes it in SCIP with its most fundamental callbacks. All non-fundamental
7319  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
7320  * Optional callbacks can be set via specific setter functions, see SCIPsetSepaInit(), SCIPsetSepaFree(),
7321  * SCIPsetSepaInitsol(), SCIPsetSepaExitsol(), SCIPsetSepaCopy(), SCIPsetExit().
7322  *
7323  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeSepa() instead
7324  */
7326  SCIP* scip, /**< SCIP data structure */
7327  SCIP_SEPA** sepa, /**< reference to a separator, or NULL */
7328  const char* name, /**< name of separator */
7329  const char* desc, /**< description of separator */
7330  int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */
7331  int freq, /**< frequency for calling separator */
7332  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared
7333  * to best node's dual bound for applying separation */
7334  SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */
7335  SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */
7336  SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */
7337  SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */
7338  SCIP_SEPADATA* sepadata /**< separator data */
7339  )
7340 {
7341  SCIP_SEPA* sepaptr;
7342 
7343  SCIP_CALL( checkStage(scip, "SCIPincludeSepaBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7344 
7345  /* check whether separator is already present */
7346  if( SCIPfindSepa(scip, name) != NULL )
7347  {
7348  SCIPerrorMessage("separator <%s> already included.\n", name);
7349  return SCIP_INVALIDDATA;
7350  }
7351 
7352  SCIP_CALL( SCIPsepaCreate(&sepaptr, scip->set, scip->messagehdlr, scip->mem->setmem,
7353  name, desc, priority, freq, maxbounddist, usessubscip, delay,
7354  NULL, NULL, NULL, NULL, NULL, NULL, sepaexeclp, sepaexecsol, sepadata) );
7355 
7356  assert(sepaptr != NULL);
7357 
7358  SCIP_CALL( SCIPsetIncludeSepa(scip->set, sepaptr) );
7359 
7360  if( sepa != NULL)
7361  *sepa = sepaptr;
7362 
7363  return SCIP_OKAY;
7364 }
7365 
7366 /** sets copy method of separator */
7368  SCIP* scip, /**< SCIP data structure */
7369  SCIP_SEPA* sepa, /**< separator */
7370  SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */
7371  )
7372 {
7373  SCIP_CALL( checkStage(scip, "SCIPsetSepaCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7374 
7375  assert(sepa != NULL);
7376 
7377  SCIPsepaSetCopy(sepa, sepacopy);
7378 
7379  return SCIP_OKAY;
7380 }
7381 
7382 /** sets destructor method of separator */
7384  SCIP* scip, /**< SCIP data structure */
7385  SCIP_SEPA* sepa, /**< separator */
7386  SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */
7387  )
7388 {
7389  SCIP_CALL( checkStage(scip, "SCIPsetSepaFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7390 
7391  assert(sepa != NULL);
7392 
7393  SCIPsepaSetFree(sepa, sepafree);
7394 
7395  return SCIP_OKAY;
7396 }
7397 
7398 /** sets initialization method of separator */
7400  SCIP* scip, /**< SCIP data structure */
7401  SCIP_SEPA* sepa, /**< separator */
7402  SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */
7403  )
7404 {
7405  SCIP_CALL( checkStage(scip, "SCIPsetSepaInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7406 
7407  assert(sepa != NULL);
7408 
7409  SCIPsepaSetInit(sepa, sepainit);
7410 
7411  return SCIP_OKAY;
7412 }
7413 
7414 /** sets deinitialization method of separator */
7416  SCIP* scip, /**< SCIP data structure */
7417  SCIP_SEPA* sepa, /**< separator */
7418  SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */
7419  )
7420 {
7421  SCIP_CALL( checkStage(scip, "SCIPsetSepaExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7422 
7423  assert(sepa != NULL);
7424 
7425  SCIPsepaSetExit(sepa, sepaexit);
7426 
7427  return SCIP_OKAY;
7428 }
7429 
7430 /** sets solving process initialization method of separator */
7432  SCIP* scip, /**< SCIP data structure */
7433  SCIP_SEPA* sepa, /**< separator */
7434  SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */
7435  )
7436 {
7437  SCIP_CALL( checkStage(scip, "SCIPsetSepaInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7438 
7439  assert(sepa != NULL);
7440 
7441  SCIPsepaSetInitsol(sepa, sepainitsol);
7442 
7443  return SCIP_OKAY;
7444 }
7445 
7446 /** sets solving process deinitialization method of separator */
7448  SCIP* scip, /**< SCIP data structure */
7449  SCIP_SEPA* sepa, /**< separator */
7450  SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */
7451  )
7452 {
7453  SCIP_CALL( checkStage(scip, "SCIPsetSepaExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7454 
7455  assert(sepa != NULL);
7456 
7457  SCIPsepaSetExitsol(sepa, sepaexitsol);
7458 
7459  return SCIP_OKAY;
7460 }
7461 
7462 /** returns the separator of the given name, or NULL if not existing */
7464  SCIP* scip, /**< SCIP data structure */
7465  const char* name /**< name of separator */
7466  )
7467 {
7468  assert(scip != NULL);
7469  assert(scip->set != NULL);
7470  assert(name != NULL);
7471 
7472  return SCIPsetFindSepa(scip->set, name);
7473 }
7474 
7475 /** returns the array of currently available separators */
7477  SCIP* scip /**< SCIP data structure */
7478  )
7479 {
7480  assert(scip != NULL);
7481  assert(scip->set != NULL);
7482 
7483  SCIPsetSortSepas(scip->set);
7484 
7485  return scip->set->sepas;
7486 }
7487 
7488 /** returns the number of currently available separators */
7490  SCIP* scip /**< SCIP data structure */
7491  )
7492 {
7493  assert(scip != NULL);
7494  assert(scip->set != NULL);
7495 
7496  return scip->set->nsepas;
7497 }
7498 
7499 /** sets the priority of a separator */
7501  SCIP* scip, /**< SCIP data structure */
7502  SCIP_SEPA* sepa, /**< separator */
7503  int priority /**< new priority of the separator */
7504  )
7505 {
7506  assert(scip != NULL);
7507  assert(scip->set != NULL);
7508 
7509  SCIPsepaSetPriority(sepa, scip->set, priority);
7510 
7511  return SCIP_OKAY;
7512 }
7513 
7514 /** creates a propagator and includes it in SCIP.
7515  *
7516  * @note method has all propagator callbacks as arguments and is thus changed every time a new
7517  * callback is added in future releases; consider using SCIPincludePropBasic() and setter functions
7518  * if you seek for a method which is less likely to change in future releases
7519  */
7521  SCIP* scip, /**< SCIP data structure */
7522  const char* name, /**< name of propagator */
7523  const char* desc, /**< description of propagator */
7524  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7525  int freq, /**< frequency for calling propagator */
7526  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
7527  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */
7528  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7529  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
7530  SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */
7531  SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
7532  SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */
7533  SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */
7534  SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */
7535  SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */
7536  SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */
7537  SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */
7538  SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */
7539  SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */
7540  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
7541  SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */
7542  SCIP_PROPDATA* propdata /**< propagator data */
7543  )
7544 {
7545  SCIP_PROP* prop;
7546 
7547  SCIP_CALL( checkStage(scip, "SCIPincludeProp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7548 
7549  /* check whether propagator is already present */
7550  if( SCIPfindProp(scip, name) != NULL )
7551  {
7552  SCIPerrorMessage("propagator <%s> already included.\n", name);
7553  return SCIP_INVALIDDATA;
7554  }
7555 
7556  SCIP_CALL( SCIPpropCreate(&prop, scip->set, scip->messagehdlr, scip->mem->setmem,
7557  name, desc, priority, freq, delay, timingmask, presolpriority, presolmaxrounds, presoltiming,
7558  propcopy,
7559  propfree, propinit, propexit, propinitpre, propexitpre, propinitsol, propexitsol,
7560  proppresol, propexec, propresprop, propdata) );
7561  SCIP_CALL( SCIPsetIncludeProp(scip->set, prop) );
7562 
7563  return SCIP_OKAY;
7564 }
7565 
7566 /** creates a propagator and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
7567  * Optional callbacks can be set via specific setter functions, see SCIPsetPropInit(), SCIPsetPropExit(),
7568  * SCIPsetPropCopy(), SCIPsetPropFree(), SCIPsetPropInitsol(), SCIPsetPropExitsol(),
7569  * SCIPsetPropInitpre(), SCIPsetPropExitpre(), SCIPsetPropPresol(), and SCIPsetPropResprop().
7570  *
7571 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeProp() instead
7572  */
7574  SCIP* scip, /**< SCIP data structure */
7575  SCIP_PROP** propptr, /**< reference to a propagator pointer, or NULL */
7576  const char* name, /**< name of propagator */
7577  const char* desc, /**< description of propagator */
7578  int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7579  int freq, /**< frequency for calling propagator */
7580  SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */
7581  SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagators should be executed */
7582  SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */
7583  SCIP_PROPDATA* propdata /**< propagator data */
7584  )
7585 {
7586  SCIP_PROP* prop;
7587 
7588  SCIP_CALL( checkStage(scip, "SCIPincludePropBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7589 
7590  /* check whether propagator is already present */
7591  if( SCIPfindProp(scip, name) != NULL )
7592  {
7593  SCIPerrorMessage("propagator <%s> already included.\n", name);
7594  return SCIP_INVALIDDATA;
7595  }
7596 
7597  SCIP_CALL( SCIPpropCreate(&prop, scip->set, scip->messagehdlr, scip->mem->setmem,
7598  name, desc, priority, freq, delay, timingmask, 0, -1, SCIP_PRESOLTIMING_ALWAYS,
7599  NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
7600  NULL, propexec, NULL, propdata) );
7601  SCIP_CALL( SCIPsetIncludeProp(scip->set, prop) );
7602 
7603  if( propptr != NULL )
7604  *propptr = prop;
7605 
7606  return SCIP_OKAY;
7607 }
7608 
7609 /** sets copy method of propagator */
7611  SCIP* scip, /**< SCIP data structure */
7612  SCIP_PROP* prop, /**< propagator */
7613  SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */
7614  )
7615 {
7616  SCIP_CALL( checkStage(scip, "SCIPsetPropCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7617 
7618  assert(prop != NULL);
7619 
7620  SCIPpropSetCopy(prop, propcopy);
7621 
7622  return SCIP_OKAY;
7623 }
7624 
7625 /** sets destructor method of propagator */
7627  SCIP* scip, /**< SCIP data structure */
7628  SCIP_PROP* prop, /**< propagator */
7629  SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */
7630  )
7631 {
7632  SCIP_CALL( checkStage(scip, "SCIPsetPropFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7633 
7634  assert(prop != NULL);
7635 
7636  SCIPpropSetFree(prop, propfree);
7637 
7638  return SCIP_OKAY;
7639 }
7640 
7641 /** sets initialization method of propagator */
7643  SCIP* scip, /**< SCIP data structure */
7644  SCIP_PROP* prop, /**< propagator */
7645  SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */
7646  )
7647 {
7648  SCIP_CALL( checkStage(scip, "SCIPsetPropInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7649 
7650  assert(prop != NULL);
7651 
7652  SCIPpropSetInit(prop, propinit);
7653 
7654  return SCIP_OKAY;
7655 }
7656 
7657 /** sets deinitialization method of propagator */
7659  SCIP* scip, /**< SCIP data structure */
7660  SCIP_PROP* prop, /**< propagator */
7661  SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */
7662  )
7663 {
7664  SCIP_CALL( checkStage(scip, "SCIPsetPropExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7665 
7666  assert(prop != NULL);
7667 
7668  SCIPpropSetExit(prop, propexit);
7669 
7670  return SCIP_OKAY;
7671 }
7672 
7673 /** sets solving process initialization method of propagator */
7675  SCIP* scip, /**< SCIP data structure */
7676  SCIP_PROP* prop, /**< propagator */
7677  SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */
7678  )
7679 {
7680  SCIP_CALL( checkStage(scip, "SCIPsetPropInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7681 
7682  assert(prop != NULL);
7683 
7684  SCIPpropSetInitsol(prop, propinitsol);
7685 
7686  return SCIP_OKAY;
7687 }
7688 
7689 /** sets solving process deinitialization method of propagator */
7691  SCIP* scip, /**< SCIP data structure */
7692  SCIP_PROP* prop, /**< propagator */
7693  SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */
7694  )
7695 {
7696  SCIP_CALL( checkStage(scip, "SCIPsetPropExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7697 
7698  assert(prop != NULL);
7699 
7700  SCIPpropSetExitsol(prop, propexitsol);
7701 
7702  return SCIP_OKAY;
7703 }
7704 
7705 /** sets preprocessing initialization method of propagator */
7707  SCIP* scip, /**< SCIP data structure */
7708  SCIP_PROP* prop, /**< propagator */
7709  SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */
7710  )
7711 {
7712  SCIP_CALL( checkStage(scip, "SCIPsetPropInitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7713 
7714  assert(prop != NULL);
7715 
7716  SCIPpropSetInitpre(prop, propinitpre);
7717 
7718  return SCIP_OKAY;
7719 }
7720 
7721 /** sets preprocessing deinitialization method of propagator */
7723  SCIP* scip, /**< SCIP data structure */
7724  SCIP_PROP* prop, /**< propagator */
7725  SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */
7726  )
7727 {
7728  SCIP_CALL( checkStage(scip, "SCIPsetPropExitpre", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7729 
7730  assert(prop != NULL);
7731 
7732  SCIPpropSetExitpre(prop, propexitpre);
7733 
7734  return SCIP_OKAY;
7735 }
7736 
7737 /** sets presolving method of propagator */
7739  SCIP* scip, /**< SCIP data structure */
7740  SCIP_PROP* prop, /**< propagator */
7741  SCIP_DECL_PROPPRESOL((*proppresol)), /**< presolving method of propagator */
7742  int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */
7743  int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */
7744  SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */
7745  )
7746 {
7747  const char* name;
7748  char paramname[SCIP_MAXSTRLEN];
7749 
7750  assert(scip != NULL);
7751  SCIP_CALL( checkStage(scip, "SCIPsetPropPresol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7752 
7753  assert(prop != NULL);
7754  SCIP_CALL( SCIPpropSetPresol(prop, proppresol, presolpriority, presolmaxrounds, presoltiming) );
7755 
7756  name = SCIPpropGetName(prop);
7757 
7758  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/maxprerounds", name);
7759  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, presolmaxrounds) );
7760 
7761  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presolpriority", name);
7762  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, presolpriority) );
7763 
7764  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "propagating/%s/presoltiming", name);
7765  SCIP_CALL( SCIPsetSetDefaultIntParam(scip->set, paramname, (int) presoltiming) );
7766 
7767  return SCIP_OKAY;
7768 }
7769 
7770 /** sets propagation conflict resolving callback of propagator */
7772  SCIP* scip, /**< SCIP data structure */
7773  SCIP_PROP* prop, /**< propagator */
7774  SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */
7775  )
7776 {
7777  SCIP_CALL( checkStage(scip, "SCIPsetPropResprop", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7778 
7779  assert(prop != NULL);
7780 
7781  SCIPpropSetResprop(prop, propresprop);
7782 
7783  return SCIP_OKAY;
7784 }
7785 
7786 
7787 /** returns the propagator of the given name, or NULL if not existing */
7789  SCIP* scip, /**< SCIP data structure */
7790  const char* name /**< name of propagator */
7791  )
7792 {
7793  assert(scip != NULL);
7794  assert(scip->set != NULL);
7795  assert(name != NULL);
7796 
7797  return SCIPsetFindProp(scip->set, name);
7798 }
7799 
7800 /** returns the array of currently available propagators */
7802  SCIP* scip /**< SCIP data structure */
7803  )
7804 {
7805  assert(scip != NULL);
7806  assert(scip->set != NULL);
7807 
7808  SCIPsetSortProps(scip->set);
7809 
7810  return scip->set->props;
7811 }
7812 
7813 /** returns the number of currently available propagators */
7815  SCIP* scip /**< SCIP data structure */
7816  )
7817 {
7818  assert(scip != NULL);
7819  assert(scip->set != NULL);
7820 
7821  return scip->set->nprops;
7822 }
7823 
7824 /** sets the priority of a propagator */
7826  SCIP* scip, /**< SCIP data structure */
7827  SCIP_PROP* prop, /**< propagator */
7828  int priority /**< new priority of the propagator */
7829  )
7830 {
7831  assert(scip != NULL);
7832  assert(scip->set != NULL);
7833 
7834  SCIPpropSetPriority(prop, scip->set, priority);
7835 
7836  return SCIP_OKAY;
7837 }
7838 
7839 /** sets the presolving priority of a propagator */
7841  SCIP* scip, /**< SCIP data structure */
7842  SCIP_PROP* prop, /**< propagator */
7843  int presolpriority /**< new presol priority of the propagator */
7844  )
7845 {
7846  assert(scip != NULL);
7847  assert(scip->set != NULL);
7848 
7849  SCIPpropSetPresolPriority(prop, scip->set, presolpriority);
7850 
7851  return SCIP_OKAY;
7852 }
7853 
7854 /** creates a concurrent solver type and includes it in SCIP.
7855  *
7856  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
7857  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
7858  *
7859  * @pre This method can be called if @p scip is in one of the following stages:
7860  * - \ref SCIP_STAGE_INIT
7861  * - \ref SCIP_STAGE_PROBLEM
7862  */
7864  SCIP* scip, /**< SCIP data structure */
7865  const char* name, /**< name of concurrent_solver */
7866  SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
7867  SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)), /**< data copy method of concurrent solver */
7868  SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)), /**< data copy method of concurrent solver */
7869  SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)), /**< initialize random seeds of concurrent solver */
7870  SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)), /**< execution method of concurrent solver */
7871  SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
7872  SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)), /**< terminate solving in concurrent solver */
7873  SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)), /**< synchronization method of concurrent solver */
7874  SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)), /**< synchronization method of concurrent solver */
7875  SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
7876  SCIP_CONCSOLVERTYPEDATA* data /**< the concurent solver type's data */
7877  )
7878 {
7879  SCIP_CONCSOLVERTYPE* concsolvertype;
7880 
7881  SCIP_CALL( checkStage(scip, "SCIPincludeConcsolverType", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7882 
7883  /* check whether concurrent solver type is already present */
7884  if( SCIPfindConcsolverType(scip, name) != NULL )
7885  {
7886  SCIPerrorMessage("concurrent solver type <%s> already included.\n", name);
7887  return SCIP_INVALIDDATA;
7888  }
7889 
7890  SCIP_CALL( SCIPconcsolverTypeCreate(&concsolvertype, scip->set, scip->messagehdlr, scip->mem->setmem,
7891  name, prefpriodefault, concsolvercreateinst, concsolverdestroyinst,
7892  concsolverinitseeds, concsolverexec, concsolvercopysolvdata,
7893  concsolverstop, concsolversyncwrite, concsolversyncread,
7894  concsolvertypefreedata, data) );
7895 
7896  SCIP_CALL( SCIPsetIncludeConcsolverType(scip->set, concsolvertype) );
7897 
7898  return SCIP_OKAY;
7899 }
7900 
7901 /** returns the concurrent solver type with the given name, or NULL if not existing */
7903  SCIP* scip, /**< SCIP data structure */
7904  const char* name /**< name of concurrent_solver */
7905  )
7906 {
7907  assert(scip != NULL);
7908  assert(scip->set != NULL);
7909  assert(name != NULL);
7910 
7911  return SCIPsetFindConcsolverType(scip->set, name);
7912 }
7913 
7914 /** returns the array of included concurrent solver types */
7916  SCIP* scip /**< SCIP data structure */
7917  )
7918 {
7919  assert(scip != NULL);
7920  assert(scip->set != NULL);
7921 
7922  return scip->set->concsolvertypes;
7923 }
7924 
7925 /** returns the number of included concurrent solver types */
7927  SCIP* scip /**< SCIP data structure */
7928  )
7929 {
7930  assert(scip != NULL);
7931  assert(scip->set != NULL);
7932 
7933  return scip->set->nconcsolvertypes;
7934 }
7935 
7936 /** creates a primal heuristic and includes it in SCIP.
7937  *
7938  * @note method has all heuristic callbacks as arguments and is thus changed every time a new
7939  * callback is added in future releases; consider using SCIPincludeHeurBasic() and setter functions
7940  * if you seek for a method which is less likely to change in future releases
7941  *
7942  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
7943  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
7944  *
7945  * @pre This method can be called if @p scip is in one of the following stages:
7946  * - \ref SCIP_STAGE_INIT
7947  * - \ref SCIP_STAGE_PROBLEM
7948  */
7950  SCIP* scip, /**< SCIP data structure */
7951  const char* name, /**< name of primal heuristic */
7952  const char* desc, /**< description of primal heuristic */
7953  char dispchar, /**< display character of primal heuristic */
7954  int priority, /**< priority of the primal heuristic */
7955  int freq, /**< frequency for calling primal heuristic */
7956  int freqofs, /**< frequency offset for calling primal heuristic */
7957  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
7958  SCIP_HEURTIMING timingmask, /**< positions in the node solving loop where heuristic should be executed;
7959  * see definition of SCIP_HEURTIMING for possible values */
7960  SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
7961  SCIP_DECL_HEURCOPY ((*heurcopy)), /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
7962  SCIP_DECL_HEURFREE ((*heurfree)), /**< destructor of primal heuristic */
7963  SCIP_DECL_HEURINIT ((*heurinit)), /**< initialize primal heuristic */
7964  SCIP_DECL_HEUREXIT ((*heurexit)), /**< deinitialize primal heuristic */
7965  SCIP_DECL_HEURINITSOL ((*heurinitsol)), /**< solving process initialization method of primal heuristic */
7966  SCIP_DECL_HEUREXITSOL ((*heurexitsol)), /**< solving process deinitialization method of primal heuristic */
7967  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
7968  SCIP_HEURDATA* heurdata /**< primal heuristic data */
7969  )
7970 {
7971  SCIP_HEUR* heur;
7972 
7973  SCIP_CALL( checkStage(scip, "SCIPincludeHeur", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
7974 
7975  /* check whether heuristic is already present */
7976  if( SCIPfindHeur(scip, name) != NULL )
7977  {
7978  SCIPerrorMessage("heuristic <%s> already included.\n", name);
7979  return SCIP_INVALIDDATA;
7980  }
7981 
7982  SCIP_CALL( SCIPheurCreate(&heur, scip->set, scip->messagehdlr, scip->mem->setmem,
7983  name, desc, dispchar, priority, freq, freqofs, maxdepth, timingmask, usessubscip,
7984  heurcopy, heurfree, heurinit, heurexit, heurinitsol, heurexitsol, heurexec, heurdata) );
7985 
7986  SCIP_CALL( SCIPsetIncludeHeur(scip->set, heur) );
7987 
7988  return SCIP_OKAY;
7989 }
7990 
7991 /** creates a primal heuristic and includes it in SCIP with its most fundamental callbacks.
7992  * All non-fundamental (or optional) callbacks
7993  * as, e. g., init and exit callbacks, will be set to NULL.
7994  * Optional callbacks can be set via specific setter functions, see SCIPsetHeurCopy(), SCIPsetHeurFree(),
7995  * SCIPsetHeurInit(), SCIPsetHeurExit(), SCIPsetHeurInitsol(), and SCIPsetHeurExitsol()
7996  *
7997 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeHeur() instead
7998  */
8000  SCIP* scip, /**< SCIP data structure */
8001  SCIP_HEUR** heur, /**< pointer to primal heuristic */
8002  const char* name, /**< name of primal heuristic */
8003  const char* desc, /**< description of primal heuristic */
8004  char dispchar, /**< display character of primal heuristic */
8005  int priority, /**< priority of the primal heuristic */
8006  int freq, /**< frequency for calling primal heuristic */
8007  int freqofs, /**< frequency offset for calling primal heuristic */
8008  int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
8009  SCIP_HEURTIMING timingmask, /**< positions in the node solving loop where heuristic should be executed;
8010  * see definition of SCIP_HEURTIMING for possible values */
8011  SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
8012  SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
8013  SCIP_HEURDATA* heurdata /**< primal heuristic data */
8014  )
8015 {
8016  SCIP_HEUR* heurptr;
8017 
8018  SCIP_CALL( checkStage(scip, "SCIPincludeHeurBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8019 
8020  /* check whether heuristic is already present */
8021  if( SCIPfindHeur(scip, name) != NULL )
8022  {
8023  SCIPerrorMessage("heuristic <%s> already included.\n", name);
8024  return SCIP_INVALIDDATA;
8025  }
8026 
8027  SCIP_CALL( SCIPheurCreate(&heurptr, scip->set, scip->messagehdlr, scip->mem->setmem,
8028  name, desc, dispchar, priority, freq, freqofs, maxdepth, timingmask, usessubscip,
8029  NULL, NULL, NULL, NULL, NULL, NULL, heurexec, heurdata) );
8030 
8031  assert(heurptr != NULL);
8032 
8033  SCIP_CALL( SCIPsetIncludeHeur(scip->set, heurptr) );
8034 
8035  if( heur != NULL )
8036  *heur = heurptr;
8037 
8038  return SCIP_OKAY;
8039 }
8040 
8041 /* new callback/method setter methods */
8042 
8043 /** sets copy method of primal heuristic */
8045  SCIP* scip, /**< SCIP data structure */
8046  SCIP_HEUR* heur, /**< primal heuristic */
8047  SCIP_DECL_HEURCOPY ((*heurcopy)) /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
8048  )
8049 {
8050  SCIP_CALL( checkStage(scip, "SCIPsetHeurCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8051 
8052  assert(heur != NULL);
8053 
8054  SCIPheurSetCopy(heur, heurcopy);
8055 
8056  return SCIP_OKAY;
8057 }
8058 
8059 /** sets destructor method of primal heuristic */
8061  SCIP* scip, /**< SCIP data structure */
8062  SCIP_HEUR* heur, /**< primal heuristic */
8063  SCIP_DECL_HEURFREE ((*heurfree)) /**< destructor of primal heuristic */
8064  )
8065 {
8066  SCIP_CALL( checkStage(scip, "SCIPsetHeurFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8067 
8068  assert(heur != NULL);
8069 
8070  SCIPheurSetFree(heur, heurfree);
8071 
8072  return SCIP_OKAY;
8073 }
8074 
8075 /** sets initialization method of primal heuristic */
8077  SCIP* scip, /**< SCIP data structure */
8078  SCIP_HEUR* heur, /**< primal heuristic */
8079  SCIP_DECL_HEURINIT ((*heurinit)) /**< initialize primal heuristic */
8080  )
8081 {
8082  SCIP_CALL( checkStage(scip, "SCIPsetHeurInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8083 
8084  assert(heur != NULL);
8085 
8086  SCIPheurSetInit(heur, heurinit);
8087 
8088  return SCIP_OKAY;
8089 }
8090 
8091 /** sets deinitialization method of primal heuristic */
8093  SCIP* scip, /**< SCIP data structure */
8094  SCIP_HEUR* heur, /**< primal heuristic */
8095  SCIP_DECL_HEUREXIT ((*heurexit)) /**< deinitialize primal heuristic */
8096  )
8097 {
8098  SCIP_CALL( checkStage(scip, "SCIPsetHeurExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8099 
8100  assert(heur != NULL);
8101 
8102  SCIPheurSetExit(heur, heurexit);
8103 
8104  return SCIP_OKAY;
8105 }
8106 
8107 /** sets solving process initialization method of primal heuristic */
8109  SCIP* scip, /**< SCIP data structure */
8110  SCIP_HEUR* heur, /**< primal heuristic */
8111  SCIP_DECL_HEURINITSOL ((*heurinitsol)) /**< solving process initialization method of primal heuristic */
8112  )
8113 {
8114  SCIP_CALL( checkStage(scip, "SCIPsetHeurInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8115 
8116  assert(heur != NULL);
8117 
8118  SCIPheurSetInitsol(heur, heurinitsol);
8119 
8120  return SCIP_OKAY;
8121 }
8122 
8123 /** sets solving process deinitialization method of primal heuristic */
8125  SCIP* scip, /**< SCIP data structure */
8126  SCIP_HEUR* heur, /**< primal heuristic */
8127  SCIP_DECL_HEUREXITSOL ((*heurexitsol)) /**< solving process deinitialization method of primal heuristic */
8128  )
8129 {
8130  SCIP_CALL( checkStage(scip, "SCIPsetHeurExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8131 
8132  assert(heur != NULL);
8133 
8134  SCIPheurSetExitsol(heur, heurexitsol);
8135 
8136  return SCIP_OKAY;
8137 }
8138 
8139 /** returns the primal heuristic of the given name, or NULL if not existing */
8141  SCIP* scip, /**< SCIP data structure */
8142  const char* name /**< name of primal heuristic */
8143  )
8144 {
8145  assert(scip != NULL);
8146  assert(scip->set != NULL);
8147  assert(name != NULL);
8148 
8149  return SCIPsetFindHeur(scip->set, name);
8150 }
8151 
8152 /** returns the array of currently available primal heuristics */
8154  SCIP* scip /**< SCIP data structure */
8155  )
8156 {
8157  assert(scip != NULL);
8158  assert(scip->set != NULL);
8159 
8160  SCIPsetSortHeurs(scip->set);
8161 
8162  return scip->set->heurs;
8163 }
8164 
8165 /** returns the number of currently available primal heuristics */
8167  SCIP* scip /**< SCIP data structure */
8168  )
8169 {
8170  assert(scip != NULL);
8171  assert(scip->set != NULL);
8172 
8173  return scip->set->nheurs;
8174 }
8175 
8176 /** sets the priority of a primal heuristic */
8178  SCIP* scip, /**< SCIP data structure */
8179  SCIP_HEUR* heur, /**< primal heuristic */
8180  int priority /**< new priority of the primal heuristic */
8181  )
8182 {
8183  assert(scip != NULL);
8184  assert(scip->set != NULL);
8185 
8186  SCIPheurSetPriority(heur, scip->set, priority);
8187 
8188  return SCIP_OKAY;
8189 }
8190 
8191 /** creates a tree compression and includes it in SCIP.
8192  *
8193  * @note method has all compression callbacks as arguments and is thus changed every time a new
8194  * callback is added in future releases; consider using SCIPincludeComprBasic() and setter functions
8195  * if you seek for a method which is less likely to change in future releases
8196  */
8198  SCIP* scip, /**< SCIP data structure */
8199  const char* name, /**< name of tree compression */
8200  const char* desc, /**< description of tree compression */
8201  int priority, /**< priority of the tree compression */
8202  int minnnodes, /**< minimal number of nodes to call compression */
8203  SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
8204  SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */
8205  SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */
8206  SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */
8207  SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */
8208  SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */
8209  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
8210  SCIP_COMPRDATA* comprdata /**< tree compression data */
8211  )
8212 {
8213  SCIP_COMPR* compr;
8214 
8215  SCIP_CALL( checkStage(scip, "SCIPincludeCompr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8216 
8217  /* check whether compression is already present */
8218  if( SCIPfindCompr(scip, name) != NULL )
8219  {
8220  SCIPerrorMessage("compression <%s> already included.\n", name);
8221  return SCIP_INVALIDDATA;
8222  }
8223 
8224  SCIP_CALL( SCIPcomprCreate(&compr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, minnnodes,
8225  comprcopy, comprfree, comprinit, comprexit, comprinitsol, comprexitsol, comprexec, comprdata) );
8226 
8227  SCIP_CALL( SCIPsetIncludeCompr(scip->set, compr) );
8228 
8229  return SCIP_OKAY;
8230 }
8231 
8232 /** creates a tree compression and includes it in SCIP with its most fundamental callbacks.
8233  * All non-fundamental (or optional) callbacks
8234  * as, e. g., init and exit callbacks, will be set to NULL.
8235  * Optional callbacks can be set via specific setter functions, see SCIPsetComprCopy(), SCIPsetComprFree(),
8236  * SCIPsetComprInit(), SCIPsetComprExit(), SCIPsetComprInitsol(), and SCIPsetComprExitsol()
8237  *
8238  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeCompr() instead
8239  */
8241  SCIP* scip, /**< SCIP data structure */
8242  SCIP_COMPR** compr, /**< pointer to tree compression */
8243  const char* name, /**< name of tree compression */
8244  const char* desc, /**< description of tree compression */
8245  int priority, /**< priority of the tree compression */
8246  int minnnodes, /**< minimal number of nodes to call the compression */
8247  SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */
8248  SCIP_COMPRDATA* comprdata /**< tree compression data */
8249  )
8250 {
8251  SCIP_COMPR* comprptr;
8252 
8253  SCIP_CALL( checkStage(scip, "SCIPincludeComprBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8254 
8255  /* check whether heuristic is already present */
8256  if( SCIPfindCompr(scip, name) != NULL )
8257  {
8258  SCIPerrorMessage("tree compression <%s> already included.\n", name);
8259  return SCIP_INVALIDDATA;
8260  }
8261 
8262  SCIP_CALL( SCIPcomprCreate(&comprptr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority,
8263  minnnodes, NULL, NULL, NULL, NULL, NULL, NULL, comprexec, comprdata) );
8264 
8265  assert(comprptr != NULL);
8266 
8267  SCIP_CALL( SCIPsetIncludeCompr(scip->set, comprptr) );
8268 
8269  if( compr != NULL )
8270  *compr = comprptr;
8271 
8272  return SCIP_OKAY;
8273 }
8274 
8275 /* new callback/method setter methods */
8276 
8277 /** sets copy method of tree compression */
8279  SCIP* scip, /**< SCIP data structure */
8280  SCIP_COMPR* compr, /**< tree compression */
8281  SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */
8282  )
8283 {
8284  SCIP_CALL( checkStage(scip, "SCIPsetComprCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8285 
8286  assert(compr != NULL);
8287 
8288  SCIPcomprSetCopy(compr, comprcopy);
8289 
8290  return SCIP_OKAY;
8291 }
8292 
8293 /** sets destructor method of tree compression */
8295  SCIP* scip, /**< SCIP data structure */
8296  SCIP_COMPR* compr, /**< tree compression */
8297  SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */
8298  )
8299 {
8300  SCIP_CALL( checkStage(scip, "SCIPsetComprFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8301 
8302  assert(compr != NULL);
8303 
8304  SCIPcomprSetFree(compr, comprfree);
8305 
8306  return SCIP_OKAY;
8307 }
8308 
8309 /** sets initialization method of tree compression */
8311  SCIP* scip, /**< SCIP data structure */
8312  SCIP_COMPR* compr, /**< tree compression */
8313  SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */
8314  )
8315 {
8316  SCIP_CALL( checkStage(scip, "SCIPsetComprInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8317 
8318  assert(compr != NULL);
8319 
8320  SCIPcomprSetInit(compr, comprinit);
8321 
8322  return SCIP_OKAY;
8323 }
8324 
8325 /** sets deinitialization method of tree compression */
8327  SCIP* scip, /**< SCIP data structure */
8328  SCIP_COMPR* compr, /**< tree compression */
8329  SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */
8330  )
8331 {
8332  SCIP_CALL( checkStage(scip, "SCIPsetComprExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8333 
8334  assert(compr != NULL);
8335 
8336  SCIPcomprSetExit(compr, comprexit);
8337 
8338  return SCIP_OKAY;
8339 }
8340 
8341 /** sets solving process initialization method of tree compression */
8343  SCIP* scip, /**< SCIP data structure */
8344  SCIP_COMPR* compr, /**< tree compression */
8345  SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization method of tree compression */
8346  )
8347 {
8348  SCIP_CALL( checkStage(scip, "SCIPsetComprInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8349 
8350  assert(compr != NULL);
8351 
8352  SCIPcomprSetInitsol(compr, comprinitsol);
8353 
8354  return SCIP_OKAY;
8355 }
8356 
8357 /** sets solving process deinitialization method of tree compression */
8359  SCIP* scip, /**< SCIP data structure */
8360  SCIP_COMPR* compr, /**< tree compression */
8361  SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization method of tree compression */
8362  )
8363 {
8364  SCIP_CALL( checkStage(scip, "SCIPsetComprExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8365 
8366  assert(compr != NULL);
8367 
8368  SCIPcomprSetExitsol(compr, comprexitsol);
8369 
8370  return SCIP_OKAY;
8371 }
8372 
8373 /** returns the tree compression of the given name, or NULL if not existing */
8375  SCIP* scip, /**< SCIP data structure */
8376  const char* name /**< name of tree compression */
8377  )
8378 {
8379  assert(scip != NULL);
8380  assert(scip->set != NULL);
8381  assert(name != NULL);
8382 
8383  return SCIPsetFindCompr(scip->set, name);
8384 }
8385 
8386 /** returns the array of currently available tree compression */
8388  SCIP* scip /**< SCIP data structure */
8389  )
8390 {
8391  assert(scip != NULL);
8392  assert(scip->set != NULL);
8393 
8394  SCIPsetSortComprs(scip->set);
8395 
8396  return scip->set->comprs;
8397 }
8398 
8399 /** returns the number of currently available tree compression */
8401  SCIP* scip /**< SCIP data structure */
8402  )
8403 {
8404  assert(scip != NULL);
8405  assert(scip->set != NULL);
8406 
8407  return scip->set->ncomprs;
8408 }
8409 
8410 /** set the priority of a tree compression method */
8412  SCIP* scip, /**< SCIP data structure */
8413  SCIP_COMPR* compr, /**< compression */
8414  int priority /**< new priority of the tree compression */
8415  )
8416 {
8417  assert(scip != NULL);
8418  assert(scip->set != NULL);
8419 
8420  SCIPcomprSetPriority(compr, scip->set, priority);
8421 
8422  return SCIP_OKAY;
8423 }
8424 
8425 /** create a diving set associated with a primal heuristic. The primal heuristic needs to be included
8426  * before this method can be called. The diveset is installed in the array of divesets of the heuristic
8427  * and can be retrieved later by accessing SCIPheurGetDivesets()
8428  *
8429  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
8430  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
8431  *
8432  * @pre This method can be called if @p scip is in one of the following stages:
8433  * - \ref SCIP_STAGE_INIT
8434  * - \ref SCIP_STAGE_PROBLEM
8435  */
8437  SCIP* scip, /**< SCIP data structure */
8438  SCIP_DIVESET** diveset, /**< pointer to created diving heuristic settings, or NULL if not needed */
8439  SCIP_HEUR* heur, /**< primal heuristic to which the diveset belongs */
8440  const char* name, /**< name for the diveset, or NULL if the name of the heuristic should be used */
8441  SCIP_Real minreldepth, /**< minimal relative depth to start diving */
8442  SCIP_Real maxreldepth, /**< maximal relative depth to start diving */
8443  SCIP_Real maxlpiterquot, /**< maximal fraction of diving LP iterations compared to node LP iterations */
8444  SCIP_Real maxdiveubquot, /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
8445  * where diving is performed (0.0: no limit) */
8446  SCIP_Real maxdiveavgquot, /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
8447  * where diving is performed (0.0: no limit) */
8448  SCIP_Real maxdiveubquotnosol, /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */
8449  SCIP_Real maxdiveavgquotnosol,/**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */
8450  SCIP_Real lpresolvedomchgquot,/**< percentage of immediate domain changes during probing to trigger LP resolve */
8451  int lpsolvefreq, /**< LP solve frequency for (0: only if enough domain reductions are found by propagation)*/
8452  int maxlpiterofs, /**< additional number of allowed LP iterations */
8453  unsigned int initialseed, /**< initial seed for random number generation */
8454  SCIP_Bool backtrack, /**< use one level of backtracking if infeasibility is encountered? */
8455  SCIP_Bool onlylpbranchcands, /**< should only LP branching candidates be considered instead of the slower but
8456  * more general constraint handler diving variable selection? */
8457  SCIP_Bool specificsos1score, /**< should SOS1 variables be scored by the diving heuristics specific score function;
8458  * otherwise use the score function of the SOS1 constraint handler */
8459  SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)) /**< method for candidate score and rounding direction */
8460  )
8461 {
8462  SCIP_DIVESET* divesetptr;
8463  SCIP_CALL( checkStage(scip, "SCIPcreateDiveset", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8464 
8465  divesetptr = NULL;
8466  /* create the diveset (this will add diving specific parameters for this heuristic) */
8467  SCIP_CALL( SCIPdivesetCreate(&divesetptr, heur, name, scip->set, scip->messagehdlr, scip->mem->setmem,
8468  minreldepth, maxreldepth, maxlpiterquot, maxdiveubquot, maxdiveavgquot, maxdiveubquotnosol,
8469  maxdiveavgquotnosol, lpresolvedomchgquot, lpsolvefreq, maxlpiterofs, initialseed, backtrack, onlylpbranchcands, specificsos1score, divesetgetscore) );
8470 
8471  assert(divesetptr != NULL);
8472  if( diveset != NULL )
8473  *diveset = divesetptr;
8474 
8475  return SCIP_OKAY;
8476 }
8477 
8478 /** creates an event handler and includes it in SCIP
8479  *
8480  * @note method has all event handler callbacks as arguments and is thus changed every time a new
8481  * callback is added in future releases; consider using SCIPincludeEventhdlrBasic() and setter functions
8482  * if you seek for a method which is less likely to change in future releases
8483  */
8485  SCIP* scip, /**< SCIP data structure */
8486  const char* name, /**< name of event handler */
8487  const char* desc, /**< description of event handler */
8488  SCIP_DECL_EVENTCOPY ((*eventcopy)), /**< copy method of event handler or NULL if you don't want to copy your plugin into sub-SCIPs */
8489  SCIP_DECL_EVENTFREE ((*eventfree)), /**< destructor of event handler */
8490  SCIP_DECL_EVENTINIT ((*eventinit)), /**< initialize event handler */
8491  SCIP_DECL_EVENTEXIT ((*eventexit)), /**< deinitialize event handler */
8492  SCIP_DECL_EVENTINITSOL((*eventinitsol)), /**< solving process initialization method of event handler */
8493  SCIP_DECL_EVENTEXITSOL((*eventexitsol)), /**< solving process deinitialization method of event handler */
8494  SCIP_DECL_EVENTDELETE ((*eventdelete)), /**< free specific event data */
8495  SCIP_DECL_EVENTEXEC ((*eventexec)), /**< execute event handler */
8496  SCIP_EVENTHDLRDATA* eventhdlrdata /**< event handler data */
8497  )
8498 {
8499  SCIP_EVENTHDLR* eventhdlr;
8500 
8501  SCIP_CALL( checkStage(scip, "SCIPincludeEventhdlr", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8502 
8503  /* check whether event handler is already present */
8504  if( SCIPfindEventhdlr(scip, name) != NULL )
8505  {
8506  SCIPerrorMessage("event handler <%s> already included.\n", name);
8507  return SCIP_INVALIDDATA;
8508  }
8509 
8510  SCIP_CALL( SCIPeventhdlrCreate(&eventhdlr, name, desc,
8511  eventcopy,
8512  eventfree, eventinit, eventexit, eventinitsol, eventexitsol, eventdelete, eventexec,
8513  eventhdlrdata) );
8514  SCIP_CALL( SCIPsetIncludeEventhdlr(scip->set, eventhdlr) );
8515 
8516  return SCIP_OKAY;
8517 }
8518 
8519 /** creates an event handler and includes it in SCIP with all its non-fundamental callbacks set
8520  * to NULL; if needed, non-fundamental callbacks can be set afterwards via setter functions
8521  * SCIPsetEventhdlrCopy(), SCIPsetEventhdlrFree(), SCIPsetEventhdlrInit(), SCIPsetEventhdlrExit(),
8522  * SCIPsetEventhdlrInitsol(), SCIPsetEventhdlrExitsol(), and SCIPsetEventhdlrDelete()
8523  *
8524  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeEventhdlr() instead
8525  */
8527  SCIP* scip, /**< SCIP data structure */
8528  SCIP_EVENTHDLR** eventhdlrptr, /**< reference to an event handler, or NULL */
8529  const char* name, /**< name of event handler */
8530  const char* desc, /**< description of event handler */
8531  SCIP_DECL_EVENTEXEC ((*eventexec)), /**< execute event handler */
8532  SCIP_EVENTHDLRDATA* eventhdlrdata /**< event handler data */
8533  )
8534 {
8535  SCIP_EVENTHDLR* eventhdlr;
8536 
8537  SCIP_CALL( checkStage(scip, "SCIPincludeEventhdlrBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8538 
8539  /* check whether event handler is already present */
8540  if( SCIPfindEventhdlr(scip, name) != NULL )
8541  {
8542  SCIPerrorMessage("event handler <%s> already included.\n", name);
8543  return SCIP_INVALIDDATA;
8544  }
8545 
8546  SCIP_CALL( SCIPeventhdlrCreate(&eventhdlr, name, desc,
8547  NULL, NULL, NULL, NULL, NULL, NULL, NULL, eventexec,
8548  eventhdlrdata) );
8549  SCIP_CALL( SCIPsetIncludeEventhdlr(scip->set, eventhdlr) );
8550 
8551  if( eventhdlrptr != NULL )
8552  *eventhdlrptr = eventhdlr;
8553 
8554  return SCIP_OKAY;
8555 }
8556 
8557 /** sets copy callback of the event handler */
8559  SCIP* scip, /**< scip instance */
8560  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8561  SCIP_DECL_EVENTCOPY ((*eventcopy)) /**< copy callback of the event handler */
8562  )
8563 {
8564  assert(scip != NULL);
8565  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8566 
8567  SCIPeventhdlrSetCopy(eventhdlr, eventcopy);
8568  return SCIP_OKAY;
8569 }
8570 
8571 /** sets deinitialization callback of the event handler */
8573  SCIP* scip, /**< scip instance */
8574  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8575  SCIP_DECL_EVENTFREE ((*eventfree)) /**< deinitialization callback of the event handler */
8576  )
8577 {
8578  assert(scip != NULL);
8579  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8580 
8581  SCIPeventhdlrSetFree(eventhdlr, eventfree);
8582  return SCIP_OKAY;
8583 }
8584 
8585 /** sets initialization callback of the event handler */
8587  SCIP* scip, /**< scip instance */
8588  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8589  SCIP_DECL_EVENTINIT ((*eventinit)) /**< initialize event handler */
8590  )
8591 {
8592  assert(scip != NULL);
8593  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8594 
8595  SCIPeventhdlrSetInit(eventhdlr, eventinit);
8596  return SCIP_OKAY;
8597 }
8598 
8599 /** sets deinitialization callback of the event handler */
8601  SCIP* scip, /**< scip instance */
8602  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8603  SCIP_DECL_EVENTEXIT ((*eventexit)) /**< deinitialize event handler */
8604  )
8605 {
8606  assert(scip != NULL);
8607  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8608 
8609  SCIPeventhdlrSetExit(eventhdlr, eventexit);
8610  return SCIP_OKAY;
8611 }
8612 
8613 /** sets solving process initialization callback of the event handler */
8615  SCIP* scip, /**< scip instance */
8616  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8617  SCIP_DECL_EVENTINITSOL((*eventinitsol)) /**< solving process initialization callback of event handler */
8618  )
8619 {
8620  assert(scip != NULL);
8621  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8622 
8623  SCIPeventhdlrSetInitsol(eventhdlr, eventinitsol);
8624  return SCIP_OKAY;
8625 }
8626 
8627 /** sets solving process deinitialization callback of the event handler */
8629  SCIP* scip, /**< scip instance */
8630  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8631  SCIP_DECL_EVENTEXITSOL((*eventexitsol)) /**< solving process deinitialization callback of event handler */
8632  )
8633 {
8634  assert(scip != NULL);
8635  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8636 
8637  SCIPeventhdlrSetExitsol(eventhdlr, eventexitsol);
8638  return SCIP_OKAY;
8639 }
8640 
8641 /** sets callback of the event handler to free specific event data */
8643  SCIP* scip, /**< scip instance */
8644  SCIP_EVENTHDLR* eventhdlr, /**< event handler */
8645  SCIP_DECL_EVENTDELETE ((*eventdelete)) /**< free specific event data */
8646  )
8647 {
8648  assert(scip != NULL);
8649  SCIP_CALL( checkStage(scip, "SCIPsetEventhdlrDelete", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8650 
8651  SCIPeventhdlrSetDelete(eventhdlr, eventdelete);
8652  return SCIP_OKAY;
8653 }
8654 
8655 /** returns the event handler of the given name, or NULL if not existing */
8657  SCIP* scip, /**< SCIP data structure */
8658  const char* name /**< name of event handler */
8659  )
8660 {
8661  assert(scip != NULL);
8662  assert(scip->set != NULL);
8663  assert(name != NULL);
8664 
8665  return SCIPsetFindEventhdlr(scip->set, name);
8666 }
8667 
8668 /** returns the array of currently available event handlers */
8670  SCIP* scip /**< SCIP data structure */
8671  )
8672 {
8673  assert(scip != NULL);
8674  assert(scip->set != NULL);
8675 
8676  return scip->set->eventhdlrs;
8677 }
8678 
8679 /** returns the number of currently available event handlers */
8681  SCIP* scip /**< SCIP data structure */
8682  )
8683 {
8684  assert(scip != NULL);
8685  assert(scip->set != NULL);
8686 
8687  return scip->set->neventhdlrs;
8688 }
8689 
8690 /** creates a node selector and includes it in SCIP.
8691  *
8692  * @note method has all node selector callbacks as arguments and is thus changed every time a new
8693  * callback is added in future releases; consider using SCIPincludeNodeselBasic() and setter functions
8694  * if you seek for a method which is less likely to change in future releases
8695  */
8697  SCIP* scip, /**< SCIP data structure */
8698  const char* name, /**< name of node selector */
8699  const char* desc, /**< description of node selector */
8700  int stdpriority, /**< priority of the node selector in standard mode */
8701  int memsavepriority, /**< priority of the node selector in memory saving mode */
8702  SCIP_DECL_NODESELCOPY ((*nodeselcopy)), /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
8703  SCIP_DECL_NODESELFREE ((*nodeselfree)), /**< destructor of node selector */
8704  SCIP_DECL_NODESELINIT ((*nodeselinit)), /**< initialize node selector */
8705  SCIP_DECL_NODESELEXIT ((*nodeselexit)), /**< deinitialize node selector */
8706  SCIP_DECL_NODESELINITSOL((*nodeselinitsol)),/**< solving process initialization method of node selector */
8707  SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)),/**< solving process deinitialization method of node selector */
8708  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
8709  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
8710  SCIP_NODESELDATA* nodeseldata /**< node selector data */
8711  )
8712 {
8713  SCIP_NODESEL* nodesel;
8714 
8715  SCIP_CALL( checkStage(scip, "SCIPincludeNodesel", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8716 
8717  /* check whether node selector is already present */
8718  if( SCIPfindNodesel(scip, name) != NULL )
8719  {
8720  SCIPerrorMessage("node selector <%s> already included.\n", name);
8721  return SCIP_INVALIDDATA;
8722  }
8723 
8724  SCIP_CALL( SCIPnodeselCreate(&nodesel, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, stdpriority, memsavepriority,
8725  nodeselcopy,
8726  nodeselfree, nodeselinit, nodeselexit, nodeselinitsol, nodeselexitsol,
8727  nodeselselect, nodeselcomp, nodeseldata) );
8728  SCIP_CALL( SCIPsetIncludeNodesel(scip->set, nodesel) );
8729 
8730  return SCIP_OKAY;
8731 }
8732 
8733 /** Creates a node selector and includes it in SCIP with its most fundamental callbacks. All non-fundamental
8734  * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL.
8735  * Optional callbacks can be set via specific setter functions, see SCIPsetNodeselCopy(), SCIPsetNodeselFree(),
8736  * SCIPsetNodeselInit(), SCIPsetNodeselExit(), SCIPsetNodeselInitsol(), and SCIPsetNodeselExitsol()
8737  *
8738  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeNodesel() instead
8739  */
8741  SCIP* scip, /**< SCIP data structure */
8742  SCIP_NODESEL** nodesel, /**< reference to a node selector, or NULL */
8743  const char* name, /**< name of node selector */
8744  const char* desc, /**< description of node selector */
8745  int stdpriority, /**< priority of the node selector in standard mode */
8746  int memsavepriority, /**< priority of the node selector in memory saving mode */
8747  SCIP_DECL_NODESELSELECT((*nodeselselect)),/**< node selection method */
8748  SCIP_DECL_NODESELCOMP ((*nodeselcomp)), /**< node comparison method */
8749  SCIP_NODESELDATA* nodeseldata /**< node selector data */
8750  )
8751 {
8752  SCIP_NODESEL* nodeselptr;
8753 
8754  SCIP_CALL( checkStage(scip, "SCIPincludeNodeselBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8755 
8756  /* check whether node selector is already present */
8757  if( SCIPfindNodesel(scip, name) != NULL )
8758  {
8759  SCIPerrorMessage("node selector <%s> already included.\n", name);
8760  return SCIP_INVALIDDATA;
8761  }
8762 
8763  SCIP_CALL( SCIPnodeselCreate(&nodeselptr, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, stdpriority, memsavepriority,
8764  NULL,
8765  NULL, NULL, NULL, NULL, NULL,
8766  nodeselselect, nodeselcomp, nodeseldata) );
8767  SCIP_CALL( SCIPsetIncludeNodesel(scip->set, nodeselptr) );
8768 
8769  if( nodesel != NULL )
8770  *nodesel = nodeselptr;
8771 
8772  return SCIP_OKAY;
8773 }
8774 
8775 /** sets copy method of node selector */
8777  SCIP* scip, /**< SCIP data structure */
8778  SCIP_NODESEL* nodesel, /**< node selector */
8779  SCIP_DECL_NODESELCOPY ((*nodeselcopy)) /**< copy method of node selector or NULL if you don't want to copy your plugin into sub-SCIPs */
8780  )
8781 {
8782  SCIP_CALL( checkStage(scip, "SCIPsetNodeselCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8783 
8784  assert(nodesel != NULL);
8785 
8786  SCIPnodeselSetCopy(nodesel, nodeselcopy);
8787 
8788  return SCIP_OKAY;
8789 }
8790 
8791 /** sets destructor method of node selector */
8793  SCIP* scip, /**< SCIP data structure */
8794  SCIP_NODESEL* nodesel, /**< node selector */
8795  SCIP_DECL_NODESELFREE ((*nodeselfree)) /**< destructor of node selector */
8796  )
8797 {
8798  SCIP_CALL( checkStage(scip, "SCIPsetNodeselFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8799 
8800  assert(nodesel != NULL);
8801 
8802  SCIPnodeselSetFree(nodesel, nodeselfree);
8803 
8804  return SCIP_OKAY;
8805 }
8806 
8807 /** sets initialization method of node selector */
8809  SCIP* scip, /**< SCIP data structure */
8810  SCIP_NODESEL* nodesel, /**< node selector */
8811  SCIP_DECL_NODESELINIT ((*nodeselinit)) /**< initialize node selector */
8812  )
8813 {
8814  SCIP_CALL( checkStage(scip, "SCIPsetNodeselInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8815 
8816  assert(nodesel != NULL);
8817 
8818  SCIPnodeselSetInit(nodesel, nodeselinit);
8819 
8820  return SCIP_OKAY;
8821 }
8822 
8823 /** sets deinitialization method of node selector */
8825  SCIP* scip, /**< SCIP data structure */
8826  SCIP_NODESEL* nodesel, /**< node selector */
8827  SCIP_DECL_NODESELEXIT ((*nodeselexit)) /**< deinitialize node selector */
8828  )
8829 {
8830  SCIP_CALL( checkStage(scip, "SCIPsetNodeselExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8831 
8832  assert(nodesel != NULL);
8833 
8834  SCIPnodeselSetExit(nodesel, nodeselexit);
8835 
8836  return SCIP_OKAY;
8837 }
8838 
8839 /** sets solving process initialization method of node selector */
8841  SCIP* scip, /**< SCIP data structure */
8842  SCIP_NODESEL* nodesel, /**< node selector */
8843  SCIP_DECL_NODESELINITSOL ((*nodeselinitsol))/**< solving process initialization method of node selector */
8844  )
8845 {
8846  SCIP_CALL( checkStage(scip, "SCIPsetNodeselInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8847 
8848  assert(nodesel != NULL);
8849 
8850  SCIPnodeselSetInitsol(nodesel, nodeselinitsol);
8851 
8852  return SCIP_OKAY;
8853 }
8854 
8855 /** sets solving process deinitialization method of node selector */
8857  SCIP* scip, /**< SCIP data structure */
8858  SCIP_NODESEL* nodesel, /**< node selector */
8859  SCIP_DECL_NODESELEXITSOL ((*nodeselexitsol))/**< solving process deinitialization method of node selector */
8860  )
8861 {
8862  SCIP_CALL( checkStage(scip, "SCIPsetNodeselExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8863 
8864  assert(nodesel != NULL);
8865 
8866  SCIPnodeselSetExitsol(nodesel, nodeselexitsol);
8867 
8868  return SCIP_OKAY;
8869 }
8870 
8871 /** returns the node selector of the given name, or NULL if not existing */
8873  SCIP* scip, /**< SCIP data structure */
8874  const char* name /**< name of node selector */
8875  )
8876 {
8877  assert(scip != NULL);
8878  assert(scip->set != NULL);
8879  assert(name != NULL);
8880 
8881  return SCIPsetFindNodesel(scip->set, name);
8882 }
8883 
8884 /** returns the array of currently available node selectors */
8886  SCIP* scip /**< SCIP data structure */
8887  )
8888 {
8889  assert(scip != NULL);
8890  assert(scip->set != NULL);
8891 
8892  return scip->set->nodesels;
8893 }
8894 
8895 /** returns the number of currently available node selectors */
8897  SCIP* scip /**< SCIP data structure */
8898  )
8899 {
8900  assert(scip != NULL);
8901  assert(scip->set != NULL);
8902 
8903  return scip->set->nnodesels;
8904 }
8905 
8906 /** sets the priority of a node selector in standard mode */
8908  SCIP* scip, /**< SCIP data structure */
8909  SCIP_NODESEL* nodesel, /**< node selector */
8910  int priority /**< new standard priority of the node selector */
8911  )
8912 {
8913  assert(scip != NULL);
8914  assert(scip->set != NULL);
8915 
8916  SCIPnodeselSetStdPriority(nodesel, scip->set, priority);
8917 
8918  return SCIP_OKAY;
8919 }
8920 
8921 /** sets the priority of a node selector in memory saving mode */
8923  SCIP* scip, /**< SCIP data structure */
8924  SCIP_NODESEL* nodesel, /**< node selector */
8925  int priority /**< new memory saving priority of the node selector */
8926  )
8927 {
8928  assert(scip != NULL);
8929  assert(scip->set != NULL);
8930 
8931  SCIPnodeselSetMemsavePriority(nodesel, scip->set, priority);
8932 
8933  return SCIP_OKAY;
8934 }
8935 
8936 /** returns the currently used node selector */
8938  SCIP* scip /**< SCIP data structure */
8939  )
8940 {
8941  assert(scip != NULL);
8942  assert(scip->set != NULL);
8943 
8944  return SCIPsetGetNodesel(scip->set, scip->stat);
8945 }
8946 
8947 /** creates a branching rule and includes it in SCIP
8948  *
8949  * @note method has all branching rule callbacks as arguments and is thus changed every time a new
8950  * callback is added in future releases; consider using SCIPincludeBranchruleBasic() and setter functions
8951  * if you seek for a method which is less likely to change in future releases
8952  */
8954  SCIP* scip, /**< SCIP data structure */
8955  const char* name, /**< name of branching rule */
8956  const char* desc, /**< description of branching rule */
8957  int priority, /**< priority of the branching rule */
8958  int maxdepth, /**< maximal depth level, up to which this branching rule should be used (or -1) */
8959  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound
8960  * compared to best node's dual bound for applying branching rule
8961  * (0.0: only on current best node, 1.0: on all nodes) */
8962  SCIP_DECL_BRANCHCOPY ((*branchcopy)), /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
8963  SCIP_DECL_BRANCHFREE ((*branchfree)), /**< destructor of branching rule */
8964  SCIP_DECL_BRANCHINIT ((*branchinit)), /**< initialize branching rule */
8965  SCIP_DECL_BRANCHEXIT ((*branchexit)), /**< deinitialize branching rule */
8966  SCIP_DECL_BRANCHINITSOL((*branchinitsol)),/**< solving process initialization method of branching rule */
8967  SCIP_DECL_BRANCHEXITSOL((*branchexitsol)),/**< solving process deinitialization method of branching rule */
8968  SCIP_DECL_BRANCHEXECLP((*branchexeclp)), /**< branching execution method for fractional LP solutions */
8969  SCIP_DECL_BRANCHEXECEXT((*branchexecext)),/**< branching execution method for external candidates */
8970  SCIP_DECL_BRANCHEXECPS((*branchexecps)), /**< branching execution method for not completely fixed pseudo solutions */
8971  SCIP_BRANCHRULEDATA* branchruledata /**< branching rule data */
8972  )
8973 {
8974  SCIP_BRANCHRULE* branchrule;
8975 
8976  SCIP_CALL( checkStage(scip, "SCIPincludeBranchrule", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
8977 
8978  /* check whether branching rule is already present */
8979  if( SCIPfindBranchrule(scip, name) != NULL )
8980  {
8981  SCIPerrorMessage("branching rule <%s> already included.\n", name);
8982  return SCIP_INVALIDDATA;
8983  }
8984 
8985  SCIP_CALL( SCIPbranchruleCreate(&branchrule, scip->set, scip->messagehdlr, scip->mem->setmem,
8986  name, desc, priority, maxdepth,
8987  maxbounddist, branchcopy, branchfree, branchinit, branchexit, branchinitsol, branchexitsol,
8988  branchexeclp, branchexecext, branchexecps, branchruledata) );
8989  SCIP_CALL( SCIPsetIncludeBranchrule(scip->set, branchrule) );
8990 
8991  return SCIP_OKAY;
8992 }
8993 
8994 /** creates a branching rule and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL.
8995  * Optional callbacks can be set via specific setter functions, see SCIPsetBranchruleInit(), SCIPsetBranchruleExit(),
8996  * SCIPsetBranchruleCopy(), SCIPsetBranchruleFree(), SCIPsetBranchruleInitsol(), SCIPsetBranchruleExitsol(),
8997  * SCIPsetBranchruleExecLp(), SCIPsetBranchruleExecExt(), and SCIPsetBranchruleExecPs().
8998  *
8999  * @note if you want to set all callbacks with a single method call, consider using SCIPincludeBranchrule() instead
9000  */
9002  SCIP* scip, /**< SCIP data structure */
9003  SCIP_BRANCHRULE** branchruleptr, /**< pointer to branching rule, or NULL */
9004  const char* name, /**< name of branching rule */
9005  const char* desc, /**< description of branching rule */
9006  int priority, /**< priority of the branching rule */
9007  int maxdepth, /**< maximal depth level, up to which this branching rule should be used (or -1) */
9008  SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound
9009  * compared to best node's dual bound for applying branching rule
9010  * (0.0: only on current best node, 1.0: on all nodes) */
9011  SCIP_BRANCHRULEDATA* branchruledata /**< branching rule data */
9012  )
9013 {
9014  SCIP_BRANCHRULE* branchrule;
9015 
9016  SCIP_CALL( checkStage(scip, "SCIPincludeBranchruleBasic", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9017 
9018  /* check whether branching rule is already present */
9019  if( SCIPfindBranchrule(scip, name) != NULL )
9020  {
9021  SCIPerrorMessage("branching rule <%s> already included.\n", name);
9022  return SCIP_INVALIDDATA;
9023  }
9024 
9025  SCIP_CALL( SCIPbranchruleCreate(&branchrule, scip->set, scip->messagehdlr, scip->mem->setmem, name, desc, priority, maxdepth,
9026  maxbounddist, NULL, NULL, NULL, NULL, NULL, NULL,
9027  NULL, NULL, NULL, branchruledata) );
9028 
9029  SCIP_CALL( SCIPsetIncludeBranchrule(scip->set, branchrule) );
9030 
9031  if( branchruleptr != NULL )
9032  *branchruleptr = branchrule;
9033 
9034  return SCIP_OKAY;
9035 }
9036 
9037 /** sets copy method of branching rule */
9039  SCIP* scip, /**< SCIP data structure */
9040  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9041  SCIP_DECL_BRANCHCOPY ((*branchcopy)) /**< copy method of branching rule or NULL if you don't want to copy your plugin into sub-SCIPs */
9042  )
9043 {
9044  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleCopy", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9045 
9046  assert(branchrule != NULL);
9047 
9048  SCIPbranchruleSetCopy(branchrule, branchcopy);
9049 
9050  return SCIP_OKAY;
9051 }
9052 
9053 /** sets destructor method of branching rule */
9055  SCIP* scip, /**< SCIP data structure */
9056  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9057  SCIP_DECL_BRANCHFREE ((*branchfree)) /**< destructor of branching rule */
9058  )
9059 {
9060  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleFree", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9061 
9062  assert(branchrule != NULL);
9063 
9064  SCIPbranchruleSetFree(branchrule, branchfree);
9065 
9066  return SCIP_OKAY;
9067 }
9068 
9069 /** sets initialization method of branching rule */
9071  SCIP* scip, /**< SCIP data structure */
9072  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9073  SCIP_DECL_BRANCHINIT ((*branchinit)) /**< initialize branching rule */
9074  )
9075 {
9076  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleInit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9077 
9078  assert(branchrule != NULL);
9079 
9080  SCIPbranchruleSetInit(branchrule, branchinit);
9081 
9082  return SCIP_OKAY;
9083 }
9084 
9085 /** sets deinitialization method of branching rule */
9087  SCIP* scip, /**< SCIP data structure */
9088  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9089  SCIP_DECL_BRANCHEXIT ((*branchexit)) /**< deinitialize branching rule */
9090  )
9091 {
9092  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExit", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9093 
9094  assert(branchrule != NULL);
9095 
9096  SCIPbranchruleSetExit(branchrule, branchexit);
9097 
9098  return SCIP_OKAY;
9099 }
9100 
9101 /** sets solving process initialization method of branching rule */
9103  SCIP* scip, /**< SCIP data structure */
9104  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9105  SCIP_DECL_BRANCHINITSOL((*branchinitsol)) /**< solving process initialization method of branching rule */
9106  )
9107 {
9108  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleInitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9109 
9110  assert(branchrule != NULL);
9111 
9112  SCIPbranchruleSetInitsol(branchrule, branchinitsol);
9113 
9114  return SCIP_OKAY;
9115 }
9116 
9117 /** sets solving process deinitialization method of branching rule */
9119  SCIP* scip, /**< SCIP data structure */
9120  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9121  SCIP_DECL_BRANCHEXITSOL((*branchexitsol)) /**< solving process deinitialization method of branching rule */
9122  )
9123 {
9124  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExitsol", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9125 
9126  assert(branchrule != NULL);
9127 
9128  SCIPbranchruleSetExitsol(branchrule, branchexitsol);
9129 
9130  return SCIP_OKAY;
9131 }
9132 
9133 
9134 
9135 /** sets branching execution method for fractional LP solutions */
9137  SCIP* scip, /**< SCIP data structure */
9138  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9139  SCIP_DECL_BRANCHEXECLP((*branchexeclp)) /**< branching execution method for fractional LP solutions */
9140  )
9141 {
9142  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecLp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9143 
9144  assert(branchrule != NULL);
9145 
9146  SCIPbranchruleSetExecLp(branchrule, branchexeclp);
9147 
9148  return SCIP_OKAY;
9149 }
9150 
9151 /** sets branching execution method for external candidates */
9153  SCIP* scip, /**< SCIP data structure */
9154  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9155  SCIP_DECL_BRANCHEXECEXT((*branchexecext)) /**< branching execution method for external candidates */
9156  )
9157 {
9158  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecExt", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9159 
9160  assert(branchrule != NULL);
9161 
9162  SCIPbranchruleSetExecExt(branchrule, branchexecext);
9163 
9164  return SCIP_OKAY;
9165 }
9166 
9167 /** sets branching execution method for not completely fixed pseudo solutions */
9169  SCIP* scip, /**< SCIP data structure */
9170  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9171  SCIP_DECL_BRANCHEXECPS((*branchexecps)) /**< branching execution method for not completely fixed pseudo solutions */
9172  )
9173 {
9174  SCIP_CALL( checkStage(scip, "SCIPsetBranchruleExecPs", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9175 
9176  assert(branchrule != NULL);
9177 
9178  SCIPbranchruleSetExecPs(branchrule, branchexecps);
9179 
9180  return SCIP_OKAY;
9181 }
9182 
9183 /** returns the branching rule of the given name, or NULL if not existing */
9185  SCIP* scip, /**< SCIP data structure */
9186  const char* name /**< name of branching rule */
9187  )
9188 {
9189  assert(scip != NULL);
9190  assert(scip->set != NULL);
9191  assert(name != NULL);
9192 
9193  SCIPsetSortBranchrules(scip->set);
9194 
9195  return SCIPsetFindBranchrule(scip->set, name);
9196 }
9197 
9198 /** returns the array of currently available branching rules */
9200  SCIP* scip /**< SCIP data structure */
9201  )
9202 {
9203  assert(scip != NULL);
9204  assert(scip->set != NULL);
9205 
9206  return scip->set->branchrules;
9207 }
9208 
9209 /** returns the number of currently available branching rules */
9211  SCIP* scip /**< SCIP data structure */
9212  )
9213 {
9214  assert(scip != NULL);
9215  assert(scip->set != NULL);
9216 
9217  return scip->set->nbranchrules;
9218 }
9219 
9220 /** sets the priority of a branching rule */
9222  SCIP* scip, /**< SCIP data structure */
9223  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9224  int priority /**< new priority of the branching rule */
9225  )
9226 {
9227  assert(scip != NULL);
9228  assert(scip->set != NULL);
9229 
9230  SCIPbranchruleSetPriority(branchrule, scip->set, priority);
9231 
9232  return SCIP_OKAY;
9233 }
9234 
9235 /** sets maximal depth level, up to which this branching rule should be used (-1 for no limit) */
9237  SCIP* scip, /**< SCIP data structure */
9238  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9239  int maxdepth /**< new maxdepth of the branching rule */
9240  )
9241 {
9242  assert(scip != NULL);
9243  assert(scip->set != NULL);
9244 
9245  SCIPbranchruleSetMaxdepth(branchrule, maxdepth);
9246 
9247  return SCIP_OKAY;
9248 }
9249 
9250 /** sets maximal relative distance from current node's dual bound to primal bound for applying branching rule */
9252  SCIP* scip, /**< SCIP data structure */
9253  SCIP_BRANCHRULE* branchrule, /**< branching rule */
9254  SCIP_Real maxbounddist /**< new maxbounddist of the branching rule */
9255  )
9256 {
9257  assert(scip != NULL);
9258  assert(scip->set != NULL);
9259 
9260  SCIPbranchruleSetMaxbounddist(branchrule, maxbounddist);
9261 
9262  return SCIP_OKAY;
9263 }
9264 
9265 /** creates a display column and includes it in SCIP */
9267  SCIP* scip, /**< SCIP data structure */
9268  const char* name, /**< name of display column */
9269  const char* desc, /**< description of display column */
9270  const char* header, /**< head line of display column */
9271  SCIP_DISPSTATUS dispstatus, /**< display activation status of display column */
9272  SCIP_DECL_DISPCOPY ((*dispcopy)), /**< copy method of display column or NULL if you don't want to copy your plugin into sub-SCIPs */
9273  SCIP_DECL_DISPFREE ((*dispfree)), /**< destructor of display column */
9274  SCIP_DECL_DISPINIT ((*dispinit)), /**< initialize display column */
9275  SCIP_DECL_DISPEXIT ((*dispexit)), /**< deinitialize display column */
9276  SCIP_DECL_DISPINITSOL ((*dispinitsol)), /**< solving process initialization method of display column */
9277  SCIP_DECL_DISPEXITSOL ((*dispexitsol)), /**< solving process deinitialization method of display column */
9278  SCIP_DECL_DISPOUTPUT ((*dispoutput)), /**< output method */
9279  SCIP_DISPDATA* dispdata, /**< display column data */
9280  int width, /**< width of display column (no. of chars used) */
9281  int priority, /**< priority of display column */
9282  int position, /**< relative position of display column */
9283  SCIP_Bool stripline /**< should the column be separated with a line from its right neighbor? */
9284  )
9285 {
9286  SCIP_DISP* disp;
9287 
9288  SCIP_CALL( checkStage(scip, "SCIPincludeDisp", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9289 
9290  /* check whether display column is already present */
9291  if( SCIPfindDisp(scip, name) != NULL )
9292  {
9293  SCIPerrorMessage("display column <%s> already included.\n", name);
9294  return SCIP_INVALIDDATA;
9295  }
9296 
9297  SCIP_CALL( SCIPdispCreate(&disp, scip->set, scip->messagehdlr, scip->mem->setmem,
9298  name, desc, header, dispstatus,
9299  dispcopy,
9300  dispfree, dispinit, dispexit, dispinitsol, dispexitsol, dispoutput, dispdata,
9301  width, priority, position, stripline) );
9302  SCIP_CALL( SCIPsetIncludeDisp(scip->set, disp) );
9303 
9304  return SCIP_OKAY;
9305 }
9306 
9307 /** returns the display column of the given name, or NULL if not existing */
9309  SCIP* scip, /**< SCIP data structure */
9310  const char* name /**< name of display column */
9311  )
9312 {
9313  assert(scip != NULL);
9314  assert(scip->set != NULL);
9315  assert(name != NULL);
9316 
9317  return SCIPsetFindDisp(scip->set, name);
9318 }
9319 
9320 /** returns the array of currently available display columns */
9322  SCIP* scip /**< SCIP data structure */
9323  )
9324 {
9325  assert(scip != NULL);
9326  assert(scip->set != NULL);
9327 
9328  return scip->set->disps;
9329 }
9330 
9331 /** returns the number of currently available display columns */
9333  SCIP* scip /**< SCIP data structure */
9334  )
9335 {
9336  assert(scip != NULL);
9337  assert(scip->set != NULL);
9338 
9339  return scip->set->ndisps;
9340 }
9341 
9342 /** automatically selects display columns for being shown w.r.t. the display width parameter */
9344  SCIP* scip /**< SCIP data structure */
9345  )
9346 {
9347  assert(scip != NULL);
9348  assert(scip->set != NULL);
9349 
9351 
9352  return SCIP_OKAY;
9353 }
9354 
9355 /** changes the display column mode */
9357  SCIP_DISP* disp, /**< display column */
9358  SCIP_DISPMODE mode /**< the display column mode */
9359  )
9360 {
9361  assert(disp != NULL);
9362 
9363  SCIPdispChgMode(disp, mode);
9364 }
9365 
9366 /** method to call, when the priority of an NLPI was changed */
9367 static
9368 SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
9369 { /*lint --e{715}*/
9370  SCIP_PARAMDATA* paramdata;
9371 
9372  paramdata = SCIPparamGetData(param);
9373  assert(paramdata != NULL);
9374 
9375  /* use SCIPsetSetPriorityNlpi() to mark the nlpis unsorted */
9376  SCIP_CALL( SCIPsetNlpiPriority(scip, (SCIP_NLPI*)paramdata, SCIPparamGetInt(param)) );
9377 
9378  return SCIP_OKAY;
9379 }
9380 
9381 /** includes an NLPI in SCIP */
9383  SCIP* scip, /**< SCIP data structure */
9384  SCIP_NLPI* nlpi /**< NLPI data structure */
9385  )
9386 {
9387  char paramname[SCIP_MAXSTRLEN];
9388  char paramdesc[SCIP_MAXSTRLEN];
9389 
9390  assert(scip != NULL);
9391  assert(nlpi != NULL);
9392 
9393  SCIP_CALL( checkStage(scip, "SCIPincludeNlpi", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9394 
9395  /* check whether NLPI is already present */
9396  if( SCIPfindNlpi(scip, SCIPnlpiGetName(nlpi)) != NULL )
9397  {
9398  SCIPerrorMessage("NLPI <%s> already included.\n", SCIPnlpiGetName(nlpi));
9399  return SCIP_INVALIDDATA;
9400  }
9401 
9402  SCIP_CALL( SCIPsetIncludeNlpi(scip->set, nlpi) );
9403 
9404  /* add parameters */
9405  (void) SCIPsnprintf(paramname, SCIP_MAXSTRLEN, "nlpi/%s/priority", SCIPnlpiGetName(nlpi));
9406  (void) SCIPsnprintf(paramdesc, SCIP_MAXSTRLEN, "priority of NLPI <%s>", SCIPnlpiGetName(nlpi));
9407  SCIP_CALL( SCIPaddIntParam(scip, paramname, paramdesc,
9408  NULL, FALSE, SCIPnlpiGetPriority(nlpi), INT_MIN/4, INT_MAX/4,
9409  paramChgdNlpiPriority, (SCIP_PARAMDATA*)nlpi) ); /*lint !e740*/
9410 
9411  /* pass message handler (may be NULL) */
9413 
9414  return SCIP_OKAY;
9415 }
9416 
9417 /** returns the NLPI of the given name, or NULL if not existing */
9419  SCIP* scip, /**< SCIP data structure */
9420  const char* name /**< name of NLPI */
9421  )
9422 {
9423  assert(scip != NULL);
9424  assert(scip->set != NULL);
9425  assert(name != NULL);
9426 
9427  return SCIPsetFindNlpi(scip->set, name);
9428 }
9429 
9430 /** returns the array of currently available NLPIs (sorted by priority) */
9432  SCIP* scip /**< SCIP data structure */
9433  )
9434 {
9435  assert(scip != NULL);
9436  assert(scip->set != NULL);
9437 
9438  SCIPsetSortNlpis(scip->set);
9439 
9440  return scip->set->nlpis;
9441 }
9442 
9443 /** returns the number of currently available NLPIs */
9445  SCIP* scip /**< SCIP data structure */
9446  )
9447 {
9448  assert(scip != NULL);
9449  assert(scip->set != NULL);
9450 
9451  return scip->set->nnlpis;
9452 }
9453 
9454 /** sets the priority of an NLPI */
9456  SCIP* scip, /**< SCIP data structure */
9457  SCIP_NLPI* nlpi, /**< NLPI */
9458  int priority /**< new priority of the NLPI */
9459  )
9460 {
9461  assert(scip != NULL);
9462  assert(scip->set != NULL);
9463 
9464  SCIPsetSetPriorityNlpi(scip->set, nlpi, priority);
9465 
9466  return SCIP_OKAY;
9467 }
9468 
9469 /** includes information about an external code linked into the SCIP library */
9471  SCIP* scip, /**< SCIP data structure */
9472  const char* name, /**< name of external code */
9473  const char* description /**< description of external code, or NULL */
9474  )
9475 {
9476  assert(scip != NULL);
9477  assert(name != NULL);
9478 
9479  SCIP_CALL( checkStage(scip, "SCIPincludeExternalCodeInformation", TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9480 
9481  SCIP_CALL( SCIPsetIncludeExternalCode(scip->set, name, description) );
9482 
9483  return SCIP_OKAY;
9484 }
9485 
9486 /** returns an array of names of currently included external codes */
9488  SCIP* scip /**< SCIP data structure */
9489  )
9490 {
9491  assert(scip != NULL);
9492  assert(scip->set != NULL);
9493 
9494  return scip->set->extcodenames;
9495 }
9496 
9497 /** returns an array of the descriptions of currently included external codes
9498  *
9499  * @note some descriptions may be NULL
9500  */
9502  SCIP* scip /**< SCIP data structure */
9503  )
9504 {
9505  assert(scip != NULL);
9506  assert(scip->set != NULL);
9507 
9508  return scip->set->extcodedescs;
9509 }
9510 
9511 /** returns the number of currently included information on external codes */
9513  SCIP* scip /**< SCIP data structure */
9514  )
9515 {
9516  assert(scip != NULL);
9517  assert(scip->set != NULL);
9518 
9519  return scip->set->nextcodes;
9520 }
9521 
9522 /** prints information on external codes to a file stream via the message handler system
9523  *
9524  * @note If the message handler is set to a NULL pointer nothing will be printed
9525  */
9527  SCIP* scip, /**< SCIP data structure */
9528  FILE* file /**< output file (or NULL for standard output) */
9529  )
9530 {
9531  int i;
9532 
9533  SCIPmessageFPrintInfo(scip->messagehdlr, file, "External codes: ");
9534  if( scip->set->nextcodes == 0 )
9535  {
9536  SCIPinfoMessage(scip, file, "none\n");
9537  return;
9538  }
9539  SCIPinfoMessage(scip, file, "\n");
9540 
9541  for( i = 0; i < scip->set->nextcodes; ++i )
9542  {
9543  SCIPinfoMessage(scip, file, " %-20s %s\n", scip->set->extcodenames[i], scip->set->extcodedescs[i] != NULL ? scip->set->extcodedescs[i] : "");
9544  }
9545 }
9546 
9547 
9548 /*
9549  * user interactive dialog methods
9550  */
9551 
9552 /** creates and includes dialog
9553  *
9554  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
9555  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9556  */
9558  SCIP* scip, /**< SCIP data structure */
9559  SCIP_DIALOG** dialog, /**< pointer to store the dialog */
9560  SCIP_DECL_DIALOGCOPY ((*dialogcopy)), /**< copy method of dialog or NULL if you don't want to copy your plugin into sub-SCIPs */
9561  SCIP_DECL_DIALOGEXEC ((*dialogexec)), /**< execution method of dialog */
9562  SCIP_DECL_DIALOGDESC ((*dialogdesc)), /**< description output method of dialog, or NULL */
9563  SCIP_DECL_DIALOGFREE ((*dialogfree)), /**< destructor of dialog to free user data, or NULL */
9564  const char* name, /**< name of dialog: command name appearing in parent's dialog menu */
9565  const char* desc, /**< description of dialog used if description output method is NULL */
9566  SCIP_Bool issubmenu, /**< is the dialog a submenu? */
9567  SCIP_DIALOGDATA* dialogdata /**< user defined dialog data */
9568  )
9569 {
9570  assert(scip != NULL);
9571  assert(dialog != NULL);
9572 
9573  /* check whether display column is already present */
9574  if( dialogcopy != NULL && SCIPexistsDialog(scip, *dialog) )
9575  {
9576  SCIPerrorMessage("dialog <%s> already included.\n", name);
9577  return SCIP_INVALIDDATA;
9578  }
9579 
9580  SCIP_CALL( SCIPdialogCreate(dialog, dialogcopy, dialogexec, dialogdesc, dialogfree, name, desc, issubmenu, dialogdata) );
9581  SCIP_CALL( SCIPsetIncludeDialog(scip->set, *dialog) );
9582 
9583  return SCIP_OKAY;
9584 }
9585 
9586 /** returns if the dialog already exists
9587  *
9588  * @return TRUE is returned if the dialog exits, otherwise FALSE.
9589  */
9591  SCIP* scip, /**< SCIP data structure */
9592  SCIP_DIALOG* dialog /**< dialog */
9593  )
9594 {
9595  assert(scip != NULL);
9596 
9597  return SCIPsetExistsDialog(scip->set, dialog);
9598 }
9599 
9600 /** captures a dialog
9601  *
9602  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9603  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9604  */
9606  SCIP* scip, /**< SCIP data structure */
9607  SCIP_DIALOG* dialog /**< dialog */
9608  )
9609 {
9610  assert(scip != NULL);
9611 
9612  SCIPdialogCapture(dialog);
9613 
9614  return SCIP_OKAY;
9615 }
9616 
9617 /** releases a dialog
9618  *
9619  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9620  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9621  */
9623  SCIP* scip, /**< SCIP data structure */
9624  SCIP_DIALOG** dialog /**< pointer to the dialog */
9625  )
9626 {
9627  assert(scip != NULL);
9628 
9629  SCIP_CALL( SCIPdialogRelease(scip, dialog) );
9630 
9631  return SCIP_OKAY;
9632 }
9633 
9634 /** makes given dialog the root dialog of SCIP's interactive user shell; captures dialog and releases former root dialog
9635  *
9636  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9637  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9638  */
9640  SCIP* scip, /**< SCIP data structure */
9641  SCIP_DIALOG* dialog /**< dialog to be the root */
9642  )
9643 {
9644  assert(scip != NULL);
9645 
9646  SCIP_CALL( SCIPdialoghdlrSetRoot(scip, scip->dialoghdlr, dialog) );
9647 
9648  return SCIP_OKAY;
9649 }
9650 
9651 /** returns the root dialog of SCIP's interactive user shell
9652  *
9653  * @return the root dialog of SCIP's interactive user shell is returned.
9654  */
9656  SCIP* scip /**< SCIP data structure */
9657  )
9658 {
9659  assert(scip != NULL);
9660 
9661  return SCIPdialoghdlrGetRoot(scip->dialoghdlr);
9662 }
9663 
9664 /** adds a sub dialog to the given dialog as menu entry and captures it
9665  *
9666  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9667  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9668  */
9670  SCIP* scip, /**< SCIP data structure */
9671  SCIP_DIALOG* dialog, /**< dialog to extend, or NULL for root dialog */
9672  SCIP_DIALOG* subdialog /**< subdialog to add as menu entry in dialog */
9673  )
9674 {
9675  assert(scip != NULL);
9676 
9677  if( dialog == NULL )
9678  dialog = SCIPdialoghdlrGetRoot(scip->dialoghdlr);
9679 
9680  SCIP_CALL( SCIPdialogAddEntry(dialog, scip->set, subdialog) );
9681 
9682  return SCIP_OKAY;
9683 }
9684 
9685 /** adds a single line of input which is treated as if the user entered the command line
9686  *
9687  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9688  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9689  */
9691  SCIP* scip, /**< SCIP data structure */
9692  const char* inputline /**< input line to add */
9693  )
9694 {
9695  assert(scip != NULL);
9696 
9697  SCIP_CALL( SCIPdialoghdlrAddInputLine(scip->dialoghdlr, inputline) );
9698 
9699  return SCIP_OKAY;
9700 }
9701 
9702 /** adds a single line of input to the command history which can be accessed with the cursor keys
9703  *
9704  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9705  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9706  */
9708  SCIP* scip, /**< SCIP data structure */
9709  const char* inputline /**< input line to add */
9710  )
9711 {
9712  assert(scip != NULL);
9713 
9714  SCIP_CALL( SCIPdialoghdlrAddHistory(scip->dialoghdlr, NULL, inputline, FALSE) );
9715 
9716  return SCIP_OKAY;
9717 }
9718 
9719 /** starts interactive mode of SCIP by executing the root dialog
9720  *
9721  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9722  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9723  *
9724  * @pre This method can be called if @p scip is in one of the following stages:
9725  * - \ref SCIP_STAGE_INIT
9726  * - \ref SCIP_STAGE_FREE
9727  *
9728  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the
9729  * interactive shell was closed:
9730  * - \ref SCIP_STAGE_PROBLEM if the interactive shell was closed after the problem was created
9731  * - \ref SCIP_STAGE_TRANSFORMED if the interactive shell was closed after the problem was transformed
9732  * - \ref SCIP_STAGE_PRESOLVING if the interactive shell was closed during presolving
9733  * - \ref SCIP_STAGE_PRESOLVED if the interactive shell was closed after presolve
9734  * - \ref SCIP_STAGE_SOLVING if the interactive shell was closed during the tree search
9735  * - \ref SCIP_STAGE_SOLVED if the interactive shell was closed after the problem was solved
9736  * - \ref SCIP_STAGE_FREE if the interactive shell was closed after the problem was freed
9737  *
9738  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
9739  */
9741  SCIP* scip /**< SCIP data structure */
9742  )
9743 {
9744  SCIP_CALL( checkStage(scip, "SCIPstartInteraction", TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE) );
9745 
9746  /* includes or updates the default dialog menus in SCIP */
9748 
9749  SCIP_CALL( SCIPdialoghdlrExec(scip->dialoghdlr, scip->set) );
9750 
9751  return SCIP_OKAY;
9752 }
9753 
9754 /*
9755  * global problem methods
9756  */
9757 
9758 /** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
9759  * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
9760  * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
9761  *
9762  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9763  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9764  *
9765  * @pre This method can be called if @p scip is in one of the following stages:
9766  * - \ref SCIP_STAGE_INIT
9767  * - \ref SCIP_STAGE_PROBLEM
9768  * - \ref SCIP_STAGE_TRANSFORMED
9769  * - \ref SCIP_STAGE_PRESOLVING
9770  * - \ref SCIP_STAGE_PRESOLVED
9771  * - \ref SCIP_STAGE_SOLVING
9772  * - \ref SCIP_STAGE_SOLVED
9773  * - \ref SCIP_STAGE_FREE
9774  *
9775  * @post After calling this method, \SCIP reaches the following stage:
9776  * - \ref SCIP_STAGE_PROBLEM
9777  */
9779  SCIP* scip, /**< SCIP data structure */
9780  const char* name, /**< problem name */
9781  SCIP_DECL_PROBDELORIG ((*probdelorig)), /**< frees user data of original problem */
9782  SCIP_DECL_PROBTRANS ((*probtrans)), /**< creates user data of transformed problem by transforming original user data */
9783  SCIP_DECL_PROBDELTRANS((*probdeltrans)), /**< frees user data of transformed problem */
9784  SCIP_DECL_PROBINITSOL ((*probinitsol)), /**< solving process initialization method of transformed data */
9785  SCIP_DECL_PROBEXITSOL ((*probexitsol)), /**< solving process deinitialization method of transformed data */
9786  SCIP_DECL_PROBCOPY ((*probcopy)), /**< copies user data if you want to copy it to a subscip, or NULL */
9787  SCIP_PROBDATA* probdata /**< user problem data set by the reader */
9788  )
9789 {
9790  SCIP_CALL( checkStage(scip, "SCIPcreateProb", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
9791 
9792  /* free old problem */
9793  SCIP_CALL( SCIPfreeProb(scip) );
9794  assert(scip->set->stage == SCIP_STAGE_INIT);
9795 
9796  /* switch stage to PROBLEM */
9797  scip->set->stage = SCIP_STAGE_PROBLEM;
9798 
9799  SCIP_CALL( SCIPstatCreate(&scip->stat, scip->mem->probmem, scip->set, NULL, NULL, scip->messagehdlr) );
9800 
9801  SCIP_CALL( SCIPprobCreate(&scip->origprob, scip->mem->probmem, scip->set, name,
9802  probdelorig, probtrans, probdeltrans, probinitsol, probexitsol, probcopy, probdata, FALSE) );
9803 
9804  /* create solution pool for original solution candidates */
9806 
9807  /* create conflict pool for storing conflict constraints */
9809 
9810  /* initialize reoptimization structure, if needed */
9812 
9813  return SCIP_OKAY;
9814 }
9815 
9816 /** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
9817  * all callback methods will be set to NULL and can be set afterwards, if needed, via SCIPsetProbDelorig(),
9818  * SCIPsetProbTrans(), SCIPsetProbDeltrans(), SCIPsetProbInitsol(), SCIPsetProbExitsol(), and
9819  * SCIPsetProbCopy()
9820  * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
9821  * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
9822  *
9823  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9824  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9825  *
9826  * @pre This method can be called if @p scip is in one of the following stages:
9827  * - \ref SCIP_STAGE_INIT
9828  * - \ref SCIP_STAGE_PROBLEM
9829  * - \ref SCIP_STAGE_TRANSFORMED
9830  * - \ref SCIP_STAGE_PRESOLVING
9831  * - \ref SCIP_STAGE_PRESOLVED
9832  * - \ref SCIP_STAGE_SOLVING
9833  * - \ref SCIP_STAGE_SOLVED
9834  * - \ref SCIP_STAGE_FREE
9835  *
9836  * @post After calling this method, \SCIP reaches the following stage:
9837  * - \ref SCIP_STAGE_PROBLEM
9838  */
9840  SCIP* scip, /**< SCIP data structure */
9841  const char* name /**< problem name */
9842  )
9843 {
9844  SCIP_CALL( checkStage(scip, "SCIPcreateProbBasic", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
9845 
9846  SCIP_CALL( SCIPcreateProb(scip, name, NULL, NULL, NULL, NULL, NULL, NULL, NULL) );
9847 
9848  return SCIP_OKAY;
9849 }
9850 
9851 /** sets callback to free user data of original problem
9852  *
9853  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9854  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9855  *
9856  * @pre This method can be called if @p scip is in one of the following stages:
9857  * - \ref SCIP_STAGE_PROBLEM
9858  */
9860  SCIP* scip, /**< SCIP data structure */
9861  SCIP_DECL_PROBDELORIG ((*probdelorig)) /**< frees user data of original problem */
9862  )
9863 {
9864  assert(scip != NULL);
9865  SCIP_CALL( checkStage(scip, "SCIPsetProbDelorig", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9866 
9867  SCIPprobSetDelorig(scip->origprob, probdelorig);
9868 
9869  return SCIP_OKAY;
9870 }
9871 
9872 /** sets callback to create user data of transformed problem by transforming original user data
9873  *
9874  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9875  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9876  *
9877  * @pre This method can be called if @p scip is in one of the following stages:
9878  * - \ref SCIP_STAGE_PROBLEM
9879  */
9881  SCIP* scip, /**< SCIP data structure */
9882  SCIP_DECL_PROBTRANS ((*probtrans)) /**< creates user data of transformed problem by transforming original user data */
9883  )
9884 {
9885  assert(scip != NULL);
9886  SCIP_CALL( checkStage(scip, "SCIPsetProbTrans", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9887 
9888  SCIPprobSetTrans(scip->origprob, probtrans);
9889 
9890  return SCIP_OKAY;
9891 }
9892 
9893 /** sets callback to free user data of transformed problem
9894  *
9895  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9896  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9897  *
9898  * @pre This method can be called if @p scip is in one of the following stages:
9899  * - \ref SCIP_STAGE_PROBLEM
9900  */
9902  SCIP* scip, /**< SCIP data structure */
9903  SCIP_DECL_PROBDELTRANS((*probdeltrans)) /**< frees user data of transformed problem */
9904  )
9905 {
9906  assert(scip != NULL);
9907  SCIP_CALL( checkStage(scip, "SCIPsetProbDeltrans", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9908 
9909  SCIPprobSetDeltrans(scip->origprob, probdeltrans);
9910 
9911  return SCIP_OKAY;
9912 }
9913 
9914 /** sets solving process initialization callback of transformed data
9915  *
9916  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9917  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9918  *
9919  * @pre This method can be called if @p scip is in one of the following stages:
9920  * - \ref SCIP_STAGE_PROBLEM
9921  */
9923  SCIP* scip, /**< SCIP data structure */
9924  SCIP_DECL_PROBINITSOL ((*probinitsol)) /**< solving process initialization method of transformed data */
9925  )
9926 {
9927  assert(scip != NULL);
9928 
9929  SCIP_CALL( checkStage(scip, "SCIPsetProbInitsol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9930 
9931  SCIPprobSetInitsol(scip->origprob, probinitsol);
9932 
9933  return SCIP_OKAY;
9934 }
9935 
9936 /** sets solving process deinitialization callback of transformed data
9937  *
9938  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9939  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9940  *
9941  * @pre This method can be called if @p scip is in one of the following stages:
9942  * - \ref SCIP_STAGE_PROBLEM
9943  */
9945  SCIP* scip, /**< SCIP data structure */
9946  SCIP_DECL_PROBEXITSOL ((*probexitsol)) /**< solving process deinitialization method of transformed data */
9947  )
9948 {
9949  assert(scip != NULL);
9950  SCIP_CALL( checkStage(scip, "SCIPsetProbExitsol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9951 
9952  SCIPprobSetExitsol(scip->origprob, probexitsol);
9953 
9954  return SCIP_OKAY;
9955 }
9956 
9957 /** sets callback to copy user data to a subscip
9958  *
9959  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9960  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9961  *
9962  * @pre This method can be called if @p scip is in one of the following stages:
9963  * - \ref SCIP_STAGE_PROBLEM
9964  */
9966  SCIP* scip, /**< SCIP data structure */
9967  SCIP_DECL_PROBCOPY ((*probcopy)) /**< copies user data if you want to copy it to a subscip, or NULL */
9968  )
9969 {
9970  assert(scip != NULL);
9971  SCIP_CALL( checkStage(scip, "SCIPsetProbCopy", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
9972 
9973  SCIPprobSetCopy(scip->origprob, probcopy);
9974 
9975  return SCIP_OKAY;
9976 }
9977 
9978 /** reads problem from file and initializes all solving data structures
9979  *
9980  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
9981  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
9982  *
9983  * @pre This method can be called if @p scip is in one of the following stages:
9984  * - \ref SCIP_STAGE_INIT
9985  * - \ref SCIP_STAGE_PROBLEM
9986  * - \ref SCIP_STAGE_TRANSFORMED
9987  * - \ref SCIP_STAGE_INITPRESOLVE
9988  * - \ref SCIP_STAGE_PRESOLVING
9989  * - \ref SCIP_STAGE_EXITPRESOLVE
9990  * - \ref SCIP_STAGE_PRESOLVED
9991  * - \ref SCIP_STAGE_SOLVING
9992  * - \ref SCIP_STAGE_EXITSOLVE
9993  *
9994  * @post After the method was called, \SCIP is in one of the following stages:
9995  * - \ref SCIP_STAGE_INIT if reading failed (usually, when a SCIP_READERROR occurs)
9996  * - \ref SCIP_STAGE_PROBLEM if the problem file was successfully read
9997  */
9999  SCIP* scip, /**< SCIP data structure */
10000  const char* filename, /**< problem file name */
10001  const char* extension /**< extension of the desired file reader,
10002  * or NULL if file extension should be used */
10003  )
10004 {
10005  SCIP_RETCODE retcode;
10006  SCIP_RESULT result;
10007  SCIP_Bool usevartable;
10008  SCIP_Bool useconstable;
10009  int i;
10010  char* tmpfilename;
10011  char* fileextension;
10012 
10013  assert(scip != NULL);
10014  assert(filename != NULL);
10015 
10016  SCIP_CALL( checkStage(scip, "SCIPreadProb", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10017 
10018  SCIP_CALL( SCIPgetBoolParam(scip, "misc/usevartable", &usevartable) );
10019  SCIP_CALL( SCIPgetBoolParam(scip, "misc/useconstable", &useconstable) );
10020 
10021  if( !usevartable || !useconstable )
10022  {
10023  SCIPerrorMessage("Cannot read problem if vartable or constable is disabled. Make sure parameters 'misc/usevartable' and 'misc/useconstable' are set to TRUE.\n");
10024  return SCIP_READERROR;
10025  }
10026 
10027  /* try all readers until one could read the file */
10028  result = SCIP_DIDNOTRUN;
10029 
10030  /* copy filename */
10031  SCIP_CALL( SCIPduplicateBufferArray(scip, &tmpfilename, filename, (int)strlen(filename)+1) );
10032 
10033  fileextension = NULL;
10034  if( extension == NULL )
10035  {
10036  /* get extension from filename */
10037  SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, NULL);
10038  }
10039 
10040  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
10041  {
10042  retcode = SCIPreaderRead(scip->set->readers[i], scip->set, filename,
10043  extension != NULL ? extension : fileextension, &result);
10044 
10045  /* check for reader errors */
10046  if( retcode == SCIP_NOFILE || retcode == SCIP_READERROR )
10047  goto TERMINATE;
10048  SCIP_CALL( retcode );
10049  }
10050 
10051  switch( result )
10052  {
10053  case SCIP_DIDNOTRUN:
10054  retcode = SCIP_PLUGINNOTFOUND;
10055  break;
10056  case SCIP_SUCCESS:
10057  if( scip->origprob != NULL )
10058  {
10059  SCIP_Real readingtime;
10060 
10062  "original problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
10063  scip->origprob->nvars, scip->origprob->nbinvars, scip->origprob->nintvars,
10064  scip->origprob->nimplvars, scip->origprob->ncontvars,
10065  scip->origprob->nconss);
10066 
10067  /* in full verbose mode we will also print the number of constraints per constraint handler */
10068  if( scip->set->disp_verblevel == SCIP_VERBLEVEL_FULL )
10069  {
10070  int* nconss;
10071  int c;
10072  int h;
10073 
10074  SCIP_CALL( SCIPallocClearBufferArray(scip, &nconss, scip->set->nconshdlrs) );
10075 
10076  /* loop over all constraints and constraint-handlers to count for each type the amount of original
10077  * constraints
10078  */
10079  for( c = scip->origprob->nconss - 1; c >= 0; --c )
10080  {
10081  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
10082  {
10083  if( scip->origprob->conss[c]->conshdlr == scip->set->conshdlrs[h] )
10084  {
10085  ++(nconss[h]);
10086  break;
10087  }
10088  }
10089  /* constraint handler should be found */
10090  assert(h >= 0);
10091  }
10092 
10093  /* loop over all constraints handlers for printing the number of original constraints */
10094  for( h = 0; h < scip->set->nconshdlrs; ++h )
10095  {
10096  if( nconss[h] > 0 )
10097  {
10099  "%7d constraints of type <%s>\n", nconss[h], SCIPconshdlrGetName(scip->set->conshdlrs[h]));
10100  }
10101  }
10102 
10103  SCIPfreeBufferArray(scip, &nconss);
10104  }
10105 
10106  /* in case the permutation seed is different to 0, permute the original problem */
10107  if( scip->set->random_permutationseed > 0 )
10108  {
10109  SCIP_Bool permuteconss;
10110  SCIP_Bool permutevars;
10111  int permutationseed;
10112 
10113  permuteconss = scip->set->random_permuteconss;
10114  permutevars = scip->set->random_permutevars;
10115  permutationseed = scip->set->random_permutationseed;
10116 
10117  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
10118  }
10119 
10120  /* get reading time */
10121  readingtime = SCIPgetReadingTime(scip);
10122 
10123  /* display timing statistics */
10125  "Reading Time: %.2f\n", readingtime);
10126  }
10127  retcode = SCIP_OKAY;
10128  break;
10129  default:
10130  assert(i < scip->set->nreaders);
10131  SCIPerrorMessage("invalid result code <%d> from reader <%s> reading file <%s>\n",
10132  result, SCIPreaderGetName(scip->set->readers[i]), filename);
10133  retcode = SCIP_READERROR;
10134  } /*lint !e788*/
10135 
10136  TERMINATE:
10137  /* free buffer array */
10138  SCIPfreeBufferArray(scip, &tmpfilename);
10139 
10140  /* check if reading time should belong to solving time */
10141  if( scip->set->time_reading )
10142  {
10143  SCIP_Real readingtime;
10144 
10145  /* get reading time */
10146  readingtime = SCIPgetReadingTime(scip);
10147 
10148  /* add reading time to solving time */
10149  SCIPclockSetTime(scip->stat->solvingtime, readingtime);
10150  }
10151 
10152  return retcode;
10153 }
10154 
10155 /* write original or transformed problem */
10156 static
10158  SCIP* scip, /**< SCIP data structure */
10159  const char* filename, /**< output file (or NULL for standard output) */
10160  const char* extension, /**< extension of the desired file reader,
10161  * or NULL if file extension should be used */
10162  SCIP_Bool transformed, /**< output the transformed problem? */
10163  SCIP_Bool genericnames /**< using generic variable and constraint names? */
10164  )
10165 {
10166  SCIP_RETCODE retcode;
10167  char* tmpfilename;
10168  char* fileextension;
10169  char* compression;
10170  FILE* file;
10171 
10172  assert(scip != NULL );
10173 
10174  fileextension = NULL;
10175  compression = NULL;
10176  file = NULL;
10177  tmpfilename = NULL;
10178 
10179  if( filename != NULL && filename[0] != '\0' )
10180  {
10181  int success;
10182 
10183  file = fopen(filename, "w");
10184  if( file == NULL )
10185  {
10186  SCIPerrorMessage("cannot create file <%s> for writing\n", filename);
10187  SCIPprintSysError(filename);
10188  return SCIP_FILECREATEERROR;
10189  }
10190 
10191  /* get extension from filename,
10192  * if an error occurred, close the file before returning */
10193  if( BMSduplicateMemoryArray(&tmpfilename, filename, strlen(filename)+1) == NULL )
10194  {
10195  (void) fclose(file);
10196  SCIPerrorMessage("Error <%d> in function call\n", SCIP_NOMEMORY);
10197  return SCIP_NOMEMORY;
10198  }
10199 
10200  SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, &compression);
10201 
10202  if( compression != NULL )
10203  {
10204  SCIPmessagePrintWarning(scip->messagehdlr, "currently it is not possible to write files with any compression\n");
10205  BMSfreeMemoryArray(&tmpfilename);
10206  (void) fclose(file);
10207  return SCIP_FILECREATEERROR;
10208  }
10209 
10210  if( extension == NULL && fileextension == NULL )
10211  {
10212  SCIPmessagePrintWarning(scip->messagehdlr, "filename <%s> has no file extension, select default <cip> format for writing\n", filename);
10213  }
10214 
10215  if( transformed )
10216  retcode = SCIPprintTransProblem(scip, file, extension != NULL ? extension : fileextension, genericnames);
10217  else
10218  retcode = SCIPprintOrigProblem(scip, file, extension != NULL ? extension : fileextension, genericnames);
10219 
10220  BMSfreeMemoryArray(&tmpfilename);
10221 
10222  success = fclose(file);
10223  if( success != 0 )
10224  {
10225  SCIPerrorMessage("An error occurred while closing file <%s>\n", filename);
10226  return SCIP_FILECREATEERROR;
10227  }
10228  }
10229  else
10230  {
10231  /* print to stdout */
10232  if( transformed )
10233  retcode = SCIPprintTransProblem(scip, NULL, extension, genericnames);
10234  else
10235  retcode = SCIPprintOrigProblem(scip, NULL, extension, genericnames);
10236  }
10237 
10238  /* check for write errors */
10239  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
10240  return retcode;
10241  else
10242  {
10243  SCIP_CALL( retcode );
10244  }
10245 
10246  return SCIP_OKAY;
10247 }
10248 
10249 /** writes original problem to file
10250  *
10251  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10252  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10253  *
10254  * @pre This method can be called if @p scip is in one of the following stages:
10255  * - \ref SCIP_STAGE_PROBLEM
10256  * - \ref SCIP_STAGE_TRANSFORMING
10257  * - \ref SCIP_STAGE_TRANSFORMED
10258  * - \ref SCIP_STAGE_INITPRESOLVE
10259  * - \ref SCIP_STAGE_PRESOLVING
10260  * - \ref SCIP_STAGE_EXITPRESOLVE
10261  * - \ref SCIP_STAGE_PRESOLVED
10262  * - \ref SCIP_STAGE_INITSOLVE
10263  * - \ref SCIP_STAGE_SOLVING
10264  * - \ref SCIP_STAGE_SOLVED
10265  * - \ref SCIP_STAGE_EXITSOLVE
10266  * - \ref SCIP_STAGE_FREETRANS
10267  */
10269  SCIP* scip, /**< SCIP data structure */
10270  const char* filename, /**< output file (or NULL for standard output) */
10271  const char* extension, /**< extension of the desired file reader,
10272  * or NULL if file extension should be used */
10273  SCIP_Bool genericnames /**< using generic variable and constraint names? */
10274  )
10275 {
10276  SCIP_RETCODE retcode;
10277 
10278  SCIP_CALL( checkStage(scip, "SCIPwriteOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10279 
10280  assert( scip != NULL );
10281  assert( scip->origprob != NULL );
10282 
10283  retcode = writeProblem(scip, filename, extension, FALSE, genericnames);
10284 
10285  /* check for write errors */
10286  if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
10287  return retcode;
10288  else
10289  {
10290  SCIP_CALL( retcode );
10291  }
10292 
10293  return SCIP_OKAY;
10294 }
10295 
10296 /** writes transformed problem which are valid in the current node to file
10297  *
10298  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10299  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10300  *
10301  * @pre This method can be called if @p scip is in one of the following stages:
10302  * - \ref SCIP_STAGE_TRANSFORMED
10303  * - \ref SCIP_STAGE_INITPRESOLVE
10304  * - \ref SCIP_STAGE_PRESOLVING
10305  * - \ref SCIP_STAGE_EXITPRESOLVE
10306  * - \ref SCIP_STAGE_PRESOLVED
10307  * - \ref SCIP_STAGE_INITSOLVE
10308  * - \ref SCIP_STAGE_SOLVING
10309  * - \ref SCIP_STAGE_SOLVED
10310  * - \ref SCIP_STAGE_EXITSOLVE
10311  *
10312  * @note If you want the write all constraints (including the once which are redundant for example), you need to set
10313  * the parameter <write/allconss> to TRUE
10314  */
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 genericnames /**< using generic variable and constraint names? */
10321  )
10322 {
10323  SCIP_RETCODE retcode;
10324 
10325  SCIP_CALL( checkStage(scip, "SCIPwriteTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10326 
10327  assert( scip != NULL );
10328  assert( scip->transprob != NULL );
10329 
10330  retcode = writeProblem(scip, filename, extension, TRUE, genericnames);
10331 
10332  /* check for write errors */
10333  if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
10334  return retcode;
10335  else
10336  {
10337  SCIP_CALL( retcode );
10338  }
10339 
10340  return SCIP_OKAY;
10341 }
10342 
10343 /** frees problem and solution process data
10344  *
10345  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10346  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10347  *
10348  * @pre This method can be called if @p scip is in one of the following stages:
10349  * - \ref SCIP_STAGE_INIT
10350  * - \ref SCIP_STAGE_PROBLEM
10351  * - \ref SCIP_STAGE_TRANSFORMED
10352  * - \ref SCIP_STAGE_PRESOLVING
10353  * - \ref SCIP_STAGE_PRESOLVED
10354  * - \ref SCIP_STAGE_SOLVING
10355  * - \ref SCIP_STAGE_SOLVED
10356  * - \ref SCIP_STAGE_FREE
10357  *
10358  * @post After this method was called, SCIP is in the following stage:
10359  * - \ref SCIP_STAGE_INIT
10360  */
10362  SCIP* scip /**< SCIP data structure */
10363  )
10364 {
10365  SCIP_Bool transsolorig;
10366 
10367  SCIP_CALL( checkStage(scip, "SCIPfreeProb", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
10368 
10369  /* if we free the problem, we do not have to transfer transformed solutions to the original space, so temporarily disable it */
10370  transsolorig = scip->set->misc_transsolsorig;
10371  scip->set->misc_transsolsorig = FALSE;
10372 
10373  SCIP_CALL( SCIPfreeTransform(scip) );
10374  /* for some reason the free transform can generate events caught in the globalbnd eventhander
10375  * which requires the concurrent so it must be freed afterwards this happened o instance fiber
10376  */
10377  SCIP_CALL( SCIPfreeConcurrent(scip) );
10378 
10379  assert(scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_PROBLEM);
10380  scip->set->misc_transsolsorig = transsolorig;
10381 
10382  if( scip->set->stage == SCIP_STAGE_PROBLEM )
10383  {
10384  int i;
10385 
10386  /* free concsolvers and deinitialize the syncstore */
10387  if( scip->set->nconcsolvers > 0 )
10388  {
10389  assert(SCIPsyncstoreIsInitialized(scip->syncstore));
10390 
10393  }
10394 
10395  /* deactivate all pricers */
10396  for( i = scip->set->nactivepricers-1; i >= 0; --i )
10397  {
10398  SCIP_CALL( SCIPpricerDeactivate(scip->set->pricers[i], scip->set) );
10399  }
10400  assert(scip->set->nactivepricers == 0);
10401 
10402  /* free original primal solution candidate pool, original problem and problem statistics data structures */
10403  if( scip->set->reopt_enable || scip->reopt != NULL)
10404  {
10405  SCIP_CALL( SCIPreoptFree(&scip->reopt, scip->set, scip->origprimal, scip->mem->probmem) );
10406  }
10407  SCIP_CALL( SCIPconflictstoreFree(&scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
10408  SCIP_CALL( SCIPprimalFree(&scip->origprimal, scip->mem->probmem) );
10409  SCIP_CALL( SCIPprobFree(&scip->origprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
10410  SCIP_CALL( SCIPstatFree(&scip->stat, scip->mem->probmem) );
10411 
10412  /* readers */
10413  for( i = 0; i < scip->set->nreaders; ++i )
10414  {
10416  }
10417 
10418  /* switch stage to INIT */
10419  scip->set->stage = SCIP_STAGE_INIT;
10420  }
10421  assert(scip->set->stage == SCIP_STAGE_INIT);
10422 
10423  return SCIP_OKAY;
10424 }
10425 
10426 
10427 /** permutes parts of the problem data structure
10428  *
10429  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10430  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10431  *
10432  * @pre This method can be called if @p scip is in one of the following stages:
10433  * - \ref SCIP_STAGE_PROBLEM
10434  * - \ref SCIP_STAGE_TRANSFORMED
10435  *
10436  * @todo This need to be changed to use the new random number generator implemented in random.c
10437  */
10439  SCIP* scip, /**< SCIP data structure */
10440  unsigned int randseed, /**< seed value for random generator */
10441  SCIP_Bool permuteconss, /**< should the list of constraints in each constraint handler be permuted? */
10442  SCIP_Bool permutebinvars, /**< should the list of binary variables be permuted? */
10443  SCIP_Bool permuteintvars, /**< should the list of integer variables be permuted? */
10444  SCIP_Bool permuteimplvars, /**< should the list of implicit integer variables be permuted? */
10445  SCIP_Bool permutecontvars /**< should the list of continuous integer variables be permuted? */
10446  )
10447 {
10448  SCIP_VAR** vars;
10449  SCIP_CONSHDLR** conshdlrs;
10450  SCIP_RANDNUMGEN* randnumgen;
10451  SCIP_Bool permuted;
10452  int nconshdlrs;
10453  int nbinvars;
10454  int nintvars;
10455  int nimplvars;
10456  int nvars;
10457  int j;
10458 
10459  assert(scip != NULL);
10460  SCIP_CALL( checkStage(scip, "SCIPpermuteProb", FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10461 
10462  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, &nimplvars, NULL) );
10463 
10464  assert(nvars == 0 || vars != NULL);
10465  assert(nvars == nbinvars+nintvars+nimplvars+SCIPgetNContVars(scip));
10466 
10467  conshdlrs = SCIPgetConshdlrs(scip);
10468  nconshdlrs = SCIPgetNConshdlrs(scip);
10469  assert(nconshdlrs == 0 || conshdlrs != NULL);
10470 
10471  /* create a random number generator */
10472  SCIP_CALL( SCIPrandomCreate(&randnumgen, scip->mem->probmem, randseed) );
10473 
10474  /* The constraint handler should not be permuted since they are called w.r.t. to certain properties; besides
10475  * that the "conshdlrs" array should stay in the order as it is since this array is used to copy the plugins for
10476  * sub-SCIPs and contains the dependencies between the constraint handlers; for example the linear constraint
10477  * handler stays in front of all constraint handler which can upgrade a linear constraint (such as logicor,
10478  * setppc, and knapsack).
10479  */
10480 
10481  permuted = FALSE;
10482 
10483  /* for each constraint handler, permute its constraints */
10484  if( permuteconss )
10485  {
10486  int i;
10487 
10488  /* we must only permute active constraints */
10489  if( SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->transprob) )
10490  {
10491  /* loop over all constraint handlers */
10492  for( i = 0; i < nconshdlrs; ++i )
10493  {
10494  SCIP_CONS** conss;
10495  int nconss;
10496 
10497  conss = SCIPconshdlrGetConss(conshdlrs[i]);
10498  nconss = SCIPconshdlrGetNActiveConss(conshdlrs[i]);
10499 
10500  assert(nconss == 0 || conss != NULL);
10501 
10502  SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
10503 
10504  /* readjust the mapping of constraints to array positions */
10505  for( j = 0; j < nconss; ++j )
10506  conss[j]->consspos = j;
10507 
10508  permuted = TRUE;
10509  }
10510  }
10511  else if( !SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->origprob) )
10512  {
10513  SCIP_CONS** conss = scip->origprob->conss;
10514  int nconss = scip->origprob->nconss;
10515 
10516  SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
10517 
10518  for( j = 0; j < nconss; ++j )
10519  {
10520  assert(conss[j]->consspos == -1);
10521  conss[j]->addarraypos = j;
10522  }
10523 
10524  permuted = TRUE;
10525  }
10526  }
10527 
10528  /* permute binary variables */
10529  if( permutebinvars && !SCIPprobIsPermuted(scip->origprob) )
10530  {
10531  SCIPrandomPermuteArray(randnumgen, (void**)vars, 0, nbinvars);
10532 
10533  /* readjust the mapping of variables to array positions */
10534  for( j = 0; j < nbinvars; ++j )
10535  vars[j]->probindex = j;
10536 
10537  permuted = TRUE;
10538  }
10539 
10540  /* permute general integer variables */
10541  if( permuteintvars && !SCIPprobIsPermuted(scip->origprob) )
10542  {
10543  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars, nbinvars+nintvars);
10544 
10545  /* readjust the mapping of variables to array positions */
10546  for( j = nbinvars; j < nbinvars+nintvars; ++j )
10547  vars[j]->probindex = j;
10548 
10549  permuted = TRUE;
10550  }
10551 
10552  /* permute general integer variables */
10553  if( permuteimplvars && !SCIPprobIsPermuted(scip->origprob) )
10554  {
10555  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars+nintvars, nbinvars+nintvars+nimplvars);
10556 
10557  /* readjust the mapping of variables to array positions */
10558  for( j = nbinvars+nintvars; j < nbinvars+nintvars+nimplvars; ++j )
10559  vars[j]->probindex = j;
10560 
10561  permuted = TRUE;
10562  }
10563 
10564  /* permute general integer variables */
10565  if( permutecontvars && !SCIPprobIsPermuted(scip->origprob) )
10566  {
10567  SCIPrandomPermuteArray(randnumgen, (void**)vars, nbinvars+nintvars+nimplvars, nvars);
10568 
10569  /* readjust the mapping of variables to array positions */
10570  for( j = nbinvars+nintvars+nimplvars; j < nvars; ++j )
10571  vars[j]->probindex = j;
10572 
10573  permuted = TRUE;
10574  }
10575 
10576  if( permuted && SCIPisTransformed(scip) )
10577  {
10578  assert(!SCIPprobIsPermuted(scip->transprob));
10579 
10580  /* mark tranformed problem as permuted */
10582 
10584  "permute transformed problem using random seed %u\n", randseed);
10585  }
10586  else if( permuted && !SCIPisTransformed(scip) )
10587  {
10588  assert(!SCIPprobIsPermuted(scip->origprob));
10589 
10590  /* mark original problem as permuted */
10592 
10594  "permute original problem using random seed %u\n", randseed);
10595  }
10596 
10597  /* free random number generator */
10598  SCIPrandomFree(&randnumgen);
10599 
10600  return SCIP_OKAY;
10601 }
10602 
10603 /** gets user problem data
10604  *
10605  * @return a SCIP_PROBDATA pointer, or NULL if no problem data was allocated
10606  *
10607  * @pre This method can be called if @p scip is in one of the following stages:
10608  * - \ref SCIP_STAGE_PROBLEM
10609  * - \ref SCIP_STAGE_TRANSFORMING
10610  * - \ref SCIP_STAGE_TRANSFORMED
10611  * - \ref SCIP_STAGE_INITPRESOLVE
10612  * - \ref SCIP_STAGE_PRESOLVING
10613  * - \ref SCIP_STAGE_EXITPRESOLVE
10614  * - \ref SCIP_STAGE_PRESOLVED
10615  * - \ref SCIP_STAGE_INITSOLVE
10616  * - \ref SCIP_STAGE_SOLVING
10617  * - \ref SCIP_STAGE_SOLVED
10618  * - \ref SCIP_STAGE_EXITSOLVE
10619  * - \ref SCIP_STAGE_FREETRANS
10620  */
10622  SCIP* scip /**< SCIP data structure */
10623  )
10624 {
10625  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10626 
10627  switch( scip->set->stage )
10628  {
10629  case SCIP_STAGE_PROBLEM:
10630  return SCIPprobGetData(scip->origprob);
10631 
10635  case SCIP_STAGE_PRESOLVING:
10637  case SCIP_STAGE_PRESOLVED:
10638  case SCIP_STAGE_INITSOLVE:
10639  case SCIP_STAGE_SOLVING:
10640  case SCIP_STAGE_SOLVED:
10641  case SCIP_STAGE_EXITSOLVE:
10642  case SCIP_STAGE_FREETRANS:
10643  return SCIPprobGetData(scip->transprob);
10644 
10645  default:
10646  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10647  SCIPABORT();
10648  return NULL; /*lint !e527*/
10649  } /*lint !e788*/
10650 }
10651 
10652 /** sets user problem data
10653  *
10654  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10655  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10656  *
10657  * @pre This method can be called if @p scip is in one of the following stages:
10658  * - \ref SCIP_STAGE_PROBLEM
10659  * - \ref SCIP_STAGE_TRANSFORMING
10660  * - \ref SCIP_STAGE_TRANSFORMED
10661  * - \ref SCIP_STAGE_INITPRESOLVE
10662  * - \ref SCIP_STAGE_PRESOLVING
10663  * - \ref SCIP_STAGE_EXITPRESOLVE
10664  * - \ref SCIP_STAGE_PRESOLVED
10665  * - \ref SCIP_STAGE_INITSOLVE
10666  * - \ref SCIP_STAGE_SOLVING
10667  * - \ref SCIP_STAGE_SOLVED
10668  * - \ref SCIP_STAGE_EXITSOLVE
10669  * - \ref SCIP_STAGE_FREETRANS
10670  */
10672  SCIP* scip, /**< SCIP data structure */
10673  SCIP_PROBDATA* probdata /**< user problem data to use */
10674  )
10675 {
10676  SCIP_CALL( checkStage(scip, "SCIPsetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10677 
10678  switch( scip->set->stage )
10679  {
10680  case SCIP_STAGE_PROBLEM:
10681  SCIPprobSetData(scip->origprob, probdata);
10682  return SCIP_OKAY;
10683 
10687  case SCIP_STAGE_PRESOLVING:
10689  case SCIP_STAGE_PRESOLVED:
10690  case SCIP_STAGE_INITSOLVE:
10691  case SCIP_STAGE_SOLVING:
10692  case SCIP_STAGE_SOLVED:
10693  case SCIP_STAGE_EXITSOLVE:
10694  case SCIP_STAGE_FREETRANS:
10695  SCIPprobSetData(scip->transprob, probdata);
10696  return SCIP_OKAY;
10697 
10698  case SCIP_STAGE_INIT:
10699  case SCIP_STAGE_FREE:
10700  default:
10701  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
10702  return SCIP_INVALIDCALL;
10703  }
10704 }
10705 
10706 /** returns name of the current problem instance
10707  *
10708  * @return name of the current problem instance
10709  *
10710  * @pre This method can be called if @p scip is in one of the following stages:
10711  * - \ref SCIP_STAGE_PROBLEM
10712  * - \ref SCIP_STAGE_TRANSFORMING
10713  * - \ref SCIP_STAGE_TRANSFORMED
10714  * - \ref SCIP_STAGE_INITPRESOLVE
10715  * - \ref SCIP_STAGE_PRESOLVING
10716  * - \ref SCIP_STAGE_EXITPRESOLVE
10717  * - \ref SCIP_STAGE_PRESOLVED
10718  * - \ref SCIP_STAGE_INITSOLVE
10719  * - \ref SCIP_STAGE_SOLVING
10720  * - \ref SCIP_STAGE_SOLVED
10721  * - \ref SCIP_STAGE_EXITSOLVE
10722  * - \ref SCIP_STAGE_FREETRANS
10723  */
10724 const char* SCIPgetProbName(
10725  SCIP* scip /**< SCIP data structure */
10726  )
10727 {
10728  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10729 
10730  return SCIPprobGetName(scip->origprob);
10731 }
10732 
10733 /** sets name of the current problem instance
10734  *
10735  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10736  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10737  *
10738  * @pre This method can be called if @p scip is in one of the following stages:
10739  * - \ref SCIP_STAGE_PROBLEM
10740  * - \ref SCIP_STAGE_TRANSFORMING
10741  * - \ref SCIP_STAGE_TRANSFORMED
10742  * - \ref SCIP_STAGE_INITPRESOLVE
10743  * - \ref SCIP_STAGE_PRESOLVING
10744  * - \ref SCIP_STAGE_EXITPRESOLVE
10745  * - \ref SCIP_STAGE_PRESOLVED
10746  * - \ref SCIP_STAGE_INITSOLVE
10747  * - \ref SCIP_STAGE_SOLVING
10748  * - \ref SCIP_STAGE_SOLVED
10749  * - \ref SCIP_STAGE_EXITSOLVE
10750  * - \ref SCIP_STAGE_FREETRANS
10751  */
10753  SCIP* scip, /**< SCIP data structure */
10754  const char* name /**< name to be set */
10755  )
10756 {
10757  SCIP_CALL( checkStage(scip, "SCIPsetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10758 
10759  return SCIPprobSetName(scip->origprob, name);
10760 }
10761 
10762 /** changes the objective function of the original problem.
10763  *
10764  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10765  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10766  *
10767  * @pre This method can be called if @p scip is in one of the following stages:
10768  * - \ref SCIP_STAGE_PROBLEM
10769  * - \ref SCIP_STAGE_PRESOLVED
10770  *
10771  * @note This method should be only used to change the objective function during two reoptimization runs and is only
10772  * recommended to an experienced user.
10773  *
10774  * @note All variables not given in \p vars array are assumed to have an objective coefficient of zero.
10775  */
10777  SCIP* scip, /**< SCIP data structure */
10778  SCIP_OBJSENSE objsense, /**< new objective function */
10779  SCIP_VAR** vars, /**< original problem variables */
10780  SCIP_Real* coefs, /**< objective coefficients */
10781  int nvars /**< variables in vars array */
10782  )
10783 {
10784  SCIP_VAR** origvars;
10785  SCIP_Real objscalar;
10786  int norigvars;
10787  int i;
10788 
10789  SCIP_CALL( checkStage(scip, "SCIPchgReoptObjective", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10790 
10791  assert(nvars == 0 || vars != NULL);
10792  assert(nvars == 0 || coefs != NULL);
10793 
10794  origvars = scip->origprob->vars;
10795  norigvars = scip->origprob->nvars;
10796 
10797 #ifdef SCIP_MORE_DEBUG
10798  SCIPdebugMsg(scip, "objective function need to be set:\n");
10799  for( i = 0; i < nvars; i++ )
10800  {
10801  if( !SCIPisZero(scip, coefs[i]) )
10802  SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, coefs[i]) ? "+" : "", coefs[i], SCIPvarGetName(vars[i]));
10803  }
10804  SCIPdebugMsg(scip, "\n");
10805 #endif
10806 
10807  /* set all coefficients to 0, this is necessary because variables that are not given are assumed to have a
10808  * zero objective coefficient
10809  */
10810  for( i = 0; i < norigvars; i++ )
10811  {
10812  SCIP_CALL( SCIPchgVarObj(scip, origvars[i], 0.0) );
10813  }
10814 
10815  /* since we are not allowed to change the objective sense in SCIP_STAGE_PPRESOLVED, we multiply all coefficients
10816  * with -1.0 if the objective sense needs to be changed
10817  */
10818  if( scip->origprob->objsense != objsense )
10819  objscalar = -1.0;
10820  else
10821  objscalar = 1.0;
10822 
10823  /* reset objective data */
10824  scip->origprob->objscale = 1.0;
10825  scip->origprob->objoffset = 0.0;
10826  scip->origprob->objisintegral = FALSE;
10827 
10828 #ifndef NDEBUG
10829  if( scip->set->stage == SCIP_STAGE_PRESOLVED )
10830  {
10831  for( i = 0; i < scip->transprob->nvars; i++ )
10832  assert(SCIPvarGetObj(scip->transprob->vars[i]) == 0.0);
10833  }
10834 #endif
10835 
10836  /* set new objective values */
10837  for( i = 0; i < nvars; ++i )
10838  {
10839  if( !SCIPvarIsOriginal(vars[i]) )
10840  {
10841  SCIPerrorMessage("Cannot handle variable <%s> (status: %d) in SCIPchgReoptObjective().\n",
10842  SCIPvarGetName(vars[i]), SCIPvarGetStatus(vars[i]));
10843  return SCIP_INVALIDDATA;
10844  }
10845 
10846  SCIP_CALL( SCIPaddVarObj(scip, vars[i], objscalar * coefs[i]) );
10847  }
10848 
10849 #ifdef SCIP_MORE_DEBUG
10850  SCIPdebugMsg(scip, "new objective function:\n");
10851  for( i = 0; i < norigvars; i++ )
10852  {
10853  SCIP_Real objval = SCIPvarGetObj(origvars[i]);
10854  if( !SCIPisZero(scip, objval) )
10855  SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, objval) ? "+" : "", objval, SCIPvarGetName(origvars[i]));
10856  }
10857  SCIPdebugMsg(scip, "\n");
10858 #endif
10859 
10860  return SCIP_OKAY;
10861 }
10862 
10863 /** returns objective sense of original problem
10864  *
10865  * @return objective sense of original problem
10866  *
10867  * @pre This method can be called if @p scip is in one of the following stages:
10868  * - \ref SCIP_STAGE_PROBLEM
10869  * - \ref SCIP_STAGE_TRANSFORMING
10870  * - \ref SCIP_STAGE_TRANSFORMED
10871  * - \ref SCIP_STAGE_INITPRESOLVE
10872  * - \ref SCIP_STAGE_PRESOLVING
10873  * - \ref SCIP_STAGE_EXITPRESOLVE
10874  * - \ref SCIP_STAGE_PRESOLVED
10875  * - \ref SCIP_STAGE_INITSOLVE
10876  * - \ref SCIP_STAGE_SOLVING
10877  * - \ref SCIP_STAGE_SOLVED
10878  * - \ref SCIP_STAGE_EXITSOLVE
10879  * - \ref SCIP_STAGE_FREETRANS
10880  */
10882  SCIP* scip /**< SCIP data structure */
10883  )
10884 {
10885  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjsense", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
10886 
10887  return scip->origprob->objsense;
10888 }
10889 
10890 /** sets objective sense of problem
10891  *
10892  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10893  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10894  *
10895  * @pre This method can be called if @p scip is in one of the following stages:
10896  * - \ref SCIP_STAGE_PROBLEM
10897  */
10899  SCIP* scip, /**< SCIP data structure */
10900  SCIP_OBJSENSE objsense /**< new objective sense */
10901  )
10902 {
10903  SCIP_CALL( checkStage(scip, "SCIPsetObjsense", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10904 
10905  if( objsense != SCIP_OBJSENSE_MAXIMIZE && objsense != SCIP_OBJSENSE_MINIMIZE )
10906  {
10907  SCIPerrorMessage("invalid objective sense\n");
10908  return SCIP_INVALIDDATA;
10909  }
10910 
10911  SCIPprobSetObjsense(scip->origprob, objsense);
10912 
10913  return SCIP_OKAY;
10914 }
10915 
10916 /** adds offset of objective function
10917  *
10918  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10919  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10920  *
10921  * @pre This method can be called if @p scip is in one of the following stages:
10922  * - \ref SCIP_STAGE_PRESOLVING
10923  */
10925  SCIP* scip, /**< SCIP data structure */
10926  SCIP_Real addval /**< value to add to objective offset */
10927  )
10928 {
10929  SCIP_CALL( checkStage(scip, "SCIPaddObjoffset", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10930 
10931  SCIPprobAddObjoffset(scip->transprob, addval);
10932  SCIP_CALL( SCIPprimalUpdateObjoffset(scip->primal, SCIPblkmem(scip), scip->set, scip->stat,
10933  scip->eventqueue, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
10934 
10935  return SCIP_OKAY;
10936 }
10937 
10938 /** adds offset of objective function to original problem and to all existing solution in original space
10939  *
10940  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
10941  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
10942  *
10943  * @pre This method can be called if @p scip is in one of the following stages:
10944  * - \ref SCIP_STAGE_PROBLEM
10945  */
10947  SCIP* scip, /**< SCIP data structure */
10948  SCIP_Real addval /**< value to add to objective offset */
10949  )
10950 {
10951  SCIP_CALL( checkStage(scip, "SCIPaddOrigObjoffset", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
10952 
10953  scip->origprob->objoffset += addval;
10954  SCIPprimalAddOrigObjoffset(scip->origprimal, scip->set, addval);
10955 
10956  return SCIP_OKAY;
10957 }
10958 
10959 /** returns the objective offset of the original problem
10960  *
10961  * @return the objective offset of the original problem
10962  *
10963  * @pre This method can be called if @p scip is in one of the following stages:
10964  * - \ref SCIP_STAGE_PROBLEM
10965  * - \ref SCIP_STAGE_TRANSFORMING
10966  * - \ref SCIP_STAGE_TRANSFORMED
10967  * - \ref SCIP_STAGE_INITPRESOLVE
10968  * - \ref SCIP_STAGE_PRESOLVING
10969  * - \ref SCIP_STAGE_EXITPRESOLVE
10970  * - \ref SCIP_STAGE_PRESOLVED
10971  * - \ref SCIP_STAGE_INITSOLVE
10972  * - \ref SCIP_STAGE_SOLVING
10973  * - \ref SCIP_STAGE_SOLVED
10974  */
10976  SCIP* scip /**< SCIP data structure */
10977  )
10978 {
10979  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjoffset", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
10980 
10981  return scip->origprob->objoffset;
10982 }
10983 
10984 /** returns the objective scale of the original problem
10985  *
10986  * @return the objective scale of the original problem
10987  *
10988  * @pre This method can be called if @p scip is in one of the following stages:
10989  * - \ref SCIP_STAGE_PROBLEM
10990  * - \ref SCIP_STAGE_TRANSFORMING
10991  * - \ref SCIP_STAGE_TRANSFORMED
10992  * - \ref SCIP_STAGE_INITPRESOLVE
10993  * - \ref SCIP_STAGE_PRESOLVING
10994  * - \ref SCIP_STAGE_EXITPRESOLVE
10995  * - \ref SCIP_STAGE_PRESOLVED
10996  * - \ref SCIP_STAGE_INITSOLVE
10997  * - \ref SCIP_STAGE_SOLVING
10998  * - \ref SCIP_STAGE_SOLVED
10999  */
11001  SCIP* scip /**< SCIP data structure */
11002  )
11003 {
11004  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigObjscale", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11005 
11006  return scip->origprob->objscale;
11007 }
11008 
11009 /** returns the objective offset of the transformed problem
11010  *
11011  * @return the objective offset of the transformed problem
11012  *
11013  * @pre This method can be called if @p scip is in one of the following stages:
11014  * - \ref SCIP_STAGE_TRANSFORMED
11015  * - \ref SCIP_STAGE_INITPRESOLVE
11016  * - \ref SCIP_STAGE_PRESOLVING
11017  * - \ref SCIP_STAGE_EXITPRESOLVE
11018  * - \ref SCIP_STAGE_PRESOLVED
11019  * - \ref SCIP_STAGE_INITSOLVE
11020  * - \ref SCIP_STAGE_SOLVING
11021  * - \ref SCIP_STAGE_SOLVED
11022  */
11024  SCIP* scip /**< SCIP data structure */
11025  )
11026 {
11027  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjoffset", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11028 
11029  return scip->transprob->objoffset;
11030 }
11031 
11032 /** returns the objective scale of the transformed problem
11033  *
11034  * @return the objective scale of the transformed problem
11035  *
11036  * @pre This method can be called if @p scip is in one of the following stages:
11037  * - \ref SCIP_STAGE_TRANSFORMED
11038  * - \ref SCIP_STAGE_INITPRESOLVE
11039  * - \ref SCIP_STAGE_PRESOLVING
11040  * - \ref SCIP_STAGE_EXITPRESOLVE
11041  * - \ref SCIP_STAGE_PRESOLVED
11042  * - \ref SCIP_STAGE_INITSOLVE
11043  * - \ref SCIP_STAGE_SOLVING
11044  * - \ref SCIP_STAGE_SOLVED
11045  */
11047  SCIP* scip /**< SCIP data structure */
11048  )
11049 {
11050  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransObjscale", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11051 
11052  return scip->transprob->objscale;
11053 }
11054 
11055 /** sets limit on objective function, such that only solutions better than this limit are accepted
11056  *
11057  * @note SCIP will only look for solutions with a strictly better objective value, thus, e.g., prune
11058  * all branch-and-bound nodes with dual bound equal or worse to the objective limit.
11059  * However, SCIP will also collect solutions with objective value worse than the objective limit and
11060  * use them to run improvement heuristics on them.
11061  * @note If SCIP can prove that there exists no solution with a strictly better objective value, the solving status
11062  * will normally be infeasible (the objective limit is interpreted as part of the problem).
11063  * The only exception is that by chance, SCIP found a solution with the same objective value and thus
11064  * proved the optimality of this solution, resulting in solution status optimal.
11065  *
11066  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11067  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11068  *
11069  * @pre This method can be called if @p scip is in one of the following stages:
11070  * - \ref SCIP_STAGE_PROBLEM
11071  * - \ref SCIP_STAGE_TRANSFORMED
11072  * - \ref SCIP_STAGE_INITPRESOLVE
11073  * - \ref SCIP_STAGE_PRESOLVING
11074  * - \ref SCIP_STAGE_EXITPRESOLVE
11075  * - \ref SCIP_STAGE_PRESOLVED
11076  * - \ref SCIP_STAGE_SOLVING
11077  */
11079  SCIP* scip, /**< SCIP data structure */
11080  SCIP_Real objlimit /**< new primal objective limit */
11081  )
11082 {
11083  SCIP_Real oldobjlimit;
11084 
11085  SCIP_CALL( checkStage(scip, "SCIPsetObjlimit", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11086 
11087  switch( scip->set->stage )
11088  {
11089  case SCIP_STAGE_PROBLEM:
11090  SCIPprobSetObjlim(scip->origprob, objlimit);
11091  break;
11094  case SCIP_STAGE_PRESOLVING:
11096  case SCIP_STAGE_PRESOLVED:
11097  case SCIP_STAGE_SOLVING:
11098  oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
11099  assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
11100  if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) )
11101  {
11102  SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g after problem was transformed\n", oldobjlimit, objlimit);
11103  return SCIP_INVALIDDATA;
11104  }
11105  SCIPprobSetObjlim(scip->origprob, objlimit);
11106  SCIPprobSetObjlim(scip->transprob, objlimit);
11107  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
11108  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
11109  break;
11110 
11111  default:
11112  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
11113  return SCIP_INVALIDCALL;
11114  } /*lint !e788*/
11115 
11116  return SCIP_OKAY;
11117 }
11118 
11119 /** returns current limit on objective function
11120  *
11121  * @return the current objective limit of the original problem
11122  *
11123  * @pre This method can be called if @p scip is in one of the following stages:
11124  * - \ref SCIP_STAGE_PROBLEM
11125  * - \ref SCIP_STAGE_TRANSFORMING
11126  * - \ref SCIP_STAGE_TRANSFORMED
11127  * - \ref SCIP_STAGE_INITPRESOLVE
11128  * - \ref SCIP_STAGE_PRESOLVING
11129  * - \ref SCIP_STAGE_EXITPRESOLVE
11130  * - \ref SCIP_STAGE_PRESOLVED
11131  * - \ref SCIP_STAGE_INITSOLVE
11132  * - \ref SCIP_STAGE_SOLVING
11133  * - \ref SCIP_STAGE_SOLVED
11134  */
11136  SCIP* scip /**< SCIP data structure */
11137  )
11138 {
11139  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjlimit", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11140 
11141  return SCIPprobGetObjlim(scip->origprob, scip->set);
11142 }
11143 
11144 /** informs SCIP, that the objective value is always integral in every feasible solution
11145  *
11146  * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
11147  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11148  *
11149  * @pre This method can be called if @p scip is in one of the following stages:
11150  * - \ref SCIP_STAGE_PROBLEM
11151  * - \ref SCIP_STAGE_TRANSFORMING
11152  * - \ref SCIP_STAGE_INITPRESOLVE
11153  * - \ref SCIP_STAGE_EXITPRESOLVE
11154  * - \ref SCIP_STAGE_SOLVING
11155  *
11156  * @note This function should be used to inform SCIP that the objective function is integral, helping to improve the
11157  * performance. This is useful when using column generation. If no column generation (pricing) is used, SCIP
11158  * automatically detects whether the objective function is integral or can be scaled to be integral. However, in
11159  * any case, the user has to make sure that no variable is added during the solving process that destroys this
11160  * property.
11161  */
11163  SCIP* scip /**< SCIP data structure */
11164  )
11165 {
11166  SCIP_CALL( checkStage(scip, "SCIPsetObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11167 
11168  switch( scip->set->stage )
11169  {
11170  case SCIP_STAGE_PROBLEM:
11172  return SCIP_OKAY;
11173 
11175  case SCIP_STAGE_PRESOLVING:
11176  case SCIP_STAGE_PRESOLVED:
11177  case SCIP_STAGE_SOLVING:
11179  return SCIP_OKAY;
11180 
11181  default:
11182  SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
11183  return SCIP_INVALIDCALL;
11184  } /*lint !e788*/
11185 }
11186 
11187 /** returns whether the objective value is known to be integral in every feasible solution
11188  *
11189  * @return TRUE, if objective value is known to be always integral, otherwise FALSE
11190  *
11191  * @pre This method can be called if @p scip is in one of the following stages:
11192  * - \ref SCIP_STAGE_PROBLEM
11193  * - \ref SCIP_STAGE_TRANSFORMING
11194  * - \ref SCIP_STAGE_INITPRESOLVE
11195  * - \ref SCIP_STAGE_PRESOLVING
11196  * - \ref SCIP_STAGE_EXITPRESOLVE
11197  * - \ref SCIP_STAGE_PRESOLVED
11198  * - \ref SCIP_STAGE_SOLVING
11199  *
11200  * @note If no pricing is performed, SCIP automatically detects whether the objective function is integral or can be
11201  * scaled to be integral, helping to improve performance. This function returns the result. Otherwise
11202  * SCIPsetObjIntegral() can be used to inform SCIP. However, in any case, the user has to make sure that no
11203  * variable is added during the solving process that destroys this property.
11204  */
11206  SCIP* scip /**< SCIP data structure */
11207  )
11208 {
11209  int v;
11210 
11211  SCIP_CALL_ABORT( checkStage(scip, "SCIPisObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11212 
11213  switch( scip->set->stage )
11214  {
11215  case SCIP_STAGE_PROBLEM:
11216  /* if the user explicitly added the information that there is an integral objective, return TRUE */
11217  if( SCIPprobIsObjIntegral(scip->origprob) )
11218  return TRUE;
11219 
11220  /* if there exist unknown variables, we cannot conclude that the objective value is always integral */
11221  if ( scip->set->nactivepricers != 0 )
11222  return FALSE;
11223 
11224  /* if the objective value offset is fractional, the value itself is possibly fractional */
11225  if ( ! SCIPisIntegral(scip, scip->origprob->objoffset) )
11226  return FALSE;
11227 
11228  /* scan through the variables */
11229  for (v = 0; v < scip->origprob->nvars; ++v)
11230  {
11231  SCIP_Real obj;
11232 
11233  /* get objective value of variable */
11234  obj = SCIPvarGetObj(scip->origprob->vars[v]);
11235 
11236  /* check, if objective value is non-zero */
11237  if ( ! SCIPisZero(scip, obj) )
11238  {
11239  /* if variable's objective value is fractional, the problem's objective value may also be fractional */
11240  if ( ! SCIPisIntegral(scip, obj) )
11241  break;
11242 
11243  /* if variable with non-zero objective value is continuous, the problem's objective value may be fractional */
11245  break;
11246  }
11247  }
11248 
11249  /* we do not store the result, since we assume that the original problem might be changed */
11250  if ( v == scip->origprob->nvars )
11251  return TRUE;
11252  return FALSE;
11253 
11256  case SCIP_STAGE_PRESOLVING:
11258  case SCIP_STAGE_PRESOLVED:
11259  case SCIP_STAGE_SOLVING:
11260  return SCIPprobIsObjIntegral(scip->transprob);
11261 
11262  default:
11263  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11264  SCIPABORT();
11265  return FALSE; /*lint !e527*/
11266  } /*lint !e788*/
11267 }
11268 
11269 /** returns the Euclidean norm of the objective function vector (available only for transformed problem)
11270  *
11271  * @return the Euclidean norm of the transformed objective function vector
11272  *
11273  * @pre This method can be called if @p scip is in one of the following stages:
11274  * - \ref SCIP_STAGE_TRANSFORMED
11275  * - \ref SCIP_STAGE_INITPRESOLVE
11276  * - \ref SCIP_STAGE_PRESOLVING
11277  * - \ref SCIP_STAGE_EXITPRESOLVE
11278  * - \ref SCIP_STAGE_PRESOLVED
11279  * - \ref SCIP_STAGE_INITSOLVE
11280  * - \ref SCIP_STAGE_SOLVING
11281  * - \ref SCIP_STAGE_SOLVED
11282  * - \ref SCIP_STAGE_EXITSOLVE
11283  */
11285  SCIP* scip /**< SCIP data structure */
11286  )
11287 {
11288  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetObjNorm", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11289 
11290  if( scip->lp->objsqrnormunreliable )
11291  SCIPlpRecalculateObjSqrNorm(scip->set, scip->lp);
11292  assert(!scip->lp->objsqrnormunreliable);
11293 
11294  return SCIPlpGetObjNorm(scip->lp);
11295 }
11296 
11297 /** adds variable to the problem
11298  *
11299  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11300  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11301  *
11302  * @pre This method can be called if @p scip is in one of the following stages:
11303  * - \ref SCIP_STAGE_PROBLEM
11304  * - \ref SCIP_STAGE_TRANSFORMING
11305  * - \ref SCIP_STAGE_INITPRESOLVE
11306  * - \ref SCIP_STAGE_PRESOLVING
11307  * - \ref SCIP_STAGE_EXITPRESOLVE
11308  * - \ref SCIP_STAGE_PRESOLVED
11309  * - \ref SCIP_STAGE_SOLVING
11310  */
11312  SCIP* scip, /**< SCIP data structure */
11313  SCIP_VAR* var /**< variable to add */
11314  )
11315 {
11316  SCIP_CALL( checkStage(scip, "SCIPaddVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11317 
11318  /* avoid inserting the same variable twice */
11319  if( SCIPvarGetProbindex(var) != -1 )
11320  return SCIP_OKAY;
11321 
11322  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
11324  {
11325  assert(SCIPvarGetNegationVar(var) != NULL);
11327  return SCIP_OKAY;
11328  }
11329 
11330  switch( scip->set->stage )
11331  {
11332  case SCIP_STAGE_PROBLEM:
11334  {
11335  SCIPerrorMessage("cannot add transformed variables to original problem\n");
11336  return SCIP_INVALIDDATA;
11337  }
11338  SCIP_CALL( SCIPprobAddVar(scip->origprob, scip->mem->probmem, scip->set, scip->lp, scip->branchcand,
11339  scip->eventfilter, scip->eventqueue, var) );
11340  return SCIP_OKAY;
11341 
11344  case SCIP_STAGE_PRESOLVING:
11346  case SCIP_STAGE_PRESOLVED:
11347  case SCIP_STAGE_SOLVING:
11348  /* check variable's status */
11350  {
11351  SCIPerrorMessage("cannot add original variables to transformed problem\n");
11352  return SCIP_INVALIDDATA;
11353  }
11355  {
11356  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
11357  return SCIP_INVALIDDATA;
11358  }
11359  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
11360  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
11361  return SCIP_OKAY;
11362 
11363  default:
11364  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11365  return SCIP_INVALIDCALL;
11366  } /*lint !e788*/
11367 }
11368 
11369 /** adds variable to the problem and uses it as pricing candidate to enter the LP
11370  *
11371  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11372  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11373  *
11374  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
11375  */
11377  SCIP* scip, /**< SCIP data structure */
11378  SCIP_VAR* var, /**< variable to add */
11379  SCIP_Real score /**< pricing score of variable (the larger, the better the variable) */
11380  )
11381 {
11382  SCIP_CALL( checkStage(scip, "SCIPaddPricedVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
11383 
11384  /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
11386  {
11387  assert(SCIPvarGetNegationVar(var) != NULL);
11388  SCIP_CALL( SCIPaddPricedVar(scip, SCIPvarGetNegationVar(var), score) );
11389  return SCIP_OKAY;
11390  }
11391 
11392  /* add variable to problem if not yet inserted */
11393  if( SCIPvarGetProbindex(var) == -1 )
11394  {
11395  /* check variable's status */
11397  {
11398  SCIPerrorMessage("cannot add original variables to transformed problem\n");
11399  return SCIP_INVALIDDATA;
11400  }
11402  {
11403  SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
11404  return SCIP_INVALIDDATA;
11405  }
11406  SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
11407  scip->branchcand, scip->eventfilter, scip->eventqueue, var) );
11408  }
11409 
11410  /* add variable to pricing storage */
11411  SCIP_CALL( SCIPpricestoreAddVar(scip->pricestore, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, var, score,
11412  (SCIPtreeGetCurrentDepth(scip->tree) == 0)) );
11413 
11414  return SCIP_OKAY;
11415 }
11416 
11417 /** removes variable from the problem
11418  *
11419  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11420  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11421  *
11422  * @pre This method can be called if @p scip is in one of the following stages:
11423  * - \ref SCIP_STAGE_PROBLEM
11424  * - \ref SCIP_STAGE_TRANSFORMING
11425  * - \ref SCIP_STAGE_TRANSFORMED
11426  * - \ref SCIP_STAGE_PRESOLVING
11427  * - \ref SCIP_STAGE_FREETRANS
11428  */
11430  SCIP* scip, /**< SCIP data structure */
11431  SCIP_VAR* var, /**< variable to delete */
11432  SCIP_Bool* deleted /**< pointer to store whether marking variable to be deleted was successful */
11433  )
11434 {
11435  assert(scip != NULL);
11436  assert(var != NULL);
11437  assert(deleted != NULL);
11438 
11439  SCIP_CALL( checkStage(scip, "SCIPdelVar", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE) );
11440 
11441  switch( scip->set->stage )
11442  {
11443  case SCIP_STAGE_PROBLEM:
11445  {
11446  SCIPerrorMessage("cannot remove transformed variables from original problem\n");
11447  return SCIP_INVALIDDATA;
11448  }
11449  SCIP_CALL( SCIPprobDelVar(scip->origprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
11450 
11451  /* delete the variables from the problems that were marked to be deleted */
11452  SCIP_CALL( SCIPprobPerformVarDeletions(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
11453 
11454  return SCIP_OKAY;
11455 
11458  case SCIP_STAGE_PRESOLVING:
11459  /* check variable's status */
11461  {
11462  SCIPerrorMessage("cannot remove original variables from transformed problem\n");
11463  return SCIP_INVALIDDATA;
11464  }
11466  {
11467  SCIPerrorMessage("cannot remove fixed or aggregated variables from transformed problem\n");
11468  return SCIP_INVALIDDATA;
11469  }
11470 
11471  SCIP_CALL( SCIPprobDelVar(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
11472 
11473  return SCIP_OKAY;
11474  case SCIP_STAGE_FREETRANS:
11475  /* in FREETRANS stage, we don't need to remove the variable, because the transformed problem is freed anyways */
11476  *deleted = FALSE;
11477 
11478  return SCIP_OKAY;
11479  default:
11480  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11481  return SCIP_INVALIDCALL;
11482  } /*lint !e788*/
11483 }
11484 
11485 /** gets variables of the problem along with the numbers of different variable types; data may become invalid after
11486  * calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
11487  *
11488  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11489  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11490  *
11491  * @pre This method can be called if @p scip is in one of the following stages:
11492  * - \ref SCIP_STAGE_PROBLEM
11493  * - \ref SCIP_STAGE_TRANSFORMED
11494  * - \ref SCIP_STAGE_INITPRESOLVE
11495  * - \ref SCIP_STAGE_PRESOLVING
11496  * - \ref SCIP_STAGE_EXITPRESOLVE
11497  * - \ref SCIP_STAGE_PRESOLVED
11498  * - \ref SCIP_STAGE_INITSOLVE
11499  * - \ref SCIP_STAGE_SOLVING
11500  * - \ref SCIP_STAGE_SOLVED
11501  * - \ref SCIP_STAGE_EXITSOLVE
11502  *
11503  * @note Variables in the vars array are ordered: binaries first, then integers, implicit integers and continuous last.
11504  */
11506  SCIP* scip, /**< SCIP data structure */
11507  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
11508  int* nvars, /**< pointer to store number of variables or NULL if not needed */
11509  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
11510  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
11511  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
11512  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
11513  )
11514 {
11515  SCIP_CALL( checkStage(scip, "SCIPgetVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11516 
11517  switch( scip->set->stage )
11518  {
11519  case SCIP_STAGE_PROBLEM:
11520  if( vars != NULL )
11521  *vars = scip->origprob->vars;
11522  if( nvars != NULL )
11523  *nvars = scip->origprob->nvars;
11524  if( nbinvars != NULL )
11525  *nbinvars = scip->origprob->nbinvars;
11526  if( nintvars != NULL )
11527  *nintvars = scip->origprob->nintvars;
11528  if( nimplvars != NULL )
11529  *nimplvars = scip->origprob->nimplvars;
11530  if( ncontvars != NULL )
11531  *ncontvars = scip->origprob->ncontvars;
11532  return SCIP_OKAY;
11533 
11536  case SCIP_STAGE_PRESOLVING:
11538  case SCIP_STAGE_PRESOLVED:
11539  case SCIP_STAGE_INITSOLVE:
11540  case SCIP_STAGE_SOLVING:
11541  case SCIP_STAGE_SOLVED:
11542  case SCIP_STAGE_EXITSOLVE:
11543  if( vars != NULL )
11544  *vars = scip->transprob->vars;
11545  if( nvars != NULL )
11546  *nvars = scip->transprob->nvars;
11547  if( nbinvars != NULL )
11548  *nbinvars = scip->transprob->nbinvars;
11549  if( nintvars != NULL )
11550  *nintvars = scip->transprob->nintvars;
11551  if( nimplvars != NULL )
11552  *nimplvars = scip->transprob->nimplvars;
11553  if( ncontvars != NULL )
11554  *ncontvars = scip->transprob->ncontvars;
11555  return SCIP_OKAY;
11556 
11557  default:
11558  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11559  return SCIP_INVALIDCALL;
11560  } /*lint !e788*/
11561 }
11562 
11563 /** gets array with active problem variables
11564  *
11565  * @return array with active problem variables
11566  *
11567  * @pre This method can be called if @p scip is in one of the following stages:
11568  * - \ref SCIP_STAGE_PROBLEM
11569  * - \ref SCIP_STAGE_TRANSFORMED
11570  * - \ref SCIP_STAGE_INITPRESOLVE
11571  * - \ref SCIP_STAGE_PRESOLVING
11572  * - \ref SCIP_STAGE_EXITPRESOLVE
11573  * - \ref SCIP_STAGE_PRESOLVED
11574  * - \ref SCIP_STAGE_INITSOLVE
11575  * - \ref SCIP_STAGE_SOLVING
11576  * - \ref SCIP_STAGE_SOLVED
11577  * - \ref SCIP_STAGE_EXITSOLVE
11578  *
11579  * @note Variables in the array are ordered: binaries first, then integers, implicit integers and continuous last.
11580  *
11581  * @warning If your are using the methods which add or change bound of variables (e.g., SCIPchgVarType(), SCIPfixVar(),
11582  * SCIPaggregateVars(), and SCIPmultiaggregateVar()), it can happen that the internal variable array (which is
11583  * accessed via this method) gets resized and/or resorted. This can invalid the data pointer which is returned
11584  * by this method.
11585  */
11587  SCIP* scip /**< SCIP data structure */
11588  )
11589 {
11590  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11591 
11592  switch( scip->set->stage )
11593  {
11594  case SCIP_STAGE_PROBLEM:
11595  return scip->origprob->vars;
11596 
11599  case SCIP_STAGE_PRESOLVING:
11601  case SCIP_STAGE_PRESOLVED:
11602  case SCIP_STAGE_INITSOLVE:
11603  case SCIP_STAGE_SOLVING:
11604  case SCIP_STAGE_SOLVED:
11605  case SCIP_STAGE_EXITSOLVE:
11606  return scip->transprob->vars;
11607 
11608  default:
11609  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11610  SCIPABORT();
11611  return NULL; /*lint !e527*/
11612  } /*lint !e788*/
11613 }
11614 
11615 /** gets number of active problem variables
11616  *
11617  * @return the number of active problem variables
11618  *
11619  * @pre This method can be called if @p scip is in one of the following stages:
11620  * - \ref SCIP_STAGE_PROBLEM
11621  * - \ref SCIP_STAGE_TRANSFORMED
11622  * - \ref SCIP_STAGE_INITPRESOLVE
11623  * - \ref SCIP_STAGE_PRESOLVING
11624  * - \ref SCIP_STAGE_EXITPRESOLVE
11625  * - \ref SCIP_STAGE_PRESOLVED
11626  * - \ref SCIP_STAGE_INITSOLVE
11627  * - \ref SCIP_STAGE_SOLVING
11628  * - \ref SCIP_STAGE_SOLVED
11629  * - \ref SCIP_STAGE_EXITSOLVE
11630  */
11632  SCIP* scip /**< SCIP data structure */
11633  )
11634 {
11635  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11636 
11637  switch( scip->set->stage )
11638  {
11639  case SCIP_STAGE_PROBLEM:
11640  return scip->origprob->nvars;
11641 
11644  case SCIP_STAGE_PRESOLVING:
11646  case SCIP_STAGE_PRESOLVED:
11647  case SCIP_STAGE_INITSOLVE:
11648  case SCIP_STAGE_SOLVING:
11649  case SCIP_STAGE_SOLVED:
11650  case SCIP_STAGE_EXITSOLVE:
11651  return scip->transprob->nvars;
11652 
11653  default:
11654  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11655  SCIPABORT();
11656  return 0; /*lint !e527*/
11657  } /*lint !e788*/
11658 }
11659 
11660 /** gets number of binary active problem variables
11661  *
11662  * @return the number of binary active problem variables
11663  *
11664  * @pre This method can be called if @p scip is in one of the following stages:
11665  * - \ref SCIP_STAGE_PROBLEM
11666  * - \ref SCIP_STAGE_TRANSFORMED
11667  * - \ref SCIP_STAGE_INITPRESOLVE
11668  * - \ref SCIP_STAGE_PRESOLVING
11669  * - \ref SCIP_STAGE_EXITPRESOLVE
11670  * - \ref SCIP_STAGE_PRESOLVED
11671  * - \ref SCIP_STAGE_INITSOLVE
11672  * - \ref SCIP_STAGE_SOLVING
11673  * - \ref SCIP_STAGE_SOLVED
11674  * - \ref SCIP_STAGE_EXITSOLVE
11675  */
11677  SCIP* scip /**< SCIP data structure */
11678  )
11679 {
11680  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBinVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11681 
11682  switch( scip->set->stage )
11683  {
11684  case SCIP_STAGE_PROBLEM:
11685  return scip->origprob->nbinvars;
11686 
11689  case SCIP_STAGE_PRESOLVING:
11691  case SCIP_STAGE_PRESOLVED:
11692  case SCIP_STAGE_INITSOLVE:
11693  case SCIP_STAGE_SOLVING:
11694  case SCIP_STAGE_SOLVED:
11695  case SCIP_STAGE_EXITSOLVE:
11696  return scip->transprob->nbinvars;
11697 
11698  default:
11699  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11700  SCIPABORT();
11701  return 0; /*lint !e527*/
11702  } /*lint !e788*/
11703 }
11704 
11705 /** gets number of integer active problem variables
11706  *
11707  * @return the number of integer active problem variables
11708  *
11709  * @pre This method can be called if @p scip is in one of the following stages:
11710  * - \ref SCIP_STAGE_PROBLEM
11711  * - \ref SCIP_STAGE_TRANSFORMED
11712  * - \ref SCIP_STAGE_INITPRESOLVE
11713  * - \ref SCIP_STAGE_PRESOLVING
11714  * - \ref SCIP_STAGE_EXITPRESOLVE
11715  * - \ref SCIP_STAGE_PRESOLVED
11716  * - \ref SCIP_STAGE_INITSOLVE
11717  * - \ref SCIP_STAGE_SOLVING
11718  * - \ref SCIP_STAGE_SOLVED
11719  * - \ref SCIP_STAGE_EXITSOLVE
11720  */
11722  SCIP* scip /**< SCIP data structure */
11723  )
11724 {
11725  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNIntVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11726 
11727  switch( scip->set->stage )
11728  {
11729  case SCIP_STAGE_PROBLEM:
11730  return scip->origprob->nintvars;
11731 
11734  case SCIP_STAGE_PRESOLVING:
11736  case SCIP_STAGE_PRESOLVED:
11737  case SCIP_STAGE_INITSOLVE:
11738  case SCIP_STAGE_SOLVING:
11739  case SCIP_STAGE_SOLVED:
11740  case SCIP_STAGE_EXITSOLVE:
11741  return scip->transprob->nintvars;
11742 
11743  default:
11744  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11745  SCIPABORT();
11746  return 0; /*lint !e527*/
11747  } /*lint !e788*/
11748 }
11749 
11750 /** gets number of implicit integer active problem variables
11751  *
11752  * @return the number of implicit integer active problem variables
11753  *
11754  * @pre This method can be called if @p scip is in one of the following stages:
11755  * - \ref SCIP_STAGE_PROBLEM
11756  * - \ref SCIP_STAGE_TRANSFORMED
11757  * - \ref SCIP_STAGE_INITPRESOLVE
11758  * - \ref SCIP_STAGE_PRESOLVING
11759  * - \ref SCIP_STAGE_EXITPRESOLVE
11760  * - \ref SCIP_STAGE_PRESOLVED
11761  * - \ref SCIP_STAGE_INITSOLVE
11762  * - \ref SCIP_STAGE_SOLVING
11763  * - \ref SCIP_STAGE_SOLVED
11764  * - \ref SCIP_STAGE_EXITSOLVE
11765  */
11767  SCIP* scip /**< SCIP data structure */
11768  )
11769 {
11770  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11771 
11772  switch( scip->set->stage )
11773  {
11774  case SCIP_STAGE_PROBLEM:
11775  return scip->origprob->nimplvars;
11776 
11779  case SCIP_STAGE_PRESOLVING:
11781  case SCIP_STAGE_PRESOLVED:
11782  case SCIP_STAGE_INITSOLVE:
11783  case SCIP_STAGE_SOLVING:
11784  case SCIP_STAGE_SOLVED:
11785  case SCIP_STAGE_EXITSOLVE:
11786  return scip->transprob->nimplvars;
11787 
11788  default:
11789  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11790  SCIPABORT();
11791  return 0; /*lint !e527*/
11792  } /*lint !e788*/
11793 }
11794 
11795 /** gets number of continuous active problem variables
11796  *
11797  * @return the number of continuous active problem variables
11798  *
11799  * @pre This method can be called if @p scip is in one of the following stages:
11800  * - \ref SCIP_STAGE_PROBLEM
11801  * - \ref SCIP_STAGE_TRANSFORMED
11802  * - \ref SCIP_STAGE_INITPRESOLVE
11803  * - \ref SCIP_STAGE_PRESOLVING
11804  * - \ref SCIP_STAGE_EXITPRESOLVE
11805  * - \ref SCIP_STAGE_PRESOLVED
11806  * - \ref SCIP_STAGE_INITSOLVE
11807  * - \ref SCIP_STAGE_SOLVING
11808  * - \ref SCIP_STAGE_SOLVED
11809  * - \ref SCIP_STAGE_EXITSOLVE
11810  */
11812  SCIP* scip /**< SCIP data structure */
11813  )
11814 {
11815  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNContVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
11816 
11817  switch( scip->set->stage )
11818  {
11819  case SCIP_STAGE_PROBLEM:
11820  return scip->origprob->ncontvars;
11821 
11824  case SCIP_STAGE_PRESOLVING:
11826  case SCIP_STAGE_PRESOLVED:
11827  case SCIP_STAGE_INITSOLVE:
11828  case SCIP_STAGE_SOLVING:
11829  case SCIP_STAGE_SOLVED:
11830  case SCIP_STAGE_EXITSOLVE:
11831  return scip->transprob->ncontvars;
11832 
11833  default:
11834  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11835  SCIPABORT();
11836  return 0; /*lint !e527*/
11837  } /*lint !e788*/
11838 }
11839 
11840 
11841 /** gets number of active problem variables with a non-zero objective coefficient
11842  *
11843  * @note In case of the original problem the number of variables is counted. In case of the transformed problem the
11844  * number of variables is just returned since it is stored internally
11845  *
11846  * @return the number of active problem variables with a non-zero objective coefficient
11847  *
11848  * @pre This method can be called if @p scip is in one of the following stages:
11849  * - \ref SCIP_STAGE_PROBLEM
11850  * - \ref SCIP_STAGE_TRANSFORMED
11851  * - \ref SCIP_STAGE_INITPRESOLVE
11852  * - \ref SCIP_STAGE_PRESOLVING
11853  * - \ref SCIP_STAGE_EXITPRESOLVE
11854  * - \ref SCIP_STAGE_PRESOLVED
11855  * - \ref SCIP_STAGE_INITSOLVE
11856  * - \ref SCIP_STAGE_SOLVING
11857  * - \ref SCIP_STAGE_SOLVED
11858  */
11860  SCIP* scip /**< SCIP data structure */
11861  )
11862 {
11863  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNObjVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11864 
11865  switch( scip->set->stage )
11866  {
11867  case SCIP_STAGE_PROBLEM:
11868  return SCIPprobGetNObjVars(scip->origprob, scip->set);
11869 
11872  case SCIP_STAGE_PRESOLVING:
11874  case SCIP_STAGE_PRESOLVED:
11875  case SCIP_STAGE_INITSOLVE:
11876  case SCIP_STAGE_SOLVING:
11877  case SCIP_STAGE_SOLVED:
11878  return SCIPprobGetNObjVars(scip->transprob, scip->set);
11879 
11880  default:
11881  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11882  SCIPABORT();
11883  return 0; /*lint !e527*/
11884  } /*lint !e788*/
11885 }
11886 
11887 
11888 /** gets array with fixed and aggregated problem variables; data may become invalid after
11889  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
11890  *
11891  * @return an array with fixed and aggregated problem variables; data may become invalid after
11892  * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
11893  *
11894  * @pre This method can be called if @p scip is in one of the following stages:
11895  * - \ref SCIP_STAGE_PROBLEM
11896  * - \ref SCIP_STAGE_TRANSFORMED
11897  * - \ref SCIP_STAGE_INITPRESOLVE
11898  * - \ref SCIP_STAGE_PRESOLVING
11899  * - \ref SCIP_STAGE_EXITPRESOLVE
11900  * - \ref SCIP_STAGE_PRESOLVED
11901  * - \ref SCIP_STAGE_INITSOLVE
11902  * - \ref SCIP_STAGE_SOLVING
11903  * - \ref SCIP_STAGE_SOLVED
11904  */
11906  SCIP* scip /**< SCIP data structure */
11907  )
11908 {
11909  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11910 
11911  switch( scip->set->stage )
11912  {
11913  case SCIP_STAGE_PROBLEM:
11914  return NULL;
11915 
11918  case SCIP_STAGE_PRESOLVING:
11920  case SCIP_STAGE_PRESOLVED:
11921  case SCIP_STAGE_INITSOLVE:
11922  case SCIP_STAGE_SOLVING:
11923  case SCIP_STAGE_SOLVED:
11924  return scip->transprob->fixedvars;
11925 
11926  default:
11927  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11928  SCIPABORT();
11929  return NULL; /*lint !e527*/
11930  } /*lint !e788*/
11931 }
11932 
11933 /** gets number of fixed or aggregated problem variables
11934  *
11935  * @return the number of fixed or aggregated problem variables
11936  *
11937  * @pre This method can be called if @p scip is in one of the following stages:
11938  * - \ref SCIP_STAGE_PROBLEM
11939  * - \ref SCIP_STAGE_TRANSFORMED
11940  * - \ref SCIP_STAGE_INITPRESOLVE
11941  * - \ref SCIP_STAGE_PRESOLVING
11942  * - \ref SCIP_STAGE_EXITPRESOLVE
11943  * - \ref SCIP_STAGE_PRESOLVED
11944  * - \ref SCIP_STAGE_INITSOLVE
11945  * - \ref SCIP_STAGE_SOLVING
11946  * - \ref SCIP_STAGE_SOLVED
11947  */
11949  SCIP* scip /**< SCIP data structure */
11950  )
11951 {
11952  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNFixedVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
11953 
11954  switch( scip->set->stage )
11955  {
11956  case SCIP_STAGE_PROBLEM:
11957  return 0;
11958 
11961  case SCIP_STAGE_PRESOLVING:
11963  case SCIP_STAGE_PRESOLVED:
11964  case SCIP_STAGE_INITSOLVE:
11965  case SCIP_STAGE_SOLVING:
11966  case SCIP_STAGE_SOLVED:
11967  return scip->transprob->nfixedvars;
11968 
11969  default:
11970  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
11971  SCIPABORT();
11972  return 0; /*lint !e527*/
11973  } /*lint !e788*/
11974 }
11975 
11976 /** gets variables of the original problem along with the numbers of different variable types; data may become invalid
11977  * after a call to SCIPchgVarType()
11978  *
11979  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
11980  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
11981  *
11982  * @pre This method can be called if @p scip is in one of the following stages:
11983  * - \ref SCIP_STAGE_PROBLEM
11984  * - \ref SCIP_STAGE_TRANSFORMING
11985  * - \ref SCIP_STAGE_TRANSFORMED
11986  * - \ref SCIP_STAGE_INITPRESOLVE
11987  * - \ref SCIP_STAGE_PRESOLVING
11988  * - \ref SCIP_STAGE_EXITPRESOLVE
11989  * - \ref SCIP_STAGE_PRESOLVED
11990  * - \ref SCIP_STAGE_INITSOLVE
11991  * - \ref SCIP_STAGE_SOLVING
11992  * - \ref SCIP_STAGE_SOLVED
11993  * - \ref SCIP_STAGE_EXITSOLVE
11994  * - \ref SCIP_STAGE_FREETRANS
11995  */
11997  SCIP* scip, /**< SCIP data structure */
11998  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
11999  int* nvars, /**< pointer to store number of variables or NULL if not needed */
12000  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
12001  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
12002  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
12003  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
12004  )
12005 {
12006  SCIP_CALL( checkStage(scip, "SCIPgetOrigVarsData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12007 
12008  if( vars != NULL )
12009  *vars = scip->origprob->vars;
12010  if( nvars != NULL )
12011  *nvars = scip->origprob->nvars;
12012  if( nbinvars != NULL )
12013  *nbinvars = scip->origprob->nbinvars;
12014  if( nintvars != NULL )
12015  *nintvars = scip->origprob->nintvars;
12016  if( nimplvars != NULL )
12017  *nimplvars = scip->origprob->nimplvars;
12018  if( ncontvars != NULL )
12019  *ncontvars = scip->origprob->ncontvars;
12020 
12021  return SCIP_OKAY;
12022 }
12023 
12024 /** gets array with original problem variables; data may become invalid after
12025  * a call to SCIPchgVarType()
12026  *
12027  * @return an array with original problem variables; data may become invalid after
12028  * a call to SCIPchgVarType()
12029  *
12030  * @pre This method can be called if @p scip is in one of the following stages:
12031  * - \ref SCIP_STAGE_PROBLEM
12032  * - \ref SCIP_STAGE_TRANSFORMING
12033  * - \ref SCIP_STAGE_TRANSFORMED
12034  * - \ref SCIP_STAGE_INITPRESOLVE
12035  * - \ref SCIP_STAGE_PRESOLVING
12036  * - \ref SCIP_STAGE_EXITPRESOLVE
12037  * - \ref SCIP_STAGE_PRESOLVED
12038  * - \ref SCIP_STAGE_INITSOLVE
12039  * - \ref SCIP_STAGE_SOLVING
12040  * - \ref SCIP_STAGE_SOLVED
12041  * - \ref SCIP_STAGE_EXITSOLVE
12042  * - \ref SCIP_STAGE_FREETRANS
12043  */
12045  SCIP* scip /**< SCIP data structure */
12046  )
12047 {
12048  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12049 
12050  return scip->origprob->vars;
12051 }
12052 
12053 /** gets number of original problem variables
12054  *
12055  * @return the number of original problem variables
12056  *
12057  * @pre This method can be called if @p scip is in one of the following stages:
12058  * - \ref SCIP_STAGE_PROBLEM
12059  * - \ref SCIP_STAGE_TRANSFORMING
12060  * - \ref SCIP_STAGE_TRANSFORMED
12061  * - \ref SCIP_STAGE_INITPRESOLVE
12062  * - \ref SCIP_STAGE_PRESOLVING
12063  * - \ref SCIP_STAGE_EXITPRESOLVE
12064  * - \ref SCIP_STAGE_PRESOLVED
12065  * - \ref SCIP_STAGE_INITSOLVE
12066  * - \ref SCIP_STAGE_SOLVING
12067  * - \ref SCIP_STAGE_SOLVED
12068  * - \ref SCIP_STAGE_EXITSOLVE
12069  * - \ref SCIP_STAGE_FREETRANS
12070  */
12072  SCIP* scip /**< SCIP data structure */
12073  )
12074 {
12075  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12076 
12077  return scip->origprob->nvars;
12078 }
12079 
12080 /** gets number of binary variables in the original problem
12081  *
12082  * @return the number of binary variables in the original problem
12083  *
12084  * @pre This method can be called if @p scip is in one of the following stages:
12085  * - \ref SCIP_STAGE_PROBLEM
12086  * - \ref SCIP_STAGE_TRANSFORMING
12087  * - \ref SCIP_STAGE_TRANSFORMED
12088  * - \ref SCIP_STAGE_INITPRESOLVE
12089  * - \ref SCIP_STAGE_PRESOLVING
12090  * - \ref SCIP_STAGE_EXITPRESOLVE
12091  * - \ref SCIP_STAGE_PRESOLVED
12092  * - \ref SCIP_STAGE_INITSOLVE
12093  * - \ref SCIP_STAGE_SOLVING
12094  * - \ref SCIP_STAGE_SOLVED
12095  * - \ref SCIP_STAGE_EXITSOLVE
12096  * - \ref SCIP_STAGE_FREETRANS
12097  */
12099  SCIP* scip /**< SCIP data structure */
12100  )
12101 {
12102  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigBinVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12103 
12104  return scip->origprob->nbinvars;
12105 }
12106 
12107 /** gets the number of integer variables in the original problem
12108  *
12109  * @return the number of integer variables in the original problem
12110  *
12111  * @pre This method can be called if @p scip is in one of the following stages:
12112  * - \ref SCIP_STAGE_PROBLEM
12113  * - \ref SCIP_STAGE_TRANSFORMING
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  * - \ref SCIP_STAGE_EXITSOLVE
12123  * - \ref SCIP_STAGE_FREETRANS
12124  */
12126  SCIP* scip /**< SCIP data structure */
12127  )
12128 {
12129  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigIntVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12130 
12131  return scip->origprob->nintvars;
12132 }
12133 
12134 /** gets number of implicit integer variables in the original problem
12135  *
12136  * @return the number of implicit integer variables in the original problem
12137  *
12138  * @pre This method can be called if @p scip is in one of the following stages:
12139  * - \ref SCIP_STAGE_PROBLEM
12140  * - \ref SCIP_STAGE_TRANSFORMING
12141  * - \ref SCIP_STAGE_TRANSFORMED
12142  * - \ref SCIP_STAGE_INITPRESOLVE
12143  * - \ref SCIP_STAGE_PRESOLVING
12144  * - \ref SCIP_STAGE_EXITPRESOLVE
12145  * - \ref SCIP_STAGE_PRESOLVED
12146  * - \ref SCIP_STAGE_INITSOLVE
12147  * - \ref SCIP_STAGE_SOLVING
12148  * - \ref SCIP_STAGE_SOLVED
12149  * - \ref SCIP_STAGE_EXITSOLVE
12150  * - \ref SCIP_STAGE_FREETRANS
12151  */
12153  SCIP* scip /**< SCIP data structure */
12154  )
12155 {
12156  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12157 
12158  return scip->origprob->nimplvars;
12159 }
12160 
12161 /** gets number of continuous variables in the original problem
12162  *
12163  * @return the number of continuous variables in the original problem
12164  *
12165  * @pre This method can be called if @p scip is in one of the following stages:
12166  * - \ref SCIP_STAGE_PROBLEM
12167  * - \ref SCIP_STAGE_TRANSFORMING
12168  * - \ref SCIP_STAGE_TRANSFORMED
12169  * - \ref SCIP_STAGE_INITPRESOLVE
12170  * - \ref SCIP_STAGE_PRESOLVING
12171  * - \ref SCIP_STAGE_EXITPRESOLVE
12172  * - \ref SCIP_STAGE_PRESOLVED
12173  * - \ref SCIP_STAGE_INITSOLVE
12174  * - \ref SCIP_STAGE_SOLVING
12175  * - \ref SCIP_STAGE_SOLVED
12176  * - \ref SCIP_STAGE_EXITSOLVE
12177  * - \ref SCIP_STAGE_FREETRANS
12178  */
12180  SCIP* scip /**< SCIP data structure */
12181  )
12182 {
12183  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigContVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12184 
12185  return scip->origprob->ncontvars;
12186 }
12187 
12188 /** gets number of all problem variables created during creation and solving of problem;
12189  * this includes also variables that were deleted in the meantime
12190  *
12191  * @return the number of all problem variables created during creation and solving of problem;
12192  * this includes also variables that were deleted in the meantime
12193  *
12194  * @pre This method can be called if @p scip is in one of the following stages:
12195  * - \ref SCIP_STAGE_PROBLEM
12196  * - \ref SCIP_STAGE_TRANSFORMING
12197  * - \ref SCIP_STAGE_TRANSFORMED
12198  * - \ref SCIP_STAGE_INITPRESOLVE
12199  * - \ref SCIP_STAGE_PRESOLVING
12200  * - \ref SCIP_STAGE_EXITPRESOLVE
12201  * - \ref SCIP_STAGE_PRESOLVED
12202  * - \ref SCIP_STAGE_INITSOLVE
12203  * - \ref SCIP_STAGE_SOLVING
12204  * - \ref SCIP_STAGE_SOLVED
12205  * - \ref SCIP_STAGE_EXITSOLVE
12206  * - \ref SCIP_STAGE_FREETRANS
12207  */
12209  SCIP* scip /**< SCIP data structure */
12210  )
12211 {
12212  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12213 
12214  assert(scip->stat != NULL);
12215 
12216  switch( scip->set->stage )
12217  {
12218  case SCIP_STAGE_PROBLEM:
12222  case SCIP_STAGE_PRESOLVING:
12224  case SCIP_STAGE_PRESOLVED:
12225  case SCIP_STAGE_INITSOLVE:
12226  case SCIP_STAGE_SOLVING:
12227  case SCIP_STAGE_SOLVED:
12228  case SCIP_STAGE_EXITSOLVE:
12229  case SCIP_STAGE_FREETRANS:
12230  return scip->stat->nvaridx;
12231 
12232  default:
12233  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12234  SCIPABORT();
12235  return 0; /*lint !e527*/
12236  } /*lint !e788*/
12237 
12238 }
12239 
12240 
12241 /** gets variables of the original or transformed problem along with the numbers of different variable types;
12242  * the returned problem space (original or transformed) corresponds to the given solution;
12243  * data may become invalid after calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and
12244  * SCIPmultiaggregateVar()
12245  *
12246  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12247  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12248  *
12249  * @pre This method can be called if @p scip is in one of the following stages:
12250  * - \ref SCIP_STAGE_PROBLEM
12251  * - \ref SCIP_STAGE_TRANSFORMED
12252  * - \ref SCIP_STAGE_INITPRESOLVE
12253  * - \ref SCIP_STAGE_PRESOLVING
12254  * - \ref SCIP_STAGE_EXITPRESOLVE
12255  * - \ref SCIP_STAGE_PRESOLVED
12256  * - \ref SCIP_STAGE_INITSOLVE
12257  * - \ref SCIP_STAGE_SOLVING
12258  * - \ref SCIP_STAGE_SOLVED
12259  */
12261  SCIP* scip, /**< SCIP data structure */
12262  SCIP_SOL* sol, /**< primal solution that selects the problem space, NULL for current solution */
12263  SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
12264  int* nvars, /**< pointer to store number of variables or NULL if not needed */
12265  int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
12266  int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
12267  int* nimplvars, /**< pointer to store number of implicit integral vars or NULL if not needed */
12268  int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
12269  )
12270 {
12271  SCIP_CALL( checkStage(scip, "SCIPgetSolVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12272 
12273  if( scip->set->stage == SCIP_STAGE_PROBLEM || (sol != NULL && SCIPsolIsOriginal(sol)) )
12274  {
12275  if( vars != NULL )
12276  *vars = scip->origprob->vars;
12277  if( nvars != NULL )
12278  *nvars = scip->origprob->nvars;
12279  if( nbinvars != NULL )
12280  *nbinvars = scip->origprob->nbinvars;
12281  if( nintvars != NULL )
12282  *nintvars = scip->origprob->nintvars;
12283  if( nimplvars != NULL )
12284  *nimplvars = scip->origprob->nimplvars;
12285  if( ncontvars != NULL )
12286  *ncontvars = scip->origprob->ncontvars;
12287  }
12288  else
12289  {
12290  if( vars != NULL )
12291  *vars = scip->transprob->vars;
12292  if( nvars != NULL )
12293  *nvars = scip->transprob->nvars;
12294  if( nbinvars != NULL )
12295  *nbinvars = scip->transprob->nbinvars;
12296  if( nintvars != NULL )
12297  *nintvars = scip->transprob->nintvars;
12298  if( nimplvars != NULL )
12299  *nimplvars = scip->transprob->nimplvars;
12300  if( ncontvars != NULL )
12301  *ncontvars = scip->transprob->ncontvars;
12302  }
12303 
12304  return SCIP_OKAY;
12305 }
12306 
12307 /** returns variable of given name in the problem, or NULL if not existing
12308  *
12309  * @return variable of given name in the problem, or NULL if not existing
12310  *
12311  * @pre This method can be called if @p scip is in one of the following stages:
12312  * - \ref SCIP_STAGE_PROBLEM
12313  * - \ref SCIP_STAGE_TRANSFORMING
12314  * - \ref SCIP_STAGE_TRANSFORMED
12315  * - \ref SCIP_STAGE_INITPRESOLVE
12316  * - \ref SCIP_STAGE_PRESOLVING
12317  * - \ref SCIP_STAGE_EXITPRESOLVE
12318  * - \ref SCIP_STAGE_PRESOLVED
12319  * - \ref SCIP_STAGE_INITSOLVE
12320  * - \ref SCIP_STAGE_SOLVING
12321  * - \ref SCIP_STAGE_SOLVED
12322  * - \ref SCIP_STAGE_EXITSOLVE
12323  * - \ref SCIP_STAGE_FREETRANS
12324  */
12326  SCIP* scip, /**< SCIP data structure */
12327  const char* name /**< name of variable to find */
12328  )
12329 {
12330  SCIP_VAR* var;
12331 
12332  assert(name != NULL);
12333 
12334  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12335 
12336  switch( scip->set->stage )
12337  {
12338  case SCIP_STAGE_PROBLEM:
12339  return SCIPprobFindVar(scip->origprob, name);
12340 
12344  case SCIP_STAGE_PRESOLVING:
12346  case SCIP_STAGE_PRESOLVED:
12347  case SCIP_STAGE_INITSOLVE:
12348  case SCIP_STAGE_SOLVING:
12349  case SCIP_STAGE_SOLVED:
12350  case SCIP_STAGE_EXITSOLVE:
12351  case SCIP_STAGE_FREETRANS:
12352  var = SCIPprobFindVar(scip->transprob, name);
12353  if( var == NULL )
12354  return SCIPprobFindVar(scip->origprob, name);
12355  else
12356  return var;
12357 
12358  default:
12359  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12360  SCIPABORT();
12361  return NULL; /*lint !e527*/
12362  } /*lint !e788*/
12363 }
12364 
12365 /** returns TRUE iff all potential variables exist in the problem, and FALSE, if there may be additional variables,
12366  * that will be added in pricing and improve the objective value
12367  *
12368  * @return TRUE, if all potential variables exist in the problem; FALSE, otherwise
12369  *
12370  * @pre This method can be called if @p scip is in one of the following stages:
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, "SCIPallVarsInProb", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12388 
12389  return (scip->set->nactivepricers == 0);
12390 }
12391 
12392 /** adds constraint to the problem; if constraint is only valid locally, it is added to the local subproblem of the
12393  * current node (and all of its subnodes); otherwise it is added to the global problem;
12394  * if a local constraint is added at the root node, it is automatically upgraded into a global constraint
12395  *
12396  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12397  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12398  *
12399  * @pre This method can be called if @p scip is in one of the following stages:
12400  * - \ref SCIP_STAGE_PROBLEM
12401  * - \ref SCIP_STAGE_TRANSFORMED
12402  * - \ref SCIP_STAGE_INITPRESOLVE
12403  * - \ref SCIP_STAGE_PRESOLVING
12404  * - \ref SCIP_STAGE_EXITPRESOLVE
12405  * - \ref SCIP_STAGE_PRESOLVED
12406  * - \ref SCIP_STAGE_INITSOLVE
12407  * - \ref SCIP_STAGE_SOLVING
12408  * - \ref SCIP_STAGE_EXITSOLVE
12409  */
12411  SCIP* scip, /**< SCIP data structure */
12412  SCIP_CONS* cons /**< constraint to add */
12413  )
12414 {
12415  assert(cons != NULL);
12416 
12417  SCIP_CALL( checkStage(scip, "SCIPaddCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
12418 
12419  switch( scip->set->stage )
12420  {
12421  case SCIP_STAGE_PROBLEM:
12422  {
12423  SCIP_CALL( SCIPprobAddCons(scip->origprob, scip->set, scip->stat, cons) );
12424 
12425  if( scip->set->reopt_enable )
12426  {
12427  SCIP_CALL( SCIPreoptAddCons(scip->reopt, scip->set, scip->mem->probmem, cons) );
12428  }
12429  }
12430  return SCIP_OKAY;
12431 
12433  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12434  return SCIP_OKAY;
12435 
12437  case SCIP_STAGE_PRESOLVING:
12439  case SCIP_STAGE_PRESOLVED:
12440  case SCIP_STAGE_SOLVING:
12441  assert( SCIPtreeGetCurrentDepth(scip->tree) >= 0 || scip->set->stage == SCIP_STAGE_PRESOLVED );
12443  SCIPconsSetLocal(cons, FALSE);
12444  if( SCIPconsIsGlobal(cons) )
12445  {
12446  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12447  }
12448  else
12449  {
12451  SCIP_CALL( SCIPnodeAddCons(SCIPtreeGetCurrentNode(scip->tree), scip->mem->probmem, scip->set, scip->stat,
12452  scip->tree, cons) );
12453  }
12454  return SCIP_OKAY;
12455 
12456  case SCIP_STAGE_EXITSOLVE:
12457  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12458  return SCIP_OKAY;
12459 
12460  default:
12461  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12462  return SCIP_INVALIDCALL;
12463  } /*lint !e788*/
12464 }
12465 
12466 /** globally removes constraint from all subproblems; removes constraint from the constraint set change data of the
12467  * node, where it was added, or from the problem, if it was a problem constraint
12468  *
12469  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12470  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12471  *
12472  * @pre This method can be called if @p scip is in one of the following stages:
12473  * - \ref SCIP_STAGE_PROBLEM
12474  * - \ref SCIP_STAGE_INITPRESOLVE
12475  * - \ref SCIP_STAGE_PRESOLVING
12476  * - \ref SCIP_STAGE_EXITPRESOLVE
12477  * - \ref SCIP_STAGE_INITSOLVE
12478  * - \ref SCIP_STAGE_SOLVING
12479  * - \ref SCIP_STAGE_EXITSOLVE
12480  */
12482  SCIP* scip, /**< SCIP data structure */
12483  SCIP_CONS* cons /**< constraint to delete */
12484  )
12485 {
12486  assert(cons != NULL);
12487 
12488  SCIP_CALL( checkStage(scip, "SCIPdelCons", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
12489 
12490  switch( scip->set->stage )
12491  {
12492  case SCIP_STAGE_PROBLEM:
12493  assert(cons->addconssetchg == NULL);
12494  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
12495  return SCIP_OKAY;
12496 
12497  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
12498  * might be wrong
12499  */
12502  assert(SCIPconsIsAdded(cons));
12503  /*lint -fallthrough*/
12504 
12505  case SCIP_STAGE_PRESOLVING:
12506  case SCIP_STAGE_INITSOLVE:
12507  case SCIP_STAGE_SOLVING:
12508  case SCIP_STAGE_EXITSOLVE:
12509  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
12510  return SCIP_OKAY;
12511 
12512  default:
12513  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12514  return SCIP_INVALIDCALL;
12515  } /*lint !e788*/
12516 }
12517 
12518 /** returns original constraint of given name in the problem, or NULL if not existing
12519  *
12520  * @return original constraint of given name in the problem, or NULL if not existing
12521  *
12522  * @pre This method can be called if @p scip is in one of the following stages:
12523  * - \ref SCIP_STAGE_PROBLEM
12524  * - \ref SCIP_STAGE_TRANSFORMING
12525  * - \ref SCIP_STAGE_TRANSFORMED
12526  * - \ref SCIP_STAGE_INITPRESOLVE
12527  * - \ref SCIP_STAGE_PRESOLVING
12528  * - \ref SCIP_STAGE_EXITPRESOLVE
12529  * - \ref SCIP_STAGE_PRESOLVED
12530  * - \ref SCIP_STAGE_INITSOLVE
12531  * - \ref SCIP_STAGE_SOLVING
12532  * - \ref SCIP_STAGE_SOLVED
12533  * - \ref SCIP_STAGE_EXITSOLVE
12534  * - \ref SCIP_STAGE_FREETRANS
12535  */
12537  SCIP* scip, /**< SCIP data structure */
12538  const char* name /**< name of constraint to find */
12539  )
12540 {
12541  assert(name != NULL);
12542 
12543  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindOrigCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12544 
12545  switch( scip->set->stage )
12546  {
12547  case SCIP_STAGE_PROBLEM:
12550  case SCIP_STAGE_PRESOLVING:
12552  case SCIP_STAGE_PRESOLVED:
12553  case SCIP_STAGE_SOLVING:
12554  case SCIP_STAGE_SOLVED:
12555  case SCIP_STAGE_EXITSOLVE:
12556  case SCIP_STAGE_FREETRANS:
12557  return SCIPprobFindCons(scip->origprob, name);
12558 
12559  default:
12560  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12561  SCIPABORT();
12562  return NULL; /*lint !e527*/
12563  } /*lint !e788*/
12564 }
12565 
12566 /** returns constraint of given name in the problem, or NULL if not existing
12567  *
12568  * @return constraint of given name in the problem, or NULL if not existing
12569  *
12570  * @pre This method can be called if @p scip is in one of the following stages:
12571  * - \ref SCIP_STAGE_PROBLEM
12572  * - \ref SCIP_STAGE_TRANSFORMING
12573  * - \ref SCIP_STAGE_TRANSFORMED
12574  * - \ref SCIP_STAGE_INITPRESOLVE
12575  * - \ref SCIP_STAGE_PRESOLVING
12576  * - \ref SCIP_STAGE_EXITPRESOLVE
12577  * - \ref SCIP_STAGE_PRESOLVED
12578  * - \ref SCIP_STAGE_INITSOLVE
12579  * - \ref SCIP_STAGE_SOLVING
12580  * - \ref SCIP_STAGE_SOLVED
12581  * - \ref SCIP_STAGE_EXITSOLVE
12582  * - \ref SCIP_STAGE_FREETRANS
12583  */
12585  SCIP* scip, /**< SCIP data structure */
12586  const char* name /**< name of constraint to find */
12587  )
12588 {
12589  SCIP_CONS* cons;
12590 
12591  assert(name != NULL);
12592 
12593  SCIP_CALL_ABORT( checkStage(scip, "SCIPfindCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12594 
12595  switch( scip->set->stage )
12596  {
12597  case SCIP_STAGE_PROBLEM:
12598  return SCIPprobFindCons(scip->origprob, name);
12599 
12603  case SCIP_STAGE_PRESOLVING:
12605  case SCIP_STAGE_PRESOLVED:
12606  case SCIP_STAGE_SOLVING:
12607  case SCIP_STAGE_SOLVED:
12608  case SCIP_STAGE_EXITSOLVE:
12609  case SCIP_STAGE_FREETRANS:
12610  cons = SCIPprobFindCons(scip->transprob, name);
12611  if( cons == NULL )
12612  return SCIPprobFindCons(scip->origprob, name);
12613  else
12614  return cons;
12615 
12616  default:
12617  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12618  SCIPABORT();
12619  return NULL; /*lint !e527*/
12620  } /*lint !e788*/
12621 }
12622 
12623 /** gets number of upgraded constraints
12624  *
12625  * @return number of upgraded constraints
12626  *
12627  * @pre This method can be called if @p scip is in one of the following stages:
12628  * - \ref SCIP_STAGE_PROBLEM
12629  * - \ref SCIP_STAGE_TRANSFORMED
12630  * - \ref SCIP_STAGE_INITPRESOLVE
12631  * - \ref SCIP_STAGE_PRESOLVING
12632  * - \ref SCIP_STAGE_PRESOLVED
12633  * - \ref SCIP_STAGE_EXITPRESOLVE
12634  * - \ref SCIP_STAGE_SOLVING
12635  * - \ref SCIP_STAGE_SOLVED
12636  */
12638  SCIP* scip /**< SCIP data structure */
12639  )
12640 {
12641  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNUpgrConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12642 
12643  switch( scip->set->stage )
12644  {
12645  case SCIP_STAGE_PROBLEM:
12646  return 0;
12647 
12650  case SCIP_STAGE_PRESOLVING:
12652  case SCIP_STAGE_PRESOLVED:
12653  case SCIP_STAGE_SOLVING:
12654  case SCIP_STAGE_SOLVED:
12655  return scip->stat->npresolupgdconss;
12656 
12657  default:
12658  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12659  SCIPABORT();
12660  return 0; /*lint !e527*/
12661  } /*lint !e788*/
12662 }
12663 
12664 /** gets total number of globally valid constraints currently in the problem
12665  *
12666  * @return total number of globally valid constraints currently in the problem
12667  *
12668  * @pre This method can be called if @p scip is in one of the following stages:
12669  * - \ref SCIP_STAGE_PROBLEM
12670  * - \ref SCIP_STAGE_TRANSFORMED
12671  * - \ref SCIP_STAGE_INITPRESOLVE
12672  * - \ref SCIP_STAGE_PRESOLVING
12673  * - \ref SCIP_STAGE_EXITPRESOLVE
12674  * - \ref SCIP_STAGE_PRESOLVED
12675  * - \ref SCIP_STAGE_INITSOLVE
12676  * - \ref SCIP_STAGE_SOLVING
12677  * - \ref SCIP_STAGE_SOLVED
12678  */
12680  SCIP* scip /**< SCIP data structure */
12681  )
12682 {
12683  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12684 
12685  switch( scip->set->stage )
12686  {
12687  case SCIP_STAGE_PROBLEM:
12688  return scip->origprob->nconss;
12689 
12692  case SCIP_STAGE_PRESOLVING:
12694  case SCIP_STAGE_PRESOLVED:
12695  case SCIP_STAGE_INITSOLVE:
12696  case SCIP_STAGE_SOLVING:
12697  case SCIP_STAGE_SOLVED:
12698  return scip->transprob->nconss;
12699 
12700  default:
12701  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12702  SCIPABORT();
12703  return 0; /*lint !e527*/
12704  } /*lint !e788*/
12705 }
12706 
12707 /** gets array of globally valid constraints currently in the problem
12708  *
12709  * @return array of globally valid constraints currently in the problem
12710  *
12711  * @pre This method can be called if @p scip is in one of the following stages:
12712  * - \ref SCIP_STAGE_PROBLEM
12713  * - \ref SCIP_STAGE_TRANSFORMED
12714  * - \ref SCIP_STAGE_INITPRESOLVE
12715  * - \ref SCIP_STAGE_PRESOLVING
12716  * - \ref SCIP_STAGE_EXITPRESOLVE
12717  * - \ref SCIP_STAGE_PRESOLVED
12718  * - \ref SCIP_STAGE_INITSOLVE
12719  * - \ref SCIP_STAGE_SOLVING
12720  * - \ref SCIP_STAGE_SOLVED
12721  *
12722  * @warning If your are using the method SCIPaddCons(), it can happen that the internal constraint array (which is
12723  * accessed via this method) gets resized. This can invalid the pointer which is returned by this method.
12724  */
12726  SCIP* scip /**< SCIP data structure */
12727  )
12728 {
12729  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConss", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
12730 
12731  switch( scip->set->stage )
12732  {
12733  case SCIP_STAGE_PROBLEM:
12734  return scip->origprob->conss;
12735 
12738  case SCIP_STAGE_PRESOLVING:
12740  case SCIP_STAGE_PRESOLVED:
12741  case SCIP_STAGE_INITSOLVE:
12742  case SCIP_STAGE_SOLVING:
12743  case SCIP_STAGE_SOLVED:
12744  return scip->transprob->conss;
12745 
12746  default:
12747  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
12748  SCIPABORT();
12749  return NULL; /*lint !e527*/
12750  } /*lint !e788*/
12751 }
12752 
12753 /** gets total number of constraints in the original problem
12754  *
12755  * @return total number of constraints in the original problem
12756  *
12757  * @pre This method can be called if @p scip is in one of the following stages:
12758  * - \ref SCIP_STAGE_PROBLEM
12759  * - \ref SCIP_STAGE_TRANSFORMING
12760  * - \ref SCIP_STAGE_TRANSFORMED
12761  * - \ref SCIP_STAGE_INITPRESOLVE
12762  * - \ref SCIP_STAGE_PRESOLVING
12763  * - \ref SCIP_STAGE_EXITPRESOLVE
12764  * - \ref SCIP_STAGE_PRESOLVED
12765  * - \ref SCIP_STAGE_INITSOLVE
12766  * - \ref SCIP_STAGE_SOLVING
12767  * - \ref SCIP_STAGE_SOLVED
12768  * - \ref SCIP_STAGE_EXITSOLVE
12769  * - \ref SCIP_STAGE_FREETRANS
12770  */
12772  SCIP* scip /**< SCIP data structure */
12773  )
12774 {
12775  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12776 
12777  return scip->origprob->nconss;
12778 }
12779 
12780 /** gets array of constraints in the original problem
12781  *
12782  * @return array of constraints in the original problem
12783  *
12784  * @pre This method can be called if @p scip is in one of the following stages:
12785  * - \ref SCIP_STAGE_PROBLEM
12786  * - \ref SCIP_STAGE_TRANSFORMING
12787  * - \ref SCIP_STAGE_TRANSFORMED
12788  * - \ref SCIP_STAGE_INITPRESOLVE
12789  * - \ref SCIP_STAGE_PRESOLVING
12790  * - \ref SCIP_STAGE_EXITPRESOLVE
12791  * - \ref SCIP_STAGE_PRESOLVED
12792  * - \ref SCIP_STAGE_INITSOLVE
12793  * - \ref SCIP_STAGE_SOLVING
12794  * - \ref SCIP_STAGE_SOLVED
12795  * - \ref SCIP_STAGE_EXITSOLVE
12796  * - \ref SCIP_STAGE_FREETRANS
12797  */
12799  SCIP* scip /**< SCIP data structure */
12800  )
12801 {
12802  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
12803 
12804  return scip->origprob->conss;
12805 }
12806 
12807 /** computes the number of check constraint in the current node (loop over all constraint handler and cumulates the
12808  * number of check constraints)
12809  *
12810  * @return returns the number of check constraints
12811  *
12812  * @pre This method can be called if @p scip is in one of the following stages:
12813  * - \ref SCIP_STAGE_TRANSFORMED
12814  * - \ref SCIP_STAGE_INITPRESOLVE
12815  * - \ref SCIP_STAGE_PRESOLVING
12816  * - \ref SCIP_STAGE_EXITPRESOLVE
12817  * - \ref SCIP_STAGE_PRESOLVED
12818  * - \ref SCIP_STAGE_INITSOLVE
12819  * - \ref SCIP_STAGE_SOLVING
12820  */
12822  SCIP* scip /**< SCIP data structure */
12823  )
12824 {
12825  SCIP_CONSHDLR** conshdlrs;
12826  int nconshdlrs;
12827  int ncheckconss;
12828  int c;
12829 
12830  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCheckConss", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12831 
12832  nconshdlrs = SCIPgetNConshdlrs(scip);
12833  conshdlrs = SCIPgetConshdlrs(scip);
12834  assert(conshdlrs != NULL);
12835 
12836  ncheckconss = 0;
12837 
12838  /* loop over all constraint handler and collect the number of constraints which need to be checked */
12839  for( c = 0; c < nconshdlrs; ++c )
12840  {
12841  assert(conshdlrs[c] != NULL);
12842  ncheckconss += SCIPconshdlrGetNCheckConss(conshdlrs[c]);
12843  }
12844 
12845  return ncheckconss;
12846 
12847 }
12848 
12849 /*
12850  * local subproblem methods
12851  */
12852 
12853 /** adds a conflict to a given node or globally to the problem if @p node == NULL.
12854  *
12855  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12856  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12857  *
12858  * @pre this method can be called in one of the following stages of the SCIP solving process:
12859  * - \ref SCIP_STAGE_INITPRESOLVE
12860  * - \ref SCIP_STAGE_PRESOLVING
12861  * - \ref SCIP_STAGE_EXITPRESOLVE
12862  * - \ref SCIP_STAGE_SOLVING
12863  *
12864  * @note this method will release the constraint
12865  */
12867  SCIP* scip, /**< SCIP data structure */
12868  SCIP_NODE* node, /**< node to add conflict (or NULL if global) */
12869  SCIP_CONS* cons, /**< constraint representing the conflict */
12870  SCIP_NODE* validnode, /**< node at whichaddConf the constraint is valid (or NULL) */
12871  SCIP_CONFTYPE conftype, /**< type of the conflict */
12872  SCIP_Bool iscutoffinvolved /**< is a cutoff bound involved in this conflict */
12873  )
12874 {
12875  SCIP_Real primalbound;
12876 
12877  assert(scip != NULL);
12878  assert(cons != NULL);
12879  assert(scip->conflictstore != NULL);
12880  assert(scip->set->conf_enable);
12881  assert(conftype != SCIP_CONFTYPE_UNKNOWN);
12882  assert(conftype != SCIP_CONFTYPE_BNDEXCEEDING || iscutoffinvolved);
12883 
12884  SCIP_CALL( checkStage(scip, "SCIPaddConflict", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12885 
12886  if( iscutoffinvolved )
12887  primalbound = SCIPgetCutoffbound(scip);
12888  else
12889  primalbound = -SCIPinfinity(scip);
12890 
12891  /* add a global conflict */
12892  if( node == NULL )
12893  {
12894  SCIP_CALL( SCIPaddCons(scip, cons) );
12895  }
12896  /* add a local conflict */
12897  else
12898  {
12899  SCIP_CALL( SCIPaddConsNode(scip, node, cons, validnode) );
12900  }
12901 
12902  /* add the conflict to the conflict store */
12903  SCIP_CALL( SCIPconflictstoreAddConflict(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->tree,
12904  scip->transprob, scip->reopt, cons, conftype, iscutoffinvolved, primalbound) );
12905 
12906  /* mark constraint to be a conflict */
12907  SCIPconsMarkConflict(cons);
12908 
12909  SCIP_CALL( SCIPreleaseCons(scip, &cons) );
12910 
12911  return SCIP_OKAY;
12912 }
12913 
12914 /** tries to remove conflicts depending on an old cutoff bound if the improvement of the new incumbent is good enough
12915  *
12916  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12917  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12918  *
12919  * @pre this method can be called in one of the following stages of the SCIP solving process:
12920  * - \ref SCIP_STAGE_PRESOLVING
12921  * - \ref SCIP_STAGE_SOLVING
12922  */
12924  SCIP* scip, /**< SCIP data structure */
12925  SCIP_EVENT* event /**< event data */
12926  )
12927 {
12928  assert(scip != NULL);
12929  assert(event != NULL);
12931  assert(SCIPeventGetSol(event) != NULL);
12932 
12933  SCIP_CALL( checkStage(scip, "SCIPclearConflictStore", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12934 
12936  scip->transprob, scip->reopt, scip->primal->cutoffbound) );
12937 
12938  return SCIP_OKAY;
12939 }
12940 
12941 /** adds constraint to the given node (and all of its subnodes), even if it is a global constraint;
12942  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
12943  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
12944  * only active in a small part of the tree although it is valid in a larger part.
12945  * In this case, one should pass the more global node where the constraint is valid as "validnode".
12946  * Note that the same constraint cannot be added twice to the branching tree with different "validnode" parameters.
12947  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
12948  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
12949  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
12950  *
12951  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
12952  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
12953  *
12954  * @pre this method can be called in one of the following stages of the SCIP solving process:
12955  * - \ref SCIP_STAGE_INITPRESOLVE
12956  * - \ref SCIP_STAGE_PRESOLVING
12957  * - \ref SCIP_STAGE_EXITPRESOLVE
12958  * - \ref SCIP_STAGE_SOLVING
12959  */
12961  SCIP* scip, /**< SCIP data structure */
12962  SCIP_NODE* node, /**< node to add constraint to */
12963  SCIP_CONS* cons, /**< constraint to add */
12964  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
12965  )
12966 {
12967  assert(cons != NULL);
12968  assert(node != NULL);
12969 
12970  SCIP_CALL( checkStage(scip, "SCIPaddConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
12971 
12972  if( validnode != NULL )
12973  {
12974  int validdepth;
12975 
12976  validdepth = SCIPnodeGetDepth(validnode);
12977  if( validdepth > SCIPnodeGetDepth(node) )
12978  {
12979  SCIPerrorMessage("cannot add constraint <%s> valid in depth %d to a node of depth %d\n",
12980  SCIPconsGetName(cons), validdepth, SCIPnodeGetDepth(node));
12981  return SCIP_INVALIDDATA;
12982  }
12983  if( cons->validdepth != -1 && cons->validdepth != validdepth )
12984  {
12985  SCIPerrorMessage("constraint <%s> is already marked to be valid in depth %d - cannot mark it to be valid in depth %d\n",
12986  SCIPconsGetName(cons), cons->validdepth, validdepth);
12987  return SCIP_INVALIDDATA;
12988  }
12989  if( validdepth <= SCIPtreeGetEffectiveRootDepth(scip->tree) )
12990  SCIPconsSetLocal(cons, FALSE);
12991  else
12992  cons->validdepth = validdepth;
12993  }
12994 
12996  {
12997  SCIPconsSetLocal(cons, FALSE);
12998  SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
12999  }
13000  else
13001  {
13002  SCIP_CALL( SCIPnodeAddCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13003  }
13004 
13005  return SCIP_OKAY;
13006 }
13007 
13008 /** adds constraint locally to the current node (and all of its subnodes), even if it is a global constraint;
13009  * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
13010  * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
13011  * only active in a small part of the tree although it is valid in a larger part.
13012  *
13013  * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
13014  * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
13015  * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
13016  *
13017  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13018  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13019  *
13020  * @pre this method can be called in one of the following stages of the SCIP solving process:
13021  * - \ref SCIP_STAGE_INITPRESOLVE
13022  * - \ref SCIP_STAGE_PRESOLVING
13023  * - \ref SCIP_STAGE_EXITPRESOLVE
13024  * - \ref SCIP_STAGE_SOLVING
13025  *
13026  * @note The same constraint cannot be added twice to the branching tree with different "validnode" parameters. This is
13027  * the case due to internal data structures and performance issues. In such a case you should try to realize your
13028  * issue using the method SCIPdisableCons() and SCIPenableCons() and control these via the event system of SCIP.
13029  */
13031  SCIP* scip, /**< SCIP data structure */
13032  SCIP_CONS* cons, /**< constraint to add */
13033  SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
13034  )
13035 {
13036  assert(cons != NULL);
13037 
13038  SCIP_CALL( checkStage(scip, "SCIPaddConsLocal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13039 
13040  SCIP_CALL( SCIPaddConsNode(scip, SCIPtreeGetCurrentNode(scip->tree), cons, validnode) );
13041 
13042  return SCIP_OKAY;
13043 }
13044 
13045 /** disables constraint's separation, enforcing, and propagation capabilities at the given node (and all subnodes);
13046  * if the method is called at the root node, the constraint is globally deleted from the problem;
13047  * the constraint deletion is being remembered at the given node, s.t. after leaving the node's subtree, the constraint
13048  * is automatically enabled again, and after entering the node's subtree, it is automatically disabled;
13049  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
13050  * alternatively, use SCIPdisableCons()
13051  *
13052  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13053  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13054  *
13055  * @pre this method can be called in one of the following stages of the SCIP solving process:
13056  * - \ref SCIP_STAGE_INITPRESOLVE
13057  * - \ref SCIP_STAGE_PRESOLVING
13058  * - \ref SCIP_STAGE_EXITPRESOLVE
13059  * - \ref SCIP_STAGE_SOLVING
13060  */
13062  SCIP* scip, /**< SCIP data structure */
13063  SCIP_NODE* node, /**< node to disable constraint in */
13064  SCIP_CONS* cons /**< constraint to locally delete */
13065  )
13066 {
13067  assert(cons != NULL);
13068 
13069  SCIP_CALL( checkStage(scip, "SCIPdelConsNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13070 
13071  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
13072  * might be wrong
13073  */
13074  if( scip->set->stage == SCIP_STAGE_INITPRESOLVE || scip->set->stage == SCIP_STAGE_EXITPRESOLVE )
13075  assert(SCIPconsIsAdded(cons));
13076 
13078  {
13079  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
13080  }
13081  else
13082  {
13083  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13084  }
13085 
13086  return SCIP_OKAY;
13087 }
13088 
13089 /** disables constraint's separation, enforcing, and propagation capabilities at the current node (and all subnodes);
13090  * if the method is called during problem modification or at the root node, the constraint is globally deleted from
13091  * the problem;
13092  * the constraint deletion is being remembered at the current node, s.t. after leaving the current subtree, the
13093  * constraint is automatically enabled again, and after reentering the current node's subtree, it is automatically
13094  * disabled again;
13095  * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
13096  * alternatively, use SCIPdisableCons()
13097  *
13098  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13099  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13100  *
13101  * @pre this method can be called in one of the following stages of the SCIP solving process:
13102  * - \ref SCIP_STAGE_PROBLEM
13103  * - \ref SCIP_STAGE_INITPRESOLVE
13104  * - \ref SCIP_STAGE_PRESOLVING
13105  * - \ref SCIP_STAGE_EXITPRESOLVE
13106  * - \ref SCIP_STAGE_SOLVING
13107  *
13108  * @note SCIP stage does not get changed
13109  *
13110  */
13112  SCIP* scip, /**< SCIP data structure */
13113  SCIP_CONS* cons /**< constraint to locally delete */
13114  )
13115 {
13116  SCIP_NODE* node;
13117 
13118  assert(cons != NULL);
13119 
13120  SCIP_CALL( checkStage(scip, "SCIPdelConsLocal", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13121 
13122  switch( scip->set->stage )
13123  {
13124  case SCIP_STAGE_PROBLEM:
13125  assert(cons->addconssetchg == NULL);
13126  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
13127  return SCIP_OKAY;
13128 
13129  /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
13130  * might be wrong
13131  */
13134  assert(SCIPconsIsAdded(cons));
13135  /*lint -fallthrough*/
13136 
13137  case SCIP_STAGE_PRESOLVING:
13138  case SCIP_STAGE_SOLVING:
13139  node = SCIPtreeGetCurrentNode(scip->tree);
13140 
13142  {
13143  SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
13144  }
13145  else
13146  {
13147  SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
13148  }
13149  return SCIP_OKAY;
13150 
13151  default:
13152  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13153  return SCIP_INVALIDCALL;
13154  } /*lint !e788*/
13155 }
13156 
13157 /** gets estimate of best primal solution w.r.t. original problem contained in current subtree
13158  *
13159  * @return estimate of best primal solution w.r.t. original problem contained in current subtree
13160  *
13161  * @pre this method can be called in one of the following stages of the SCIP solving process:
13162  * - \ref SCIP_STAGE_SOLVING
13163  */
13165  SCIP* scip /**< SCIP data structure */
13166  )
13167 {
13168  SCIP_NODE* node;
13169 
13170  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalOrigEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13171 
13172  node = SCIPtreeGetCurrentNode(scip->tree);
13173  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetEstimate(node)) : SCIP_INVALID;
13174 }
13175 
13176 /** gets estimate of best primal solution w.r.t. transformed problem contained in current subtree
13177  *
13178  * @return estimate of best primal solution w.r.t. transformed problem contained in current subtree
13179  *
13180  * @pre this method can be called in one of the following stages of the SCIP solving process:
13181  * - \ref SCIP_STAGE_SOLVING
13182  */
13184  SCIP* scip /**< SCIP data structure */
13185  )
13186 {
13187  SCIP_NODE* node;
13188 
13189  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalTransEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13190 
13191  node = SCIPtreeGetCurrentNode(scip->tree);
13192 
13193  return node != NULL ? SCIPnodeGetEstimate(node) : SCIP_INVALID;
13194 }
13195 
13196 /** gets dual bound of current node
13197  *
13198  * @return dual bound of current node
13199  *
13200  * @pre this method can be called in one of the following stages of the SCIP solving process:
13201  * - \ref SCIP_STAGE_SOLVING
13202  */
13204  SCIP* scip /**< SCIP data structure */
13205  )
13206 {
13207  SCIP_NODE* node;
13208 
13209  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13210 
13211  node = SCIPtreeGetCurrentNode(scip->tree);
13212  return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node)) : SCIP_INVALID;
13213 }
13214 
13215 /** gets lower bound of current node in transformed problem
13216  *
13217  * @return lower bound of current node in transformed problem
13218  *
13219  * @pre this method can be called in one of the following stages of the SCIP solving process:
13220  * - \ref SCIP_STAGE_SOLVING
13221  */
13223  SCIP* scip /**< SCIP data structure */
13224  )
13225 {
13226  SCIP_NODE* node;
13227 
13228  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13229 
13230  node = SCIPtreeGetCurrentNode(scip->tree);
13231 
13232  return node != NULL ? SCIPnodeGetLowerbound(node) : SCIP_INVALID;
13233 }
13234 
13235 /** gets dual bound of given node
13236  *
13237  * @return dual bound of a given node
13238  *
13239  * @pre this method can be called in one of the following stages of the SCIP solving process:
13240  * - \ref SCIP_STAGE_SOLVING
13241  */
13243  SCIP* scip, /**< SCIP data structure */
13244  SCIP_NODE* node /**< node to get dual bound for */
13245  )
13246 {
13247  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13248 
13249  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node));
13250 }
13251 
13252 /** gets lower bound of given node in transformed problem
13253  *
13254  * @return lower bound of given node in transformed problem
13255  *
13256  * @pre this method can be called in one of the following stages of the SCIP solving process:
13257  * - \ref SCIP_STAGE_SOLVING
13258  */
13260  SCIP* scip, /**< SCIP data structure */
13261  SCIP_NODE* node /**< node to get dual bound for */
13262  )
13263 {
13264  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13265 
13266  return SCIPnodeGetLowerbound(node);
13267 }
13268 
13269 /** if given value is tighter (larger for minimization, smaller for maximization) than the current node's dual bound (in
13270  * original problem space), sets the current node's dual bound to the new value
13271  *
13272  * @note the given new bound has to be a dual bound, i.e., it has to be valid for the original problem.
13273  *
13274  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13275  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13276  *
13277  * @pre this method can be called in one of the following stages of the SCIP solving process:
13278  * - \ref SCIP_STAGE_PROBLEM
13279  * - \ref SCIP_STAGE_PRESOLVING
13280  * - \ref SCIP_STAGE_PRESOLVED
13281  * - \ref SCIP_STAGE_SOLVING
13282  */
13284  SCIP* scip, /**< SCIP data structure */
13285  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
13286  )
13287 {
13288  SCIP_CALL( checkStage(scip, "SCIPupdateLocalDualbound", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13289 
13290  switch( scip->set->stage )
13291  {
13292  case SCIP_STAGE_PROBLEM:
13293  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
13294  * the problem data
13295  */
13296  SCIPprobUpdateDualbound(scip->origprob, newbound);
13297  break;
13298 
13299  case SCIP_STAGE_PRESOLVING:
13300  case SCIP_STAGE_PRESOLVED:
13301  /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
13302  * the problem data
13303  */
13304  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
13305  break;
13306 
13307  case SCIP_STAGE_SOLVING:
13309  break;
13310 
13311  default:
13312  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13313  SCIPABORT();
13314  return SCIP_INVALIDCALL; /*lint !e527*/
13315  } /*lint !e788*/
13316 
13317  return SCIP_OKAY;
13318 }
13319 
13320 /** if given value is larger than the current node's lower bound (in transformed problem), sets the current node's
13321  * lower bound to the new value
13322  *
13323  * @note the given new bound has to be a lower bound, i.e., it has to be valid for the transformed problem.
13324  *
13325  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13326  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13327  *
13328  * @pre this method can be called in one of the following stages of the SCIP solving process:
13329  * - \ref SCIP_STAGE_PRESOLVING
13330  * - \ref SCIP_STAGE_PRESOLVED
13331  * - \ref SCIP_STAGE_SOLVING
13332  */
13334  SCIP* scip, /**< SCIP data structure */
13335  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
13336  )
13337 {
13338  SCIP_CALL( checkStage(scip, "SCIPupdateLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13339 
13340  switch( scip->set->stage )
13341  {
13342  case SCIP_STAGE_PRESOLVING:
13343  case SCIP_STAGE_PRESOLVED:
13344  /* since no root node, for which we could update the lower bound, has been created yet, update the dual bound stored
13345  * in the problem data
13346  */
13347  SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
13348  break;
13349 
13350  case SCIP_STAGE_SOLVING:
13352  break;
13353 
13354  default:
13355  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
13356  SCIPABORT();
13357  return SCIP_INVALIDCALL; /*lint !e527*/
13358  } /*lint !e788*/
13359 
13360  return SCIP_OKAY;
13361 }
13362 
13363 /** if given value is tighter (larger for minimization, smaller for maximization) than the node's dual bound,
13364  * sets the node's dual bound to the new value
13365  *
13366  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13367  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13368  *
13369  * @pre this method can be called in one of the following stages of the SCIP solving process:
13370  * - \ref SCIP_STAGE_SOLVING
13371  */
13373  SCIP* scip, /**< SCIP data structure */
13374  SCIP_NODE* node, /**< node to update dual bound for */
13375  SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
13376  )
13377 {
13378  SCIP_CALL( checkStage(scip, "SCIPupdateNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13379 
13380  SCIP_CALL( SCIPupdateNodeLowerbound(scip, node, SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, newbound)) );
13381 
13382  return SCIP_OKAY;
13383 }
13384 
13385 /** if given value is larger than the node's lower bound (in transformed problem), sets the node's lower bound
13386  * to the new value
13387  *
13388  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13389  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13390  *
13391  * @pre this method can be called in one of the following stages of the SCIP solving process:
13392  * - \ref SCIP_STAGE_SOLVING
13393  */
13395  SCIP* scip, /**< SCIP data structure */
13396  SCIP_NODE* node, /**< node to update lower bound for */
13397  SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
13398  )
13399 {
13400  SCIP_CALL( checkStage(scip, "SCIPupdateNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13401 
13402  SCIPnodeUpdateLowerbound(node, scip->stat, scip->set, scip->tree, scip->transprob, scip->origprob, newbound);
13403 
13404  /* if lowerbound exceeds the cutoffbound the node will be marked to be cutoff
13405  *
13406  * If the node is an inner node (,not a child node,) we need to cutoff the node manually if we exceed the
13407  * cutoffbound. This is only relevant if a user updates the lower bound; in the main solving process of SCIP the
13408  * lowerbound is only changed before branching and the given node is always a child node. Therefore, we only check
13409  * for a cutoff here in the user function instead of in SCIPnodeUpdateLowerbound().
13410  */
13411  if( SCIPisGE(scip, newbound, scip->primal->cutoffbound) )
13412  {
13413  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->transprob, scip->origprob, scip->reopt,
13414  scip->lp, scip->mem->probmem) );
13415  }
13416 
13417  return SCIP_OKAY;
13418 }
13419 
13420 /** change the node selection priority of the given child
13421  *
13422  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13423  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13424  *
13425  * @pre this method can be called in one of the following stages of the SCIP solving process:
13426  * - \ref SCIP_STAGE_SOLVING
13427  */
13429  SCIP* scip, /**< SCIP data structure */
13430  SCIP_NODE* child, /**< child to update the node selection priority */
13431  SCIP_Real priority /**< node selection priority value */
13432  )
13433 {
13434  SCIP_CALL( checkStage(scip, "SCIPchgChildPrio", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
13435 
13436  if( SCIPnodeGetType(child) != SCIP_NODETYPE_CHILD )
13437  return SCIP_INVALIDDATA;
13438 
13439  SCIPchildChgNodeselPrio(scip->tree, child, priority);
13440 
13441  return SCIP_OKAY;
13442 }
13443 
13444 
13445 
13446 /*
13447  * solve methods
13448  */
13449 
13450 /** checks solution for feasibility in original problem without adding it to the solution store; to improve the
13451  * performance we use the following order when checking for violations:
13452  *
13453  * 1. constraint hanlders which don't need constraints (e.g. integral constraint handler)
13454  * 2. variable bounds
13455  * 3. original constraints
13456  */
13457 static
13459  SCIP* scip, /**< SCIP data structure */
13460  SCIP_SOL* sol, /**< primal CIP solution */
13461  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
13462  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
13463  SCIP_Bool completely, /**< Should all violations be checked? */
13464  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
13465  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
13466  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
13467  SCIP_Bool checkmodifiable /**< have modifiable constraint to be checked? */
13468  )
13469 {
13470  SCIP_RESULT result;
13471  int v;
13472  int c;
13473  int h;
13474 
13475  assert(scip != NULL);
13476  assert(sol != NULL);
13477  assert(feasible != NULL);
13478 
13479  SCIP_CALL( checkStage(scip, "checkSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
13480 
13481  *feasible = TRUE;
13482 
13483  if( !printreason )
13484  completely = FALSE;
13485 
13486  /* check bounds */
13487  if( checkbounds )
13488  {
13489  for( v = 0; v < scip->origprob->nvars; ++v )
13490  {
13491  SCIP_VAR* var;
13492  SCIP_Real solval;
13493  SCIP_Real lb;
13494  SCIP_Real ub;
13495 
13496  var = scip->origprob->vars[v];
13497  solval = SCIPsolGetVal(sol, scip->set, scip->stat, var);
13498 
13499  lb = SCIPvarGetLbOriginal(var);
13500  ub = SCIPvarGetUbOriginal(var);
13501  if( SCIPsetIsFeasLT(scip->set, solval, lb) || SCIPsetIsFeasGT(scip->set, solval, ub) )
13502  {
13503  *feasible = FALSE;
13504 
13505  if( printreason )
13506  {
13507  SCIPmessagePrintInfo(scip->messagehdlr, "solution violates original bounds of variable <%s> [%g,%g] solution value <%g>\n",
13508  SCIPvarGetName(var), lb, ub, solval);
13509  }
13510 
13511  if( !completely )
13512  return SCIP_OKAY;
13513  }
13514  }
13515  }
13516 
13517  /* call constraint handlers that don't need constraints */
13518  for( h = 0; h < scip->set->nconshdlrs; ++h )
13519  {
13520  if( !SCIPconshdlrNeedsCons(scip->set->conshdlrs[h]) )
13521  {
13522  SCIP_CALL( SCIPconshdlrCheck(scip->set->conshdlrs[h], scip->mem->probmem, scip->set, scip->stat, sol,
13523  checkintegrality, checklprows, printreason, completely, &result) );
13524 
13525  if( result != SCIP_FEASIBLE )
13526  {
13527  *feasible = FALSE;
13528 
13529  if( !completely )
13530  return SCIP_OKAY;
13531  }
13532  }
13533  }
13534 
13535  /* check original constraints
13536  *
13537  * in general modifiable constraints can not be checked, because the variables to fulfill them might be missing in
13538  * the original problem; however, if the solution comes from a heuristic during presolving modifiable constraints
13539  * have to be checked;
13540  */
13541  for( c = 0; c < scip->origprob->nconss; ++c )
13542  {
13543  if( SCIPconsIsChecked(scip->origprob->conss[c]) && (checkmodifiable || !SCIPconsIsModifiable(scip->origprob->conss[c])) )
13544  {
13545  /* check solution */
13546  SCIP_CALL( SCIPconsCheck(scip->origprob->conss[c], scip->set, sol,
13547  checkintegrality, checklprows, printreason, &result) );
13548 
13549  if( result != SCIP_FEASIBLE )
13550  {
13551  *feasible = FALSE;
13552 
13553  if( !completely )
13554  return SCIP_OKAY;
13555  }
13556  }
13557  }
13558 
13559  return SCIP_OKAY;
13560 }
13561 
13562 /** calculates number of nonzeros in problem */
13563 static
13565  SCIP* scip, /**< SCIP data structure */
13566  SCIP_Longint* nchecknonzeros, /**< pointer to store number of non-zeros in all check constraints */
13567  SCIP_Longint* nactivenonzeros, /**< pointer to store number of non-zeros in all active constraints */
13568  SCIP_Bool* approxchecknonzeros,/**< pointer to store if the number of non-zeros in all check constraints
13569  * is only a lowerbound
13570  */
13571  SCIP_Bool* approxactivenonzeros/**< pointer to store if the number of non-zeros in all active constraints
13572  * is only a lowerbound
13573  */
13574  )
13575 {
13576  SCIP_CONS** conss;
13577  SCIP_Bool success;
13578  SCIP_Bool ischeck;
13579  int nconss;
13580  int nvars;
13581  int c;
13582  int h;
13583 
13584  *nchecknonzeros = 0LL;
13585  *nactivenonzeros = 0LL;
13586  *approxchecknonzeros = FALSE;
13587  *approxactivenonzeros = FALSE;
13588 
13589  /* computes number of non-zeros over all active constraints */
13590  for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
13591  {
13592  nconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
13593 
13594  if( nconss > 0 )
13595  {
13596  conss = SCIPconshdlrGetConss(scip->set->conshdlrs[h]);
13597 
13598  /* calculate all active constraints */
13599  for( c = nconss - 1; c >= 0; --c )
13600  {
13601  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
13602  ischeck = SCIPconsIsChecked(conss[c]);
13603 
13604  if( !success )
13605  {
13606  *approxactivenonzeros = TRUE;
13607  if( ischeck )
13608  *approxchecknonzeros = TRUE;
13609  }
13610  else
13611  {
13612  *nactivenonzeros += nvars;
13613  if( ischeck )
13614  *nchecknonzeros += nvars;
13615  }
13616  }
13617  }
13618 
13619  /* add nonzeros on inactive check constraints */
13620  nconss = SCIPconshdlrGetNCheckConss(scip->set->conshdlrs[h]);
13621  if( nconss > 0 )
13622  {
13623  conss = SCIPconshdlrGetCheckConss(scip->set->conshdlrs[h]);
13624 
13625  for( c = nconss - 1; c >= 0; --c )
13626  {
13627  if( !SCIPconsIsActive(conss[c]) )
13628  {
13629  SCIP_CALL( SCIPconsGetNVars(conss[c], scip->set, &nvars, &success) );
13630 
13631  if( !success )
13632  *approxchecknonzeros = TRUE;
13633  else
13634  *nchecknonzeros += nvars;
13635  }
13636  }
13637  }
13638  }
13639 
13640  return SCIP_OKAY;
13641 }
13642 
13643 
13644 /** initializes solving data structures and transforms problem
13645  *
13646  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
13647  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
13648  *
13649  * @pre This method can be called if @p scip is in one of the following stages:
13650  * - \ref SCIP_STAGE_PROBLEM
13651  * - \ref SCIP_STAGE_TRANSFORMED
13652  * - \ref SCIP_STAGE_INITPRESOLVE
13653  * - \ref SCIP_STAGE_PRESOLVING
13654  * - \ref SCIP_STAGE_EXITPRESOLVE
13655  * - \ref SCIP_STAGE_PRESOLVED
13656  * - \ref SCIP_STAGE_INITSOLVE
13657  * - \ref SCIP_STAGE_SOLVING
13658  * - \ref SCIP_STAGE_SOLVED
13659  * - \ref SCIP_STAGE_EXITSOLVE
13660  * - \ref SCIP_STAGE_FREETRANS
13661  * - \ref SCIP_STAGE_FREE
13662  *
13663  * @post When calling this method in the \ref SCIP_STAGE_PROBLEM stage, the \SCIP stage is changed to \ref
13664  * SCIP_STAGE_TRANSFORMED; otherwise, the stage is not changed
13665  *
13666  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
13667  */
13669  SCIP* scip /**< SCIP data structure */
13670  )
13671 {
13672  SCIP_Longint oldnsolsfound;
13673  int nfeassols;
13674  int ncandsols;
13675  int h;
13676  int s;
13677 
13678  SCIP_CALL( checkStage(scip, "SCIPtransformProb", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
13679 
13680  /* check, if the problem was already transformed */
13681  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
13682  return SCIP_OKAY;
13683 
13684  assert(scip->stat->status == SCIP_STATUS_UNKNOWN);
13685 
13686  /* check, if a node selector exists */
13687  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
13688  {
13689  SCIPerrorMessage("no node selector available\n");
13690  return SCIP_PLUGINNOTFOUND;
13691  }
13692 
13693  /* call garbage collector on original problem and parameter settings memory spaces */
13696 
13697  /* remember number of constraints */
13699 
13700  /* switch stage to TRANSFORMING */
13702 
13703  /* mark statistics before solving */
13704  SCIPstatMark(scip->stat);
13705 
13706  /* init solve data structures */
13710  SCIP_CALL( SCIPlpCreate(&scip->lp, scip->set, scip->messagehdlr, scip->stat, SCIPprobGetName(scip->origprob)) );
13711  SCIP_CALL( SCIPprimalCreate(&scip->primal) );
13712  SCIP_CALL( SCIPtreeCreate(&scip->tree, scip->mem->probmem, scip->set, SCIPsetGetNodesel(scip->set, scip->stat)) );
13713  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree) );
13714  SCIP_CALL( SCIPconflictCreate(&scip->conflict, scip->mem->probmem, scip->set) );
13715  SCIP_CALL( SCIPcliquetableCreate(&scip->cliquetable, scip->set, scip->mem->probmem) );
13716 
13717  /* copy problem in solve memory */
13718  SCIP_CALL( SCIPprobTransform(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree,
13719  scip->reopt, scip->lp, scip->branchcand, scip->eventfilter, scip->eventqueue, scip->conflictstore,
13720  &scip->transprob) );
13721 
13722  /* switch stage to TRANSFORMED */
13723  scip->set->stage = SCIP_STAGE_TRANSFORMED;
13724 
13725  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
13726  * cutoff bound if primal solution is already known
13727  */
13728  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
13729  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
13730 
13731  /* if possible, scale objective function such that it becomes integral with gcd 1 */
13732  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
13733  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
13734 
13735  /* check solution of solution candidate storage */
13736  nfeassols = 0;
13737  ncandsols = scip->origprimal->nsols;
13738  oldnsolsfound = 0;
13739 
13740  /* update upper bound and cutoff bound due to objective limit in primal data */
13741  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
13742  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
13743 
13744  if( !scip->set->reopt_enable )
13745  {
13746  oldnsolsfound = scip->primal->nsolsfound;
13747  for( s = scip->origprimal->nsols - 1; s >= 0; --s )
13748  {
13749  SCIP_Bool feasible;
13750  SCIP_SOL* sol;
13751 
13752  sol = scip->origprimal->sols[s];
13753 
13754  /* recompute objective function, since the objective might have changed in the meantime */
13755  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
13756 
13757  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
13758  * including modifiable constraints
13759  */
13760  SCIP_CALL( checkSolOrig(scip, sol, &feasible,
13762  FALSE, TRUE, TRUE, TRUE, TRUE) );
13763 
13764  if( feasible )
13765  {
13766  SCIP_Real abssolobj;
13767 
13768  abssolobj = REALABS(SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
13769 
13770  /* we do not want to add solutions with objective value +infinity */
13771  if( !SCIPisInfinity(scip, abssolobj) )
13772  {
13773  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
13774  SCIP_Bool stored;
13775 
13776  /* add primal solution to solution storage by copying it */
13777  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob,
13778  scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, &stored) );
13779 
13780  if( stored )
13781  {
13782  nfeassols++;
13783 
13784  if( bestsol != SCIPgetBestSol(scip) )
13785  SCIPstoreSolutionGap(scip);
13786  }
13787  }
13788  }
13789 
13790  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->origprimal) );
13791  scip->origprimal->nsols--;
13792  }
13793  }
13794 
13795  assert(scip->origprimal->nsols == 0);
13796 
13797  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
13798 
13799  if( nfeassols > 0 )
13800  {
13802  "%d/%d feasible solution%s given by solution candidate storage, new primal bound %.6e\n\n",
13803  nfeassols, ncandsols, (nfeassols > 1 ? "s" : ""), SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip)));
13804  }
13805  else if( ncandsols > 0 && !scip->set->reopt_enable )
13806  {
13808  "all %d solutions given by solution candidate storage are infeasible\n\n", ncandsols);
13809  }
13810 
13811  /* print transformed problem statistics */
13813  "transformed problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
13814  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
13815  scip->transprob->ncontvars, scip->transprob->nconss);
13816 
13817  for( h = 0; h < scip->set->nconshdlrs; ++h )
13818  {
13819  int nactiveconss;
13820 
13821  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
13822  if( nactiveconss > 0 )
13823  {
13825  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
13826  }
13827  }
13829 
13830  {
13831  SCIP_Real maxnonzeros;
13832  SCIP_Longint nchecknonzeros;
13833  SCIP_Longint nactivenonzeros;
13834  SCIP_Bool approxchecknonzeros;
13835  SCIP_Bool approxactivenonzeros;
13836 
13837  /* determine number of non-zeros */
13838  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
13839  maxnonzeros = MAX(maxnonzeros, 1.0);
13840  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
13841  scip->stat->nnz = nactivenonzeros;
13842  scip->stat->avgnnz = (SCIPgetNConss(scip) == 0 ? 0.0 : (SCIP_Real) nactivenonzeros / ((SCIP_Real) SCIPgetNConss(scip)));
13843 
13845  "original problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
13846  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
13847  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
13849  }
13850 
13851  /* call initialization methods of plugins */
13852  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
13853 
13854  /* in case the permutation seed is different to 0, permute the transformed problem */
13855  if( scip->set->random_permutationseed > 0 )
13856  {
13857  SCIP_Bool permuteconss;
13858  SCIP_Bool permutevars;
13859  int permutationseed;
13860 
13861  permuteconss = scip->set->random_permuteconss;
13862  permutevars = scip->set->random_permutevars;
13863  permutationseed = scip->set->random_permutationseed;
13864 
13865  SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss, permutevars, permutevars, permutevars, permutevars) );
13866  }
13867 
13868  if( scip->set->misc_estimexternmem )
13869  {
13870  if( scip->set->limit_memory < SCIP_MEM_NOLIMIT )
13871  {
13872  SCIP_Longint memused = SCIPgetMemUsed(scip);
13873 
13874  /* if the memory limit is set, we take 1% as the minimum external memory storage */
13875  scip->stat->externmemestim = MAX(memused, (SCIP_Longint) (0.01 * scip->set->limit_memory * 1048576.0));
13876  }
13877  else
13878  scip->stat->externmemestim = SCIPgetMemUsed(scip);
13879  SCIPdebugMsg(scip, "external memory usage estimated to %" SCIP_LONGINT_FORMAT " byte\n", scip->stat->externmemestim);
13880  }
13881 
13882  return SCIP_OKAY;
13883 }
13884 
13885 /** initializes presolving */
13886 static
13888  SCIP* scip /**< SCIP data structure */
13889  )
13890 {
13891  assert(scip != NULL);
13892  assert(scip->mem != NULL);
13893  assert(scip->set != NULL);
13894  assert(scip->stat != NULL);
13895  assert(scip->transprob != NULL);
13896  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
13897 
13898  /* retransform all existing solutions to original problem space, because the transformed problem space may
13899  * get modified in presolving and the solutions may become invalid for the transformed problem
13900  */
13901  SCIP_CALL( SCIPprimalRetransformSolutions(scip->primal, scip->set, scip->stat, scip->origprob, scip->transprob) );
13902 
13903  /* reset statistics for presolving and current branch and bound run */
13904  SCIPstatResetPresolving(scip->stat, scip->set, scip->transprob, scip->origprob);
13905 
13906  /* increase number of branch and bound runs */
13907  scip->stat->nruns++;
13908 
13909  /* remember problem size of previous run */
13910  scip->stat->prevrunnvars = scip->transprob->nvars;
13911 
13912  /* switch stage to INITPRESOLVE */
13914 
13915  /* create temporary presolving root node */
13916  SCIP_CALL( SCIPtreeCreatePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
13917  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
13918  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
13919 
13920  /* inform plugins that the presolving is abound to begin */
13921  SCIP_CALL( SCIPsetInitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
13922  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
13923  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
13924 
13925  /* delete the variables from the problems that were marked to be deleted */
13926  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
13927 
13928  /* switch stage to PRESOLVING */
13929  scip->set->stage = SCIP_STAGE_PRESOLVING;
13930 
13931  return SCIP_OKAY;
13932 }
13933 
13934 /** deinitializes presolving */
13935 static
13937  SCIP* scip, /**< SCIP data structure */
13938  SCIP_Bool solved, /**< is problem already solved? */
13939  SCIP_Bool* infeasible /**< pointer to store if the clique clean up detects an infeasibility */
13940  )
13941 {
13942  SCIP_VAR** vars;
13943  int nvars;
13944  int v;
13945 #ifndef NDEBUG
13946  size_t nusedbuffers;
13947  size_t nusedcleanbuffers;
13948 #endif
13949 
13950  assert(scip != NULL);
13951  assert(scip->mem != NULL);
13952  assert(scip->set != NULL);
13953  assert(scip->stat != NULL);
13954  assert(scip->transprob != NULL);
13955  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
13956  assert(infeasible != NULL);
13957 
13958  *infeasible = FALSE;
13959 
13960  /* switch stage to EXITPRESOLVE */
13962 
13963  if( !solved )
13964  {
13965  /* flatten all variables */
13966  vars = SCIPgetFixedVars(scip);
13967  nvars = SCIPgetNFixedVars(scip);
13968  assert(nvars == 0 || vars != NULL);
13969 
13970  for( v = nvars - 1; v >= 0; --v )
13971  {
13972  SCIP_VAR* var;
13973 #ifndef NDEBUG
13974  SCIP_VAR** multvars;
13975  int i;
13976 #endif
13977  var = vars[v]; /*lint !e613*/
13978  assert(var != NULL);
13979 
13981  {
13982  /* flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later-on */
13983  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
13984 
13985 #ifndef NDEBUG
13986  multvars = SCIPvarGetMultaggrVars(var);
13987  for( i = SCIPvarGetMultaggrNVars(var) - 1; i >= 0; --i)
13988  assert(SCIPvarGetStatus(multvars[i]) != SCIP_VARSTATUS_MULTAGGR);
13989 #endif
13990  }
13991  }
13992  }
13993 
13994  /* exitPresolve() might be called during the reading process of a file reader;
13995  * hence the number of used buffers does not need to be zero, however, it should not
13996  * change by calling SCIPsetExitprePlugins() or SCIPprobExitPresolve()
13997  */
13998 #ifndef NDEBUG
13999  nusedbuffers = BMSgetNUsedBufferMemory(SCIPbuffer(scip));
14000  nusedcleanbuffers = BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip));
14001 #endif
14002 
14003  /* inform plugins that the presolving is finished, and perform final modifications */
14004  SCIP_CALL( SCIPsetExitprePlugins(scip->set, scip->mem->probmem, scip->stat) );
14005  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14006  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14007 
14008  /* remove empty and single variable cliques from the clique table, and convert all two variable cliques
14009  * into implications
14010  * delete the variables from the problems that were marked to be deleted
14011  */
14012  if( !solved )
14013  {
14014  int nlocalbdchgs = 0;
14015 
14016  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14017  scip->cliquetable, scip->lp, scip->branchcand) );
14018 
14019  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
14020  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
14021  infeasible) );
14022 
14024  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
14025  }
14026 
14027  /* exit presolving */
14028  SCIP_CALL( SCIPprobExitPresolve(scip->transprob, scip->set) );
14029  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == nusedbuffers);
14030  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == nusedcleanbuffers);
14031 
14032  if( !solved )
14033  {
14034  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
14035  * cutoff bound if primal solution is already known
14036  */
14037  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
14038  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
14039 
14040  /* if possible, scale objective function such that it becomes integral with gcd 1 */
14041  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
14042  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
14043 
14044  scip->stat->lastlowerbound = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
14045 
14046  /* we need to update the primal dual integral here to update the last{upper/dual}bound values after a restart */
14047  if( scip->set->misc_calcintegral )
14048  {
14050  }
14051  }
14052 
14053  /* free temporary presolving root node */
14054  SCIP_CALL( SCIPtreeFreePresolvingRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr,
14055  scip->stat, scip->transprob, scip->origprob, scip->primal, scip->lp, scip->branchcand, scip->conflict,
14056  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable) );
14057 
14058  /* switch stage to PRESOLVED */
14059  scip->set->stage = SCIP_STAGE_PRESOLVED;
14060 
14061  return SCIP_OKAY;
14062 }
14063 
14064 /** applies one round of presolving with the given presolving timing
14065  *
14066  * This method will always be called with presoltiming fast first. It iterates over all presolvers, propagators, and
14067  * constraint handlers and calls their presolving callbacks with timing fast. If enough reductions are found, it
14068  * returns and the next presolving round will be started (again with timing fast). If the fast presolving does not
14069  * find enough reductions, this methods calls itself recursively with presoltiming medium. Again, it calls the
14070  * presolving callbacks of all presolvers, propagators, and constraint handlers with timing medium. If enough
14071  * reductions are found, it returns and the next presolving round will be started (with timing fast). Otherwise, it is
14072  * called recursively with presoltiming exhaustive. In exhaustive presolving, presolvers, propagators, and constraint
14073  * handlers are called w.r.t. their priority, but this time, we stop as soon as enough reductions were found and do not
14074  * necessarily call all presolving methods. If we stop, we return and another presolving round is started with timing
14075  * fast.
14076  *
14077  * @todo check if we want to do the following (currently disabled):
14078  * In order to avoid calling the same expensive presolving methods again and again (which is possibly ineffective
14079  * for the current instance), we continue the loop for exhaustive presolving where we stopped it the last time. The
14080  * {presol/prop/cons}start pointers are used to this end: they provide the plugins to start the loop with in the
14081  * current presolving round (if we reach exhaustive presolving), and are updated in this case to the next ones to be
14082  * called in the next round. In case we reach the end of the loop in exhaustive presolving, we call the method again
14083  * with exhaustive timing, now starting with the first presolving steps in the loop until we reach the ones we started
14084  * the last call with. This way, we won't stop until all exhaustive presolvers were called without finding enough
14085  * reductions (in sum).
14086  */
14087 static
14089  SCIP* scip, /**< SCIP data structure */
14090  SCIP_PRESOLTIMING* timing, /**< pointer to current presolving timing */
14091  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
14092  SCIP_Bool* infeasible, /**< pointer to store whether presolving detected infeasibility */
14093  SCIP_Bool lastround, /**< is this the last presolving round due to a presolving round limit? */
14094  int* presolstart, /**< pointer to get the presolver to start exhaustive presolving with in
14095  * the current round and store the one to start with in the next round */
14096  int presolend, /**< last presolver to treat in exhaustive presolving */
14097  int* propstart, /**< pointer to get the propagator to start exhaustive presolving with in
14098  * the current round and store the one to start with in the next round */
14099  int propend, /**< last propagator to treat in exhaustive presolving */
14100  int* consstart, /**< pointer to get the constraint handler to start exhaustive presolving with in
14101  * the current round and store the one to start with in the next round */
14102  int consend /**< last constraint handler to treat in exhaustive presolving */
14103  )
14104 {
14105  SCIP_RESULT result;
14106  SCIP_EVENT event;
14107  SCIP_Bool aborted;
14108  SCIP_Bool lastranpresol;
14109 #if 0
14110  int oldpresolstart = 0;
14111  int oldpropstart = 0;
14112  int oldconsstart = 0;
14113 #endif
14114  int priopresol;
14115  int prioprop;
14116  int i;
14117  int j;
14118  int k;
14119 
14120  assert(scip != NULL);
14121  assert(scip->set != NULL);
14122  assert(unbounded != NULL);
14123  assert(infeasible != NULL);
14124  assert(presolstart != NULL);
14125  assert(propstart != NULL);
14126  assert(consstart != NULL);
14127 
14128  assert((presolend == scip->set->npresols && propend == scip->set->nprops && consend == scip->set->nconshdlrs)
14129  || (*presolstart == 0 && *propstart == 0 && *consstart == 0));
14130 
14131  *unbounded = FALSE;
14132  *infeasible = FALSE;
14133  aborted = FALSE;
14134 
14135  assert( scip->set->propspresolsorted );
14136 
14137  if( *timing == SCIP_PRESOLTIMING_EXHAUSTIVE )
14138  {
14139  /* In exhaustive presolving, we continue the loop where we stopped last time to avoid calling the same
14140  * (possibly ineffective) presolving step again and again. If we reach the end of the arrays of presolvers,
14141  * propagators, and constraint handlers without having made enough reductions, we start again from the beginning
14142  */
14143  i = *presolstart;
14144  j = *propstart;
14145  k = *consstart;
14146 #if 0
14147  oldpresolstart = i;
14148  oldpropstart = j;
14149  oldconsstart = k;
14150 #endif
14151  if( i >= presolend && j >= propend && k >= consend )
14152  return SCIP_OKAY;
14153 
14154  if( i == 0 && j == 0 && k == 0 )
14155  ++(scip->stat->npresolroundsext);
14156  }
14157  else
14158  {
14159  /* in fast and medium presolving, we always iterate over all presolvers, propagators, and constraint handlers */
14160  assert(presolend == scip->set->npresols);
14161  assert(propend == scip->set->nprops);
14162  assert(consend == scip->set->nconshdlrs);
14163 
14164  i = 0;
14165  j = 0;
14166  k = 0;
14167 
14168  if( *timing == SCIP_PRESOLTIMING_FAST )
14169  ++(scip->stat->npresolroundsfast);
14170  if( *timing == SCIP_PRESOLTIMING_MEDIUM )
14171  ++(scip->stat->npresolroundsmed);
14172  }
14173 
14174  SCIPdebugMsg(scip, "starting presolving round %d (%d/%d/%d), timing = %u\n",
14176  scip->stat->npresolroundsext, *timing);
14177 
14178  /* call included presolvers with nonnegative priority */
14179  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
14180  {
14181  if( i < presolend )
14182  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
14183  else
14184  priopresol = -1;
14185 
14186  if( j < propend )
14187  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
14188  else
14189  prioprop = -1;
14190 
14191  /* call next propagator */
14192  if( prioprop >= priopresol )
14193  {
14194  /* only presolving methods which have non-negative priority will be called before constraint handlers */
14195  if( prioprop < 0 )
14196  break;
14197 
14198  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
14199  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
14201  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14202  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14203  &scip->stat->npresolchgsides, &result) );
14204  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
14205  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
14206 
14207  lastranpresol = FALSE;
14208  ++j;
14209  }
14210  /* call next presolver */
14211  else
14212  {
14213  /* only presolving methods which have non-negative priority will be called before constraint handlers */
14214  if( priopresol < 0 )
14215  break;
14216 
14217  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
14218  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
14220  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14221  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14222  &scip->stat->npresolchgsides, &result) );
14223  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
14224  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
14225 
14226  lastranpresol = TRUE;
14227  ++i;
14228  }
14229 
14230  if( result == SCIP_CUTOFF )
14231  {
14232  *infeasible = TRUE;
14233 
14234  if( lastranpresol )
14236  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
14237  else
14239  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14240  }
14241  else if( result == SCIP_UNBOUNDED )
14242  {
14243  *unbounded = TRUE;
14244 
14245  if( lastranpresol )
14247  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
14248  else
14250  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14251  }
14252 
14253  /* delete the variables from the problems that were marked to be deleted */
14254  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14255  scip->branchcand) );
14256 
14257  SCIPdebugMsg(scip, "presolving callback returned result <%d>\n", result);
14258 
14259  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14260  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14261  {
14262  assert(*consstart == 0);
14263 
14264  if( lastranpresol )
14265  {
14266  *presolstart = i + 1;
14267  *propstart = j;
14268  }
14269  else
14270  {
14271  *presolstart = i;
14272  *propstart = j + 1;
14273  }
14274  aborted = TRUE;
14275 
14276  break;
14277  }
14278  }
14279 
14280  /* call presolve methods of constraint handlers */
14281  while( k < consend && !(*unbounded) && !(*infeasible) && !aborted )
14282  {
14283  SCIPdebugMsg(scip, "executing presolve method of constraint handler <%s>\n",
14284  SCIPconshdlrGetName(scip->set->conshdlrs[k]));
14285  SCIP_CALL( SCIPconshdlrPresolve(scip->set->conshdlrs[k], scip->mem->probmem, scip->set, scip->stat,
14286  *timing, scip->stat->npresolrounds,
14288  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14289  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14290  &scip->stat->npresolchgsides, &result) );
14291  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
14292  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
14293 
14294  ++k;
14295 
14296  if( result == SCIP_CUTOFF )
14297  {
14298  *infeasible = TRUE;
14300  "constraint handler <%s> detected infeasibility\n", SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
14301  }
14302  else if( result == SCIP_UNBOUNDED )
14303  {
14304  *unbounded = TRUE;
14306  "constraint handler <%s> detected unboundedness (or infeasibility)\n",
14307  SCIPconshdlrGetName(scip->set->conshdlrs[k-1]));
14308  }
14309 
14310  /* delete the variables from the problems that were marked to be deleted */
14311  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14312  scip->branchcand) );
14313 
14314  SCIPdebugMsg(scip, "presolving callback returned with result <%d>\n", result);
14315 
14316  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14317  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14318  {
14319  *presolstart = i;
14320  *propstart = j;
14321  *consstart = k + 1;
14322  aborted = TRUE;
14323 
14324  break;
14325  }
14326  }
14327 
14328  assert( scip->set->propspresolsorted );
14329 
14330  /* call included presolvers with negative priority */
14331  while( !(*unbounded) && !(*infeasible) && !aborted && (i < presolend || j < propend) )
14332  {
14333  if( i < scip->set->npresols )
14334  priopresol = SCIPpresolGetPriority(scip->set->presols[i]);
14335  else
14336  priopresol = -INT_MAX;
14337 
14338  if( j < scip->set->nprops )
14339  prioprop = SCIPpropGetPresolPriority(scip->set->props_presol[j]);
14340  else
14341  prioprop = -INT_MAX;
14342 
14343  /* choose presolving */
14344  if( prioprop >= priopresol )
14345  {
14346  assert(prioprop <= 0);
14347 
14348  SCIPdebugMsg(scip, "executing presolving of propagator <%s>\n", SCIPpropGetName(scip->set->props_presol[j]));
14349  SCIP_CALL( SCIPpropPresol(scip->set->props_presol[j], scip->set, *timing, scip->stat->npresolrounds,
14351  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14352  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14353  &scip->stat->npresolchgsides, &result) );
14354  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
14355  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
14356 
14357  lastranpresol = FALSE;
14358  ++j;
14359  }
14360  else
14361  {
14362  assert(priopresol < 0);
14363 
14364  SCIPdebugMsg(scip, "executing presolver <%s>\n", SCIPpresolGetName(scip->set->presols[i]));
14365  SCIP_CALL( SCIPpresolExec(scip->set->presols[i], scip->set, *timing, scip->stat->npresolrounds,
14367  &scip->stat->npresolchgbds, &scip->stat->npresoladdholes, &scip->stat->npresoldelconss,
14368  &scip->stat->npresoladdconss, &scip->stat->npresolupgdconss, &scip->stat->npresolchgcoefs,
14369  &scip->stat->npresolchgsides, &result) );
14370  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
14371  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
14372 
14373  lastranpresol = TRUE;
14374  ++i;
14375  }
14376 
14377  if( result == SCIP_CUTOFF )
14378  {
14379  *infeasible = TRUE;
14380 
14381  if( lastranpresol )
14383  "presolver <%s> detected infeasibility\n", SCIPpresolGetName(scip->set->presols[i-1]));
14384  else
14386  "propagator <%s> detected infeasibility\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14387  }
14388  else if( result == SCIP_UNBOUNDED )
14389  {
14390  *unbounded = TRUE;
14391 
14392  if( lastranpresol )
14394  "presolver <%s> detected unboundedness (or infeasibility)\n", SCIPpresolGetName(scip->set->presols[i-1]));
14395  else
14397  "propagator <%s> detected unboundedness (or infeasibility)\n", SCIPpropGetName(scip->set->props_presol[j-1]));
14398  }
14399 
14400  /* delete the variables from the problems that were marked to be deleted */
14401  SCIP_CALL( SCIPprobPerformVarDeletions(scip->transprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp,
14402  scip->branchcand) );
14403 
14404  SCIPdebugMsg(scip, "presolving callback return with result <%d>\n", result);
14405 
14406  /* if we work off the exhaustive presolvers, we stop immediately if a reduction was found */
14407  if( (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE) && !lastround && !SCIPisPresolveFinished(scip) )
14408  {
14409  assert(k == consend);
14410 
14411  if( lastranpresol )
14412  {
14413  *presolstart = i + 1;
14414  *propstart = j;
14415  }
14416  else
14417  {
14418  *presolstart = i;
14419  *propstart = j + 1;
14420  }
14421  *consstart = k;
14422 
14423  break;
14424  }
14425  }
14426 
14427  /* remove empty and single variable cliques from the clique table */
14428  if( !(*unbounded) && !(*infeasible) )
14429  {
14430  int nlocalbdchgs = 0;
14431 
14432  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
14433  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
14434  infeasible) );
14435 
14436  if( nlocalbdchgs > 0 || *infeasible )
14438  "clique table cleanup detected %d bound changes%s\n", nlocalbdchgs, *infeasible ? " and infeasibility" : "");
14439 
14440  scip->stat->npresolfixedvars += nlocalbdchgs;
14441 
14442  if( !*infeasible && scip->set->nheurs > 0 )
14443  {
14444  /* call primal heuristics that are applicable during presolving */
14445  SCIP_Bool foundsol;
14446 
14447  SCIPdebugMsg(scip, "calling primal heuristics during presolving\n");
14448 
14449  /* call primal heuristics */
14450  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
14451  SCIP_HEURTIMING_DURINGPRESOLLOOP, FALSE, &foundsol, unbounded) );
14452 
14453  /* output a message, if a solution was found */
14454  if( foundsol )
14455  {
14456  SCIP_SOL* sol;
14457 
14458  assert(SCIPgetNSols(scip) > 0);
14459  sol = SCIPgetBestSol(scip);
14460  assert(sol != NULL);
14461  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
14462 
14464  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
14466  }
14467  }
14468  }
14469 
14470  if( !(*unbounded) && !(*infeasible) )
14471  {
14472  /* call more expensive presolvers */
14473  if( (SCIPisPresolveFinished(scip) || lastround) )
14474  {
14475  if( *timing != SCIP_PRESOLTIMING_FINAL )
14476  {
14477  assert((*timing == SCIP_PRESOLTIMING_FAST) || (*timing == SCIP_PRESOLTIMING_MEDIUM) || (*timing == SCIP_PRESOLTIMING_EXHAUSTIVE));
14478 
14479  SCIPdebugMsg(scip, "not enough reductions in %s presolving, running %s presolving now...\n",
14480  *timing == SCIP_PRESOLTIMING_FAST ? "fast" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "medium" : "exhaustive",
14481  *timing == SCIP_PRESOLTIMING_FAST ? "medium" : *timing == SCIP_PRESOLTIMING_MEDIUM ? "exhaustive" : "final");
14482 
14483  /* increase timing */
14485 
14486  /* computational experiments showed that always starting the loop of exhaustive presolvers from the beginning
14487  * performs better than continuing from the last processed presolver. Therefore, we start from 0, but keep
14488  * the mechanisms to possibly change this back later.
14489  * @todo try starting from the last processed exhaustive presolver
14490  */
14491  *presolstart = 0;
14492  *propstart = 0;
14493  *consstart = 0;
14494 
14495  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, presolstart, presolend,
14496  propstart, propend, consstart, consend) );
14497  }
14498 #if 0
14499  /* run remaining exhaustive presolvers (if we did not start from the beginning anyway) */
14500  else if( (oldpresolstart > 0 || oldpropstart > 0 || oldconsstart > 0) && presolend == scip->set->npresols
14501  && propend == scip->set->nprops && consend == scip->set->nconshdlrs )
14502  {
14503  int newpresolstart = 0;
14504  int newpropstart = 0;
14505  int newconsstart = 0;
14506 
14507  SCIPdebugMsg(scip, "reached end of exhaustive presolving loop, starting from the beginning...\n");
14508 
14509  SCIP_CALL( presolveRound(scip, timing, unbounded, infeasible, lastround, &newpresolstart,
14510  oldpresolstart, &newpropstart, oldpropstart, &newconsstart, oldconsstart) );
14511 
14512  *presolstart = newpresolstart;
14513  *propstart = newpropstart;
14514  *consstart = newconsstart;
14515  }
14516 #endif
14517  }
14518  }
14519 
14520  /* issue PRESOLVEROUND event */
14522  SCIP_CALL( SCIPeventProcess(&event, scip->set, NULL, NULL, NULL, scip->eventfilter) );
14523 
14524  return SCIP_OKAY;
14525 }
14526 
14527 
14528 /** loops through the included presolvers and constraint's presolve methods, until changes are too few */
14529 static
14531  SCIP* scip, /**< SCIP data structure */
14532  SCIP_Bool* unbounded, /**< pointer to store whether presolving detected unboundedness */
14533  SCIP_Bool* infeasible /**< pointer to store whether presolving detected infeasibility */
14534  )
14535 {
14536  SCIP_PRESOLTIMING presoltiming;
14537  SCIP_Bool finished;
14538  SCIP_Bool stopped;
14539  SCIP_Bool lastround;
14540  int presolstart = 0;
14541  int propstart = 0;
14542  int consstart = 0;
14543 
14544  assert(scip != NULL);
14545  assert(scip->mem != NULL);
14546  assert(scip->primal != NULL);
14547  assert(scip->set != NULL);
14548  assert(scip->stat != NULL);
14549  assert(scip->transprob != NULL);
14550  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING);
14551  assert(unbounded != NULL);
14552  assert(infeasible != NULL);
14553 
14554  *unbounded = FALSE;
14555 
14556  /* switch status to unknown */
14557  scip->stat->status = SCIP_STATUS_UNKNOWN;
14558 
14559  /* update upper bound and cutoff bound due to objective limit in primal data */
14560  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14561  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
14562 
14563  /* start presolving timer */
14564  SCIPclockStart(scip->stat->presolvingtime, scip->set);
14566 
14567  /* initialize presolving */
14568  if( scip->set->stage == SCIP_STAGE_TRANSFORMED )
14569  {
14570  SCIP_CALL( initPresolve(scip) );
14571  }
14572  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
14573 
14574  /* call primal heuristics that are applicable before presolving */
14575  if( scip->set->nheurs > 0 )
14576  {
14577  SCIP_Bool foundsol;
14578 
14579  SCIPdebugMsg(scip, "calling primal heuristics before presolving\n");
14580 
14581  /* call primal heuristics */
14582  SCIP_CALL( SCIPprimalHeuristics(scip->set, scip->stat, scip->transprob, scip->primal, NULL, NULL, NULL,
14583  SCIP_HEURTIMING_BEFOREPRESOL, FALSE, &foundsol, unbounded) );
14584 
14585  /* output a message, if a solution was found */
14586  if( foundsol )
14587  {
14588  SCIP_SOL* sol;
14589 
14590  assert(SCIPgetNSols(scip) > 0);
14591  sol = SCIPgetBestSol(scip);
14592  assert(sol != NULL);
14593  assert(SCIPgetSolOrigObj(scip,sol) != SCIP_INVALID); /*lint !e777*/
14594 
14596  "feasible solution found by %s heuristic after %.1f seconds, objective value %.6e\n",
14598  }
14599  }
14600 
14602 
14603  *infeasible = FALSE;
14604  *unbounded = (*unbounded) || (SCIPgetNSols(scip) > 0 && SCIPisInfinity(scip, -SCIPgetSolOrigObj(scip, SCIPgetBestSol(scip))));
14605 
14606  finished = (scip->set->presol_maxrounds != -1 && scip->stat->npresolrounds >= scip->set->presol_maxrounds)
14607  || (*unbounded) || (scip->set->reopt_enable && scip->stat->nreoptruns >= 1);
14608  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
14609 
14610  /* perform presolving rounds */
14611  while( !finished && !stopped )
14612  {
14613  /* store current number of reductions */
14615  scip->stat->lastnpresolaggrvars = scip->stat->npresolaggrvars;
14617  scip->stat->lastnpresolchgbds = scip->stat->npresolchgbds;
14618  scip->stat->lastnpresoladdholes = scip->stat->npresoladdholes;
14619  scip->stat->lastnpresoldelconss = scip->stat->npresoldelconss;
14620  scip->stat->lastnpresoladdconss = scip->stat->npresoladdconss;
14622  scip->stat->lastnpresolchgcoefs = scip->stat->npresolchgcoefs;
14623  scip->stat->lastnpresolchgsides = scip->stat->npresolchgsides;
14624 #ifdef SCIP_DISABLED_CODE
14625  scip->stat->lastnpresolimplications = scip->stat->nimplications;
14626  scip->stat->lastnpresolcliques = SCIPcliquetableGetNCliques(scip->cliquetable);
14627 #endif
14628 
14629  /* set presolving flag */
14630  scip->stat->performpresol = TRUE;
14631 
14632  /* sort propagators */
14633  SCIPsetSortPropsPresol(scip->set);
14634 
14635  /* sort presolvers by priority */
14636  SCIPsetSortPresols(scip->set);
14637 
14638  /* check if this will be the last presolving round (in that case, we want to run all presolvers) */
14639  lastround = (scip->set->presol_maxrounds == -1 ? FALSE : (scip->stat->npresolrounds + 1 >= scip->set->presol_maxrounds));
14640 
14641  presoltiming = SCIP_PRESOLTIMING_FAST;
14642 
14643  /* perform the presolving round by calling the presolvers, propagators, and constraint handlers */
14644  assert(!(*unbounded));
14645  assert(!(*infeasible));
14646  SCIP_CALL( presolveRound(scip, &presoltiming, unbounded, infeasible, lastround,
14647  &presolstart, scip->set->npresols, &propstart, scip->set->nprops, &consstart, scip->set->nconshdlrs) );
14648 
14649  /* check, if we should abort presolving due to not enough changes in the last round */
14650  finished = SCIPisPresolveFinished(scip) || presoltiming == SCIP_PRESOLTIMING_FINAL;
14651 
14652  SCIPdebugMsg(scip, "presolving round %d returned with unbounded = %u, infeasible = %u, finished = %u\n", scip->stat->npresolrounds, *unbounded, *infeasible, finished);
14653 
14654  /* check whether problem is infeasible or unbounded */
14655  finished = finished || *unbounded || *infeasible;
14656 
14657  /* increase round number */
14658  scip->stat->npresolrounds++;
14659 
14660  if( !finished )
14661  {
14662  /* print presolving statistics */
14664  "(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",
14665  scip->stat->npresolrounds, ( presoltiming == SCIP_PRESOLTIMING_FAST ? "fast)" :
14666  (presoltiming == SCIP_PRESOLTIMING_MEDIUM ? "medium)" :
14667  (presoltiming == SCIP_PRESOLTIMING_EXHAUSTIVE ?"exhaustive)" :
14668  "final)")) ),
14669  scip->stat->npresolfixedvars + scip->stat->npresolaggrvars,
14670  scip->stat->npresoldelconss, scip->stat->npresoladdconss,
14671  scip->stat->npresolchgbds, scip->stat->npresolchgsides,
14672  scip->stat->npresolchgcoefs, scip->stat->npresolupgdconss,
14674  }
14675 
14676  /* abort if time limit was reached or user interrupted */
14677  stopped = SCIPsolveIsStopped(scip->set, scip->stat, TRUE);
14678  }
14679 
14680  if( *infeasible || *unbounded )
14681  {
14682  /* first change status of scip, so that all plugins in their exitpre callbacks can ask SCIP for the correct status */
14683  if( *infeasible )
14684  {
14685  /* switch status to OPTIMAL */
14686  if( scip->primal->nlimsolsfound > 0 )
14687  {
14688  scip->stat->status = SCIP_STATUS_OPTIMAL;
14689  }
14690  else /* switch status to INFEASIBLE */
14692  }
14693  else if( scip->primal->nsols >= 1 ) /* switch status to UNBOUNDED */
14695  else /* switch status to INFORUNBD */
14697  }
14698 
14699  /* deinitialize presolving */
14700  if( finished && (!stopped || *unbounded || *infeasible) )
14701  {
14702  SCIP_Real maxnonzeros;
14703  SCIP_Longint nchecknonzeros;
14704  SCIP_Longint nactivenonzeros;
14705  SCIP_Bool approxchecknonzeros;
14706  SCIP_Bool approxactivenonzeros;
14707  SCIP_Bool infeas;
14708 
14709  SCIP_CALL( exitPresolve(scip, *unbounded || *infeasible, &infeas) );
14710  *infeasible = *infeasible || infeas;
14711 
14712  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
14713 
14714  /* resort variables if we are not already done */
14715  if( !(*infeasible) && !(*unbounded) )
14716  {
14717  /* (Re)Sort the variables, which appear in the four categories (binary, integer, implicit, continuous) after
14718  * presolve with respect to their original index (within their categories). Adjust the problem index afterwards
14719  * which is supposed to reflect the position in the variable array. This additional (re)sorting is supposed to
14720  * get more robust against the order presolving fixed variables. (We also reobtain a possible block structure
14721  * induced by the user model)
14722  */
14724  }
14725 
14726  /* determine number of non-zeros */
14727  maxnonzeros = (SCIP_Real)SCIPgetNConss(scip) * SCIPgetNVars(scip);
14728  maxnonzeros = MAX(maxnonzeros, 1.0);
14729  SCIP_CALL( calcNonZeros(scip, &nchecknonzeros, &nactivenonzeros, &approxchecknonzeros, &approxactivenonzeros) );
14730  scip->stat->nnz = nactivenonzeros;
14731 
14734  "presolved problem has %s%" SCIP_LONGINT_FORMAT " active (%g%%) nonzeros and %s%" SCIP_LONGINT_FORMAT " (%g%%) check nonzeros\n",
14735  approxactivenonzeros ? "more than " : "", nactivenonzeros, nactivenonzeros/maxnonzeros * 100,
14736  approxchecknonzeros ? "more than " : "", nchecknonzeros, nchecknonzeros/maxnonzeros * 100);
14738  }
14739  assert(BMSgetNUsedBufferMemory(SCIPbuffer(scip)) == 0);
14740  assert(BMSgetNUsedBufferMemory(SCIPcleanbuffer(scip)) == 0);
14741 
14742  /* stop presolving time */
14743  SCIPclockStop(scip->stat->presolvingtime, scip->set);
14745 
14746  /* print presolving statistics */
14748  "presolving (%d rounds: %d fast, %d medium, %d exhaustive):\n", scip->stat->npresolrounds,
14751  " %d deleted vars, %d deleted constraints, %d added constraints, %d tightened bounds, %d added holes, %d changed sides, %d changed coefficients\n",
14755  " %d implications, %d cliques\n", scip->stat->nimplications, SCIPcliquetableGetNCliques(scip->cliquetable));
14756 
14757  /* remember number of constraints */
14759 
14760  return SCIP_OKAY;
14761 }
14762 
14763 /** tries to transform original solutions to the transformed problem space */
14764 static
14766  SCIP* scip /**< SCIP data structure */
14767  )
14768 {
14769  SCIP_SOL** sols;
14770  SCIP_SOL* sol;
14771  SCIP_Real* solvals;
14772  SCIP_Bool* solvalset;
14773  SCIP_Bool added;
14774  SCIP_Longint oldnsolsfound;
14775  int nsols;
14776  int ntransvars;
14777  int naddedsols;
14778  int s;
14779 
14780  nsols = SCIPgetNSols(scip);
14781  oldnsolsfound = scip->primal->nsolsfound;
14782 
14783  /* no solution to transform */
14784  if( nsols == 0 )
14785  return SCIP_OKAY;
14786 
14787  SCIPdebugMsg(scip, "try to transfer %d original solutions into the transformed problem space\n", nsols);
14788 
14789  ntransvars = scip->transprob->nvars;
14790  naddedsols = 0;
14791 
14792  /* It might happen, that the added transferred solution does not equal the corresponding original one, which might
14793  * result in the array of solutions being changed. Thus we temporarily copy the array and traverse it in reverse
14794  * order to ensure that the regarded solution in the copied array was not already freed when new solutions were added
14795  * and the worst solutions were freed.
14796  */
14797  SCIP_CALL( SCIPduplicateBufferArray(scip, &sols, SCIPgetSols(scip), nsols) );
14798  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, ntransvars) );
14799  SCIP_CALL( SCIPallocBufferArray(scip, &solvalset, ntransvars) );
14800 
14801  for( s = nsols-1; s >= 0; --s )
14802  {
14803  sol = sols[s];
14804 
14805  /* it might happen that a transferred original solution has a better objective than its original counterpart
14806  * (e.g., because multi-aggregated variables get another value, but the solution is still feasible);
14807  * in this case, it might happen that the solution is not an original one and we just skip this solution
14808  */
14809  if( !SCIPsolIsOriginal(sol) )
14810  continue;
14811 
14812  SCIP_CALL( SCIPprimalTransformSol(scip->primal, sol, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
14813  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, solvals,
14814  solvalset, ntransvars, &added) );
14815 
14816  if( added )
14817  ++naddedsols;
14818  }
14819 
14820  if( naddedsols > 0 )
14821  {
14823  "transformed %d/%d original solutions to the transformed problem space\n",
14824  naddedsols, nsols);
14825 
14826  scip->stat->nexternalsolsfound += scip->primal->nsolsfound - oldnsolsfound;
14827  }
14828 
14829  SCIPfreeBufferArray(scip, &solvalset);
14830  SCIPfreeBufferArray(scip, &solvals);
14831  SCIPfreeBufferArray(scip, &sols);
14832 
14833  return SCIP_OKAY;
14834 }
14835 
14836 /** initializes solution process data structures */
14837 static
14839  SCIP* scip, /**< SCIP data structure */
14840  SCIP_Bool solved /**< is problem already solved? */
14841  )
14842 {
14843  assert(scip != NULL);
14844  assert(scip->mem != NULL);
14845  assert(scip->set != NULL);
14846  assert(scip->stat != NULL);
14847  assert(scip->nlp == NULL);
14848  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
14849 
14850  /**@todo check whether other methodscan be skipped if problem has been solved */
14851  /* if problem has been solved, several time consuming tasks must not be performed */
14852  if( !solved )
14853  {
14854  /* reset statistics for current branch and bound run */
14855  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, solved);
14857 
14858  /* LP is empty anyway; mark empty LP to be solved and update validsollp counter */
14859  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
14860 
14861  /* update upper bound and cutoff bound due to objective limit in primal data */
14862  SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14863  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
14864  }
14865 
14866  /* switch stage to INITSOLVE */
14867  scip->set->stage = SCIP_STAGE_INITSOLVE;
14868 
14869  /* initialize NLP if there are nonlinearities */
14870  if( scip->transprob->nlpenabled && !scip->set->nlp_disable )
14871  {
14872  SCIPdebugMsg(scip, "constructing empty NLP\n");
14873 
14874  SCIP_CALL( SCIPnlpCreate(&scip->nlp, scip->mem->probmem, scip->set, scip->stat, SCIPprobGetName(scip->transprob), scip->transprob->nvars) );
14875  assert(scip->nlp != NULL);
14876 
14877  SCIP_CALL( SCIPnlpAddVars(scip->nlp, scip->mem->probmem, scip->set, scip->transprob->nvars, scip->transprob->vars) );
14878  }
14879 
14880  /* possibly create visualization output file */
14881  SCIP_CALL( SCIPvisualInit(scip->stat->visual, scip->mem->probmem, scip->set, scip->messagehdlr) );
14882 
14883  /* initialize solution process data structures */
14886  SCIP_CALL( SCIPcutpoolCreate(&scip->cutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, TRUE) );
14887  SCIP_CALL( SCIPcutpoolCreate(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->set->sepa_cutagelimit, FALSE) );
14888  SCIP_CALL( SCIPtreeCreateRoot(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14889  scip->lp) );
14890 
14891  /* update dual bound of the root node if a valid dual bound is at hand */
14892  if( scip->transprob->dualbound < SCIP_INVALID )
14893  {
14894  SCIP_Real internobjval = SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->transprob->dualbound);
14895 
14896  scip->stat->lastlowerbound = internobjval;
14897 
14898  SCIPnodeUpdateLowerbound(SCIPtreeGetRootNode(scip->tree), scip->stat, scip->set, scip->tree, scip->transprob,
14899  scip->origprob, internobjval);
14900  }
14901 
14902  /* try to transform original solutions to the transformed problem space */
14903  if( scip->set->misc_transorigsols )
14904  {
14905  SCIP_CALL( transformSols(scip) );
14906  }
14907 
14908  /* inform the transformed problem that the branch and bound process starts now */
14909  SCIP_CALL( SCIPprobInitSolve(scip->transprob, scip->set) );
14910 
14911  /* inform plugins that the branch and bound process starts now */
14912  SCIP_CALL( SCIPsetInitsolPlugins(scip->set, scip->mem->probmem, scip->stat) );
14913 
14914  /* remember number of constraints */
14916 
14917  /* if all variables are known, calculate a trivial primal bound by setting all variables to their worst bound */
14918  if( scip->set->nactivepricers == 0 )
14919  {
14920  SCIP_VAR* var;
14921  SCIP_Real obj;
14922  SCIP_Real objbound;
14923  SCIP_Real bd;
14924  int v;
14925 
14926  objbound = 0.0;
14927  for( v = 0; v < scip->transprob->nvars && !SCIPsetIsInfinity(scip->set, objbound); ++v )
14928  {
14929  var = scip->transprob->vars[v];
14930  obj = SCIPvarGetObj(var);
14931  if( !SCIPsetIsZero(scip->set, obj) )
14932  {
14933  bd = SCIPvarGetWorstBoundGlobal(var);
14934  if( SCIPsetIsInfinity(scip->set, REALABS(bd)) )
14935  objbound = SCIPsetInfinity(scip->set);
14936  else
14937  objbound += obj * bd;
14938  }
14939  }
14940 
14941  /* adjust primal bound, such that solution with worst bound may be found */
14942  objbound += SCIPsetCutoffbounddelta(scip->set);
14943 
14944  /* update cutoff bound */
14945  if( !SCIPsetIsInfinity(scip->set, objbound) && SCIPsetIsLT(scip->set, objbound, scip->primal->cutoffbound) )
14946  {
14947  /* adjust cutoff bound */
14948  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
14949  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, objbound, FALSE) );
14950  }
14951  }
14952 
14953  /* switch stage to SOLVING */
14954  scip->set->stage = SCIP_STAGE_SOLVING;
14955 
14956  return SCIP_OKAY;
14957 }
14958 
14959 /** frees solution process data structures */
14960 static
14962  SCIP* scip, /**< SCIP data structure */
14963  SCIP_Bool restart /**< was this free solve call triggered by a restart? */
14964  )
14965 {
14966  assert(scip != NULL);
14967  assert(scip->mem != NULL);
14968  assert(scip->set != NULL);
14969  assert(scip->stat != NULL);
14970  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
14971 
14972  /* mark that we are currently restarting */
14973  if( restart )
14974  {
14975  scip->stat->inrestart = TRUE;
14976 
14977  /* copy the current dual bound into the problem data structure such that it can be used initialize the new search
14978  * tree
14979  */
14981  }
14982 
14983  /* remove focus from the current focus node */
14984  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
14985  {
14986  SCIP_NODE* node = NULL;
14987  SCIP_Bool cutoff;
14988 
14989  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
14990  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
14991  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
14992  assert(!cutoff);
14993  }
14994 
14995  /* switch stage to EXITSOLVE */
14996  scip->set->stage = SCIP_STAGE_EXITSOLVE;
14997 
14998  /* deinitialize conflict store */
14999  SCIP_CALL( SCIPconflictstoreClean(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15000 
15001  /* inform plugins that the branch and bound process is finished */
15002  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, restart) );
15003 
15004  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
15005  if( scip->nlp != NULL )
15006  {
15007  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
15008  }
15009  scip->transprob->nlpenabled = FALSE;
15010 
15011  /* clear the LP, and flush the changes to clear the LP of the solver */
15012  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15014 
15015  /* resets the debug environment */
15016  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
15017 
15018  /* clear all row references in internal data structures */
15019  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15020  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15021 
15022  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
15023  * subroots have to be released
15024  */
15025  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15026 
15027  /* deinitialize transformed problem */
15028  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, restart) );
15029 
15030  /* free solution process data structures */
15031  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15032  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15035 
15036  /* possibly close visualization output file */
15037  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
15038 
15039  /* reset statistics for current branch and bound run */
15041  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, TRUE);
15042  else
15043  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
15044 
15045  /* switch stage to TRANSFORMED */
15046  scip->set->stage = SCIP_STAGE_TRANSFORMED;
15047 
15048  /* restart finished */
15049  assert( ! restart || scip->stat->inrestart );
15050  scip->stat->inrestart = FALSE;
15051 
15052  return SCIP_OKAY;
15053 }
15054 
15055 /** frees solution process data structures when reoptimization is used
15056  *
15057  * in contrast to a freeSolve() this method will preserve the transformed problem such that another presolving round
15058  * after changing the problem (modifying the objective function) is not necessary.
15059  */
15060 static
15062  SCIP* scip /**< SCIP data structure */
15063  )
15064 {
15065  assert(scip != NULL);
15066  assert(scip->mem != NULL);
15067  assert(scip->set != NULL);
15068  assert(scip->stat != NULL);
15069  assert(scip->set->stage == SCIP_STAGE_SOLVING || scip->set->stage == SCIP_STAGE_SOLVED);
15070 
15071  /* remove focus from the current focus node */
15072  if( SCIPtreeGetFocusNode(scip->tree) != NULL )
15073  {
15074  SCIP_NODE* node = NULL;
15075  SCIP_Bool cutoff;
15076 
15077  SCIP_CALL( SCIPnodeFocus(&node, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
15078  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->conflict,
15079  scip->conflictstore, scip->eventfilter, scip->eventqueue, scip->cliquetable, &cutoff, FALSE, TRUE) );
15080  assert(!cutoff);
15081  }
15082 
15083  /* deinitialize conflict store */
15084  SCIP_CALL( SCIPconflictstoreClean(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15085 
15086  /* invalidate the dual bound */
15088 
15089  /* switch stage to EXITSOLVE */
15090  scip->set->stage = SCIP_STAGE_EXITSOLVE;
15091 
15092  /* inform plugins that the branch and bound process is finished */
15093  SCIP_CALL( SCIPsetExitsolPlugins(scip->set, scip->mem->probmem, scip->stat, FALSE) );
15094 
15095  /* call exit methods of plugins */
15096  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15097 
15098  /* free the NLP, if there is one, and reset the flags indicating nonlinearity */
15099  if( scip->nlp != NULL )
15100  {
15101  SCIP_CALL( SCIPnlpFree(&scip->nlp, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
15102  }
15103  scip->transprob->nlpenabled = FALSE;
15104 
15105  /* clear the LP, and flush the changes to clear the LP of the solver */
15106  SCIP_CALL( SCIPlpReset(scip->lp, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter) );
15108 
15109  /* resets the debug environment */
15110  SCIP_CALL( SCIPdebugReset(scip->set) ); /*lint !e506 !e774*/
15111 
15112  /* clear all row references in internal data structures */
15113  SCIP_CALL( SCIPcutpoolClear(scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15114  SCIP_CALL( SCIPcutpoolClear(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15115 
15116  /* we have to clear the tree prior to the problem deinitialization, because the rows stored in the forks and
15117  * subroots have to be released
15118  */
15119  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15120 
15121  /* deinitialize transformed problem */
15122  SCIP_CALL( SCIPprobExitSolve(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, FALSE) );
15123 
15124  /* free solution process data structures */
15125  SCIP_CALL( SCIPrelaxationFree(&scip->relaxation, scip->mem->probmem, scip->primal) );
15126 
15127  SCIP_CALL( SCIPcutpoolFree(&scip->cutpool, scip->mem->probmem, scip->set, scip->lp) );
15128  SCIP_CALL( SCIPcutpoolFree(&scip->delayedcutpool, scip->mem->probmem, scip->set, scip->lp) );
15131 
15132  /* possibly close visualization output file */
15133  SCIPvisualExit(scip->stat->visual, scip->set, scip->messagehdlr);
15134 
15135  /* reset statistics for current branch and bound run */
15136  SCIPstatResetCurrentRun(scip->stat, scip->set, scip->transprob, scip->origprob, FALSE);
15137 
15138  /* switch stage to PRESOLVED */
15139  scip->set->stage = SCIP_STAGE_PRESOLVED;
15140 
15141  /* restart finished */
15142  scip->stat->inrestart = FALSE;
15143 
15144  /* reset solving specific paramters */
15145  if( scip->set->reopt_enable )
15146  {
15147  assert(scip->reopt != NULL);
15148  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
15149  }
15150 
15151  /* free the debug solution which might live in transformed primal data structure */
15152  SCIP_CALL( SCIPprimalClear(&scip->primal, scip->mem->probmem) );
15153 
15154  if( scip->set->misc_resetstat )
15155  {
15156  /* reset statistics to the point before the problem was transformed */
15157  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
15158  }
15159  else
15160  {
15161  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
15163  }
15164 
15165  /* reset objective limit */
15167 
15168  scip->transprob->objscale = 1.0;
15169  scip->transprob->objisintegral = FALSE;
15170 
15171  return SCIP_OKAY;
15172 }
15173 
15174 /** free transformed problem */
15175 static
15177  SCIP* scip /**< SCIP data structure */
15178  )
15179 {
15180  assert(scip != NULL);
15181  assert(scip->mem != NULL);
15182  assert(scip->stat != NULL);
15183  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED || scip->set->stage == SCIP_STAGE_PRESOLVING);
15184 
15185  /* call exit methods of plugins */
15186  SCIP_CALL( SCIPsetExitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15187 
15188  /* copy best primal solutions to original solution candidate list */
15189  if( !scip->set->reopt_enable && scip->set->limit_maxorigsol > 0 && scip->set->misc_transsolsorig )
15190  {
15191  SCIP_Bool stored;
15192  SCIP_Bool hasinfval;
15193  int maxsols;
15194  int nsols;
15195  int s;
15196 
15197  assert(scip->origprimal->nsols == 0);
15198 
15199  nsols = scip->primal->nsols;
15200  maxsols = scip->set->limit_maxorigsol;
15201  stored = TRUE;
15202  s = 0;
15203 
15204  /* iterate over all solutions as long as the original solution candidate store size limit is not reached */
15205  while( s < nsols && scip->origprimal->nsols < maxsols )
15206  {
15207  SCIP_SOL* sol;
15208 
15209  sol = scip->primal->sols[s];
15210  assert(sol != NULL);
15211 
15212  if( !SCIPsolIsOriginal(sol) )
15213  {
15214  /* retransform solution into the original problem space */
15215  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
15216  }
15217  else
15218  hasinfval = FALSE;
15219 
15220  /* removing infinite fixings is turned off by the corresponding parameter */
15221  if( !scip->set->misc_finitesolstore )
15222  hasinfval = FALSE;
15223 
15224  if( !hasinfval )
15225  {
15226  /* add solution to original candidate solution storage */
15227  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, &stored) );
15228  }
15229  else
15230  {
15231  SCIP_SOL* newsol;
15232  SCIP_Bool success;
15233 
15234  SCIP_CALL( SCIPcreateFiniteSolCopy(scip, &newsol, sol, &success) );
15235 
15236  /* infinite fixing could be removed */
15237  if( newsol != NULL )
15238  {
15239  /* add solution to original candidate solution storage; we must not use SCIPprimalAddOrigSolFree()
15240  * because we want to create a copy of the solution in the origprimal solution store, but newsol was
15241  * created in the (transformed) primal
15242  */
15243  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, newsol, &stored) );
15244 
15245  /* free solution in (transformed) primal where it was created */
15246  SCIP_CALL( SCIPsolFree(&newsol, scip->mem->probmem, scip->primal) );
15247  }
15248  }
15249  ++s;
15250  }
15251 
15252  if( scip->origprimal->nsols > 1 )
15253  {
15255  "stored the %d best primal solutions in the original solution candidate list\n", scip->origprimal->nsols);
15256  }
15257  else if( scip->origprimal->nsols == 1 )
15258  {
15260  "stored the best primal solution in the original solution candidate list\n");
15261  }
15262  }
15263 
15264  /* switch stage to FREETRANS */
15265  scip->set->stage = SCIP_STAGE_FREETRANS;
15266 
15267  /* reset solving specific paramters */
15268  if( scip->set->reopt_enable )
15269  {
15270  assert(scip->reopt != NULL);
15271  SCIP_CALL( SCIPreoptReset(scip->reopt, scip->set, scip->mem->probmem) );
15272  }
15273 
15274  /* @todo if a variable was removed from the problem during solving, its locks were not reduced;
15275  * we might want to remove locks also in that case
15276  */
15277  /* remove var locks set to avoid dual reductions */
15278  if( scip->set->reopt_enable || !scip->set->misc_allowdualreds )
15279  {
15280  int v;
15281 
15282  /* unlock all variables */
15283  for(v = 0; v < scip->transprob->nvars; v++)
15284  {
15285  SCIP_CALL( SCIPaddVarLocks(scip, scip->transprob->vars[v], -1, -1) );
15286  }
15287  }
15288 
15289  /* clean the conflict store
15290  *
15291  * since the conflict store can contain transformed constraints we need to remove them. the store will be finally
15292  * freed in SCIPfreeProb().
15293  */
15294  SCIP_CALL( SCIPconflictstoreClean(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
15295 
15296  /* free transformed problem data structures */
15297  SCIP_CALL( SCIPprobFree(&scip->transprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15299  SCIP_CALL( SCIPconflictFree(&scip->conflict, scip->mem->probmem) );
15300  SCIP_CALL( SCIPrelaxationFree(&scip->relaxation, scip->mem->probmem, scip->primal) );
15301  SCIP_CALL( SCIPtreeFree(&scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15302 
15303  /* free the debug solution which might live in transformed primal data structure */
15304  SCIP_CALL( SCIPdebugFreeSol(scip->set) ); /*lint !e506 !e774*/
15305  SCIP_CALL( SCIPprimalFree(&scip->primal, scip->mem->probmem) );
15306 
15307  SCIP_CALL( SCIPlpFree(&scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter) );
15309  SCIP_CALL( SCIPeventfilterFree(&scip->eventfilter, scip->mem->probmem, scip->set) );
15311 
15312  if( scip->set->misc_resetstat )
15313  {
15314  /* reset statistics to the point before the problem was transformed */
15315  SCIPstatReset(scip->stat, scip->set, scip->transprob, scip->origprob);
15316  }
15317  else
15318  {
15319  /* even if statistics are not completely reset, a partial reset of the primal-dual integral is necessary */
15321  }
15322 
15323  /* switch stage to PROBLEM */
15324  scip->set->stage = SCIP_STAGE_PROBLEM;
15325 
15326  /* reset objective limit */
15328 
15329  /* reset original variable's local and global bounds to their original values */
15330  SCIP_CALL( SCIPprobResetBounds(scip->origprob, scip->mem->probmem, scip->set, scip->stat) );
15331 
15332  return SCIP_OKAY;
15333 }
15334 
15335 /** displays most relevant statistics after problem was solved */
15336 static
15338  SCIP* scip /**< SCIP data structure */
15339  )
15340 {
15341  assert(scip != NULL);
15342 
15343  /* display most relevant statistics */
15344  if( scip->set->disp_verblevel >= SCIP_VERBLEVEL_NORMAL )
15345  {
15346  SCIP_Bool objlimitreached = FALSE;
15347 
15348  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
15349  && !SCIPisInfinity(scip, getPrimalbound(scip)) )
15350  objlimitreached = TRUE;
15351 
15352  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
15353  SCIPmessagePrintInfo(scip->messagehdlr, "SCIP Status : ");
15354  SCIP_CALL( SCIPprintStage(scip, NULL) );
15355  SCIPmessagePrintInfo(scip->messagehdlr, "\n");
15356  if( scip->set->reopt_enable )
15357  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f (over %d runs: %.2f)\n", SCIPclockGetTime(scip->stat->solvingtime), scip->stat->nreoptruns, SCIPclockGetTime(scip->stat->solvingtimeoverall));
15358  else
15359  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Time (sec) : %.2f\n", SCIPclockGetTime(scip->stat->solvingtime));
15360  if( scip->stat->nruns > 1 )
15361  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (total of %" SCIP_LONGINT_FORMAT " nodes in %d runs)\n",
15362  scip->stat->nnodes, scip->stat->ntotalnodes, scip->stat->nruns);
15363  else if( scip->set->reopt_enable )
15364  {
15365  SCIP_BRANCHRULE* branchrule;
15366 
15367  branchrule = SCIPfindBranchrule(scip, "nodereopt");
15368  assert(branchrule != NULL);
15369 
15370  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " reactivated)\n", scip->stat->nnodes, SCIPbranchruleGetNChildren(branchrule));
15371  }
15372  else
15373  SCIPmessagePrintInfo(scip->messagehdlr, "Solving Nodes : %" SCIP_LONGINT_FORMAT "\n", scip->stat->nnodes);
15374  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED && scip->set->stage <= SCIP_STAGE_EXITSOLVE )
15375  {
15376  if( objlimitreached )
15377  {
15378  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions)\n",
15379  SCIPinfinity(scip), scip->primal->nsolsfound);
15380  }
15381  else
15382  {
15383  char limsolstring[SCIP_MAXSTRLEN];
15384  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
15385  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
15386  else
15387  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN,"");
15388 
15389  SCIPmessagePrintInfo(scip->messagehdlr, "Primal Bound : %+.14e (%" SCIP_LONGINT_FORMAT " solutions%s)\n",
15390  getPrimalbound(scip), scip->primal->nsolsfound, limsolstring);
15391  }
15392  }
15393  if( scip->set->stage >= SCIP_STAGE_SOLVING && scip->set->stage <= SCIP_STAGE_SOLVED )
15394  {
15395  if( objlimitreached )
15396  {
15397  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", SCIPinfinity(scip));
15398  }
15399  else
15400  {
15401  SCIPmessagePrintInfo(scip->messagehdlr, "Dual Bound : %+.14e\n", getDualbound(scip));
15402  }
15403  SCIPmessagePrintInfo(scip->messagehdlr, "Gap : ");
15404  if( SCIPsetIsInfinity(scip->set, SCIPgetGap(scip)) )
15405  SCIPmessagePrintInfo(scip->messagehdlr, "infinite\n");
15406  else
15407  SCIPmessagePrintInfo(scip->messagehdlr, "%.2f %%\n", 100.0*SCIPgetGap(scip));
15408  }
15409 
15410  /* check solution for feasibility in original problem */
15411  if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
15412  {
15413  SCIP_SOL* sol;
15414 
15415  sol = SCIPgetBestSol(scip);
15416  if( sol != NULL )
15417  {
15418  SCIP_Real checkfeastolfac;
15419  SCIP_Real oldfeastol;
15420  SCIP_Bool dispallviols;
15421  SCIP_Bool feasible;
15422 
15423  oldfeastol = SCIPfeastol(scip);
15424  SCIP_CALL( SCIPgetRealParam(scip, "numerics/checkfeastolfac", &checkfeastolfac) );
15425  SCIP_CALL( SCIPgetBoolParam(scip, "display/allviols", &dispallviols) );
15426 
15427  /* scale feasibility tolerance by set->num_checkfeastolfac */
15428  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
15429  {
15430  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol * checkfeastolfac) );
15431  }
15432 
15433  SCIP_CALL( SCIPcheckSolOrig(scip, sol, &feasible, TRUE, dispallviols) );
15434 
15435  /* restore old feasibilty tolerance */
15436  if( !SCIPisEQ(scip, checkfeastolfac, 1.0) )
15437  {
15438  SCIP_CALL( SCIPchgFeastol(scip, oldfeastol) );
15439  }
15440 
15441  if( !feasible )
15442  {
15443  SCIPmessagePrintInfo(scip->messagehdlr, "best solution is not feasible in original problem\n");
15444  }
15445  }
15446  }
15447  }
15448 
15449  return SCIP_OKAY;
15450 }
15451 
15452 /** calls compression based on the reoptimization structure after the presolving */
15453 static
15455  SCIP* scip /**< global SCIP settings */
15456  )
15457 {
15458  SCIP_RESULT result;
15459  int c;
15460  int noldnodes;
15461  int nnewnodes;
15462 
15463  result = SCIP_DIDNOTFIND;
15464 
15465  noldnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
15466 
15467  /* do not run if there exists only the root node */
15468  if( noldnodes <= 1 )
15469  return SCIP_OKAY;
15470 
15471  /* do not run a tree compression if the problem contains (implicit) integer variables */
15472  if( scip->transprob->nintvars > 0 || scip->transprob->nimplvars > 0 )
15473  return SCIP_OKAY;
15474 
15476  "tree compression:\n");
15478  " given tree has %d nodes.\n", noldnodes);
15479 
15480  /* sort compressions by priority */
15481  SCIPsetSortComprs(scip->set);
15482 
15483  for(c = 0; c < scip->set->ncomprs; c++)
15484  {
15485  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
15486 
15487  /* call tree compression technique */
15488  SCIP_CALL( SCIPcomprExec(scip->set->comprs[c], scip->set, scip->reopt, &result) );
15489 
15490  if( result == SCIP_SUCCESS )
15491  {
15492  nnewnodes = SCIPreoptGetNNodes(scip->reopt, scip->tree->root);
15494  " <%s> compressed the search tree to %d nodes (rate %g).\n", SCIPcomprGetName(scip->set->comprs[c]),
15495  nnewnodes, ((SCIP_Real)nnewnodes)/noldnodes);
15496 
15497  break;
15498  }
15499  }
15500 
15501  if( result != SCIP_SUCCESS )
15502  {
15503  assert(result == SCIP_DIDNOTFIND || result == SCIP_DIDNOTRUN);
15505  " search tree could not be compressed.\n");
15506  }
15507 
15508  return SCIP_OKAY;
15509 }
15510 
15511 /* prepare all plugins and data structures for a reoptimization run */
15512 static
15514  SCIP* scip /**< SCIP data structure */
15515  )
15516 {
15517  SCIP_Bool reoptrestart;
15518 
15519  assert(scip != NULL);
15520  assert(scip->set->reopt_enable);
15521 
15522  /* @ todo: we could check if the problem is feasible, eg, by backtracking */
15523 
15524  /* increase number of reopt_runs */
15525  ++scip->stat->nreoptruns;
15526 
15527  /* inform the reoptimization plugin that a new iteration starts */
15528  SCIP_CALL( SCIPreoptAddRun(scip->reopt, scip->set, scip->mem->probmem, scip->origprob->vars,
15529  scip->origprob->nvars, scip->set->limit_maxsol) );
15530 
15531  /* check whether we need to add globally valid constraints */
15532  if( scip->set->reopt_sepaglbinfsubtrees || scip->set->reopt_sepabestsol )
15533  {
15534  SCIP_CALL( SCIPreoptApplyGlbConss(scip, scip->reopt, scip->set, scip->stat, scip->mem->probmem) );
15535  }
15536 
15537  /* after presolving the problem the first time we remember all global bounds and active constraints. bounds and
15538  * constraints will be restored within SCIPreoptInstallBounds() and SCIPreoptResetActiveConss().
15539  */
15540  if( scip->stat->nreoptruns == 1 )
15541  {
15542  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15543 
15544  SCIP_CALL( SCIPreoptSaveGlobalBounds(scip->reopt, scip->transprob, scip->mem->probmem) );
15545 
15546  SCIP_CALL( SCIPreoptSaveActiveConss(scip->reopt, scip->transprob, scip->mem->probmem) );
15547  }
15548  /* we are at least in the second run */
15549  else
15550  {
15551  assert(scip->transprob != NULL);
15552 
15553  SCIP_CALL( SCIPreoptMergeVarHistory(scip->reopt, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
15554 
15555  SCIP_CALL( SCIPrelaxationCreate(&scip->relaxation, scip->mem->probmem, scip->set, scip->stat, scip->primal,
15556  scip->tree) );
15557 
15558  /* mark statistics before solving */
15559  SCIPstatMark(scip->stat);
15560 
15562 
15563  /* install globally valid lower and upper bounds */
15564  SCIP_CALL( SCIPreoptInstallBounds(scip->reopt, scip->set, scip->stat, scip->transprob, scip->lp, scip->branchcand,
15565  scip->eventqueue, scip->cliquetable, scip->mem->probmem) );
15566 
15567  SCIP_CALL( SCIPreoptResetActiveConss(scip->reopt, scip->set, scip->stat) );
15568 
15569  /* check whether we want to restart the tree search */
15570  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, NULL, scip->transprob->vars,
15571  scip->transprob->nvars, &reoptrestart) );
15572 
15573  /* check, whether objective value is always integral by inspecting the problem, if it is the case adjust the
15574  * cutoff bound if primal solution is already known
15575  */
15576  SCIP_CALL( SCIPprobCheckObjIntegral(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat,
15577  scip->primal, scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
15578 
15579  /* if possible, scale objective function such that it becomes integral with gcd 1 */
15580  SCIP_CALL( SCIPprobScaleObj(scip->transprob, scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->primal,
15581  scip->tree, scip->reopt, scip->lp, scip->eventqueue) );
15582 
15583  /* call initialization methods of plugins */
15584  SCIP_CALL( SCIPsetInitPlugins(scip->set, scip->mem->probmem, scip->stat) );
15585 
15587  }
15588 
15589  /* try to compress the search tree */
15590  if( scip->set->compr_enable )
15591  {
15592  SCIP_CALL( compressReoptTree(scip) );
15593  }
15594 
15595  return SCIP_OKAY;
15596 }
15597 
15598 /** transforms and presolves problem
15599  *
15600  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15601  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15602  *
15603  * @pre This method can be called if @p scip is in one of the following stages:
15604  * - \ref SCIP_STAGE_PROBLEM
15605  * - \ref SCIP_STAGE_TRANSFORMED
15606  * - \ref SCIP_STAGE_PRESOLVING
15607  * - \ref SCIP_STAGE_PRESOLVED
15608  *
15609  * @post After calling this method \SCIP reaches one of the following stages:
15610  * - \ref SCIP_STAGE_PRESOLVING if the presolving process was interrupted
15611  * - \ref SCIP_STAGE_PRESOLVED if the presolving process was finished and did not solve the problem
15612  * - \ref SCIP_STAGE_SOLVED if the problem was solved during presolving
15613  *
15614  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
15615  */
15617  SCIP* scip /**< SCIP data structure */
15618  )
15619 {
15620  SCIP_Bool unbounded;
15621  SCIP_Bool infeasible;
15622 
15623  SCIP_CALL( checkStage(scip, "SCIPpresolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
15624 
15625  /* start solving timer */
15626  SCIPclockStart(scip->stat->solvingtime, scip->set);
15627  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
15628 
15629  /* capture the CTRL-C interrupt */
15630  if( scip->set->misc_catchctrlc )
15632 
15633  /* reset the user interrupt flag */
15634  scip->stat->userinterrupt = FALSE;
15635 
15636  switch( scip->set->stage )
15637  {
15638  case SCIP_STAGE_PROBLEM:
15639  /* initialize solving data structures and transform problem */
15640  SCIP_CALL( SCIPtransformProb(scip) );
15641  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
15642 
15643  /*lint -fallthrough*/
15644 
15646  case SCIP_STAGE_PRESOLVING:
15647  /* presolve problem */
15648  SCIP_CALL( presolve(scip, &unbounded, &infeasible) );
15649  assert(scip->set->stage == SCIP_STAGE_PRESOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING);
15650 
15651  if( infeasible || unbounded )
15652  {
15653  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15654 
15655  /* initialize solving process data structures to be able to switch to SOLVED stage */
15656  SCIP_CALL( initSolve(scip, TRUE) );
15657 
15658  /* switch stage to SOLVED */
15659  scip->set->stage = SCIP_STAGE_SOLVED;
15660 
15661  /* print solution message */
15662  switch( scip->stat->status )/*lint --e{788}*/
15663  {
15664  case SCIP_STATUS_OPTIMAL:
15665  /* remove the root node from the tree, s.t. the lower bound is set to +infinity ???????????? (see initSolve())*/
15666  SCIP_CALL( SCIPtreeClear(scip->tree, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
15667  break;
15668 
15671  "presolving detected infeasibility\n");
15672  break;
15673 
15674  case SCIP_STATUS_UNBOUNDED:
15676  "presolving detected unboundedness\n");
15677  break;
15678 
15679  case SCIP_STATUS_INFORUNBD:
15681  "presolving detected unboundedness (or infeasibility)\n");
15682  break;
15683 
15684  default:
15685  /* note that this is in an internal SCIP error since the status is corrupted */
15686  SCIPerrorMessage("invalid SCIP status <%d>\n", scip->stat->status);
15687  SCIPABORT();
15688  return SCIP_ERROR; /*lint !e527*/
15689  }
15690  }
15691  else if( scip->set->stage == SCIP_STAGE_PRESOLVED )
15692  {
15693  int h;
15694 
15695  /* print presolved problem statistics */
15697  "presolved problem has %d variables (%d bin, %d int, %d impl, %d cont) and %d constraints\n",
15698  scip->transprob->nvars, scip->transprob->nbinvars, scip->transprob->nintvars, scip->transprob->nimplvars,
15699  scip->transprob->ncontvars, scip->transprob->nconss);
15700 
15701  for( h = 0; h < scip->set->nconshdlrs; ++h )
15702  {
15703  int nactiveconss;
15704 
15705  nactiveconss = SCIPconshdlrGetNActiveConss(scip->set->conshdlrs[h]);
15706  if( nactiveconss > 0 )
15707  {
15709  "%7d constraints of type <%s>\n", nactiveconss, SCIPconshdlrGetName(scip->set->conshdlrs[h]));
15710  }
15711  }
15712 
15713  if( SCIPprobIsObjIntegral(scip->transprob) )
15714  {
15716  "transformed objective value is always integral (scale: %.15g)\n", scip->transprob->objscale);
15717  }
15718  }
15719  else
15720  {
15721  assert(scip->set->stage == SCIP_STAGE_PRESOLVING);
15722  SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_HIGH, "presolving was interrupted.\n");
15723  }
15724 
15725  /* display timing statistics */
15727  "Presolving Time: %.2f\n", SCIPclockGetTime(scip->stat->presolvingtime));
15728  break;
15729 
15730  case SCIP_STAGE_PRESOLVED:
15731  case SCIP_STAGE_SOLVED:
15732  break;
15733 
15734  default:
15735  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
15736  return SCIP_INVALIDCALL;
15737  } /*lint !e788*/
15738 
15739  /* release the CTRL-C interrupt */
15740  if( scip->set->misc_catchctrlc )
15742 
15743  /* stop solving timer */
15744  SCIPclockStop(scip->stat->solvingtime, scip->set);
15745  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
15746 
15747  if( scip->set->stage == SCIP_STAGE_SOLVED )
15748  {
15749  /* display most relevant statistics */
15751  }
15752 
15753  return SCIP_OKAY;
15754 }
15755 
15756 /** transforms, presolves, and solves problem
15757  *
15758  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
15759  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
15760  *
15761  * @pre This method can be called if @p scip is in one of the following stages:
15762  * - \ref SCIP_STAGE_PROBLEM
15763  * - \ref SCIP_STAGE_TRANSFORMED
15764  * - \ref SCIP_STAGE_PRESOLVING
15765  * - \ref SCIP_STAGE_PRESOLVED
15766  * - \ref SCIP_STAGE_SOLVING
15767  * - \ref SCIP_STAGE_SOLVED
15768  *
15769  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
15770  * process was interrupted:
15771  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
15772  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
15773  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
15774  *
15775  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
15776  */
15778  SCIP* scip /**< SCIP data structure */
15779  )
15780 {
15781  SCIP_Bool statsprinted = FALSE;
15782  SCIP_Bool restart;
15783 
15784  SCIP_CALL( checkStage(scip, "SCIPsolve", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
15785 
15786  /* if the stage is already SCIP_STAGE_SOLVED do nothing */
15787  if( scip->set->stage == SCIP_STAGE_SOLVED )
15788  return SCIP_OKAY;
15789 
15791  {
15792  SCIPwarningMessage(scip, "SCIPsolve() was called, but problem is already solved\n");
15793  return SCIP_OKAY;
15794  }
15795 
15796  /* check, if a node selector exists */
15797  if( SCIPsetGetNodesel(scip->set, scip->stat) == NULL )
15798  {
15799  SCIPerrorMessage("no node selector available\n");
15800  return SCIP_PLUGINNOTFOUND;
15801  }
15802 
15803  /* check, if an integrality constraint handler exists if there are integral variables */
15804  if( (SCIPgetNBinVars(scip) >= 0 || SCIPgetNIntVars(scip) >= 0) && SCIPfindConshdlr(scip, "integral") == NULL )
15805  {
15806  SCIPwarningMessage(scip, "integrality constraint handler not available\n");
15807  }
15808 
15809  /* initialize presolving flag (may be modified in SCIPpresolve()) */
15810  scip->stat->performpresol = FALSE;
15811 
15812  /* start solving timer */
15813  SCIPclockStart(scip->stat->solvingtime, scip->set);
15814  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
15815 
15816  /* capture the CTRL-C interrupt */
15817  if( scip->set->misc_catchctrlc )
15819 
15820  /* reset the user interrupt flag */
15821  scip->stat->userinterrupt = FALSE;
15822 
15823  /* automatic restarting loop */
15824  restart = scip->stat->userrestart;
15825 
15826  do
15827  {
15828  if( restart )
15829  {
15830  /* free the solving process data in order to restart */
15831  assert(scip->set->stage == SCIP_STAGE_SOLVING);
15832  if( scip->stat->userrestart )
15834  "(run %d, node %" SCIP_LONGINT_FORMAT ") performing user restart\n",
15835  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
15836  else
15838  "(run %d, node %" SCIP_LONGINT_FORMAT ") restarting after %d global fixings of integer variables\n",
15839  scip->stat->nruns, scip->stat->nnodes, scip->stat->nrootintfixingsrun);
15840  /* an extra blank line should be printed separately since the buffer message handler only handles up to one line
15841  * correctly */
15843  SCIP_CALL( freeSolve(scip, TRUE) );
15844  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
15845  }
15846  restart = FALSE;
15847  scip->stat->userrestart = FALSE;
15848 
15849  switch( scip->set->stage )
15850  {
15851  case SCIP_STAGE_PROBLEM:
15853  case SCIP_STAGE_PRESOLVING:
15854  /* initialize solving data structures, transform and problem */
15855 
15856  SCIP_CALL( SCIPpresolve(scip) );
15857  /* remember that we already printed the relevant statistics */
15858  if( scip->set->stage == SCIP_STAGE_SOLVED )
15859  statsprinted = TRUE;
15860 
15861  if( scip->set->stage == SCIP_STAGE_SOLVED || scip->set->stage == SCIP_STAGE_PRESOLVING )
15862  break;
15863  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
15864 
15865  /*lint -fallthrough*/
15866 
15867  case SCIP_STAGE_PRESOLVED:
15868  /* check if reoptimization is enabled and global constraints are saved */
15869  if( scip->set->reopt_enable )
15870  {
15872  }
15873 
15874  /* initialize solving process data structures */
15875  SCIP_CALL( initSolve(scip, FALSE) );
15876  assert(scip->set->stage == SCIP_STAGE_SOLVING);
15878 
15879  /*lint -fallthrough*/
15880 
15881  case SCIP_STAGE_SOLVING:
15882  /* reset display */
15883  SCIPstatResetDisplay(scip->stat);
15884 
15885  /* continue solution process */
15886  SCIP_CALL( SCIPsolveCIP(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->mem, scip->origprob, scip->transprob,
15887  scip->primal, scip->tree, scip->reopt, scip->lp, scip->relaxation, scip->pricestore, scip->sepastore,
15888  scip->cutpool, scip->delayedcutpool, scip->branchcand, scip->conflict, scip->conflictstore,
15889  scip->eventfilter, scip->eventqueue, scip->cliquetable, &restart) );
15890 
15891  /* detect, whether problem is solved */
15892  if( SCIPtreeGetNNodes(scip->tree) == 0 && SCIPtreeGetCurrentNode(scip->tree) == NULL )
15893  {
15894  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
15895  || scip->stat->status == SCIP_STATUS_INFEASIBLE
15896  || scip->stat->status == SCIP_STATUS_UNBOUNDED
15897  || scip->stat->status == SCIP_STATUS_INFORUNBD);
15898  assert(!restart);
15899 
15900  /* tree is empty, and no current node exists -> problem is solved */
15901  scip->set->stage = SCIP_STAGE_SOLVED;
15902  }
15903  break;
15904 
15905  case SCIP_STAGE_SOLVED:
15906  assert(scip->stat->status == SCIP_STATUS_OPTIMAL
15907  || scip->stat->status == SCIP_STATUS_INFEASIBLE
15908  || scip->stat->status == SCIP_STATUS_UNBOUNDED
15909  || scip->stat->status == SCIP_STATUS_INFORUNBD);
15910 
15911  break;
15912 
15913  default:
15914  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
15915  return SCIP_INVALIDCALL;
15916  } /*lint !e788*/
15917  }
15918  while( restart && !SCIPsolveIsStopped(scip->set, scip->stat, TRUE) );
15919 
15920  /* we have to store all unprocessed nodes if reoptimization is enabled */
15921  if( scip->set->reopt_enable && scip->set->stage != SCIP_STAGE_PRESOLVING
15922  && SCIPsolveIsStopped(scip->set, scip->stat, TRUE) )
15923  {
15924  /* save unprocessed nodes */
15925  if( SCIPgetNNodesLeft(scip) > 0 )
15926  {
15927  SCIP_NODE** leaves;
15928  SCIP_NODE** children;
15929  SCIP_NODE** siblings;
15930  int nleaves;
15931  int nchildren;
15932  int nsiblings;
15933 
15934  /* get all open leave nodes */
15935  SCIP_CALL( SCIPgetLeaves(scip, &leaves, &nleaves) );
15936 
15937  /* get all open children nodes */
15938  SCIP_CALL( SCIPgetChildren(scip, &children, &nchildren) );
15939 
15940  /* get all open sibling nodes */
15941  SCIP_CALL( SCIPgetSiblings(scip, &siblings, &nsiblings) );
15942 
15943  /* add all open node to the reoptimization tree */
15944  SCIP_CALL( SCIPreoptSaveOpenNodes(scip->reopt, scip->set, scip->lp, scip->mem->probmem, leaves, nleaves,
15945  children, nchildren, siblings, nsiblings) );
15946  }
15947  }
15948 
15949  /* release the CTRL-C interrupt */
15950  if( scip->set->misc_catchctrlc )
15952 
15953  if( scip->set->reopt_enable )
15954  {
15955  /* save found solutions */
15956  int nsols;
15957  int s;
15958 
15959  nsols = scip->set->reopt_savesols == -1 ? INT_MAX : MAX(scip->set->reopt_savesols, 1);
15960  nsols = MIN(scip->primal->nsols, nsols);
15961 
15962  for( s = 0; s < nsols; s++ )
15963  {
15964  SCIP_SOL* sol;
15965  SCIP_Bool added;
15966 
15967  sol = scip->primal->sols[s];
15968  assert(sol != NULL);
15969 
15970  if( !SCIPsolIsOriginal(sol) )
15971  {
15972  SCIP_Bool hasinfval;
15973 
15974  /* retransform solution into the original problem space */
15975  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
15976  }
15977 
15978  if( SCIPsolGetNodenum(sol) > 0 || SCIPsolGetHeur(sol) != NULL || (s == 0 && scip->set->reopt_sepabestsol) )
15979  {
15980  /* if the best solution should be separated, we must not store it in the solution tree */
15981  if( s == 0 && scip->set->reopt_sepabestsol )
15982  {
15983  SCIP_CALL( SCIPreoptAddOptSol(scip->reopt, sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal,
15984  scip->origprob->vars, scip->origprob->nvars) );
15985  }
15986  /* add solution to solution tree */
15987  else
15988  {
15989  SCIPdebugMsg(scip, "try to add solution to the solution tree:\n");
15990  SCIPdebug( SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob,
15991  scip->transprob, NULL, FALSE, FALSE) ); );
15992 
15993  SCIP_CALL( SCIPreoptAddSol(scip->reopt, scip->set, scip->stat, scip->origprimal, scip->mem->probmem,
15994  sol, s == 0, &added, scip->origprob->vars, scip->origprob->nvars, scip->stat->nreoptruns) );
15995  }
15996  }
15997  }
15998 
15999  SCIPdebugMsg(scip, "-> saved %d solution.\n", nsols);
16000 
16001  /* store variable history */
16002  if( scip->set->reopt_storevarhistory )
16003  {
16004  SCIP_CALL( SCIPreoptUpdateVarHistory(scip->reopt, scip->set, scip->stat, scip->mem->probmem,
16005  scip->origprob->vars, scip->origprob->nvars) );
16006  }
16007  }
16008 
16009  /* stop solving timer */
16010  SCIPclockStop(scip->stat->solvingtime, scip->set);
16011  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
16012 
16013  /* decrease time limit during reoptimization */
16014  if( scip->set->reopt_enable && scip->set->reopt_commontimelimit )
16015  {
16016  SCIP_Real timelimit;
16017  SCIP_Real usedtime;
16018 
16019  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
16020  usedtime = SCIPgetSolvingTime(scip);
16021  timelimit = timelimit - usedtime;
16022  timelimit = MAX(0, timelimit);
16023 
16024  SCIP_CALL( SCIPsetRealParam(scip, "limits/time", timelimit) );
16025  }
16026 
16027  if( !statsprinted )
16028  {
16029  /* display most relevant statistics */
16031  }
16032 
16033  return SCIP_OKAY;
16034 }
16035 
16036 /** transforms, presolves, and solves problem using the configured concurrent solvers
16037  *
16038  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16039  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16040  *
16041  * @pre This method can be called if @p scip is in one of the following stages:
16042  * - \ref SCIP_STAGE_PROBLEM
16043  * - \ref SCIP_STAGE_TRANSFORMED
16044  * - \ref SCIP_STAGE_PRESOLVING
16045  * - \ref SCIP_STAGE_PRESOLVED
16046  * - \ref SCIP_STAGE_SOLVING
16047  * - \ref SCIP_STAGE_SOLVED
16048  *
16049  * @post After calling this method \SCIP reaches one of the following stages depending on if and when the solution
16050  * process was interrupted:
16051  * - \ref SCIP_STAGE_PRESOLVING if the solution process was interrupted during presolving
16052  * - \ref SCIP_STAGE_SOLVING if the solution process was interrupted during the tree search
16053  * - \ref SCIP_STAGE_SOLVED if the solving process was not interrupted
16054  *
16055  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16056  */
16058  SCIP* scip /**< SCIP data structure */
16059  )
16060 {
16061 #ifdef TPI_NONE
16062  SCIPinfoMessage(scip, NULL, "SCIP was compiled without task processing interface. Parallel solve not possible\n");
16063  return SCIP_OKAY;
16064 #else
16065  SCIP_RETCODE retcode;
16066  int i;
16067  SCIP_RANDNUMGEN* rndgen;
16068  int minnthreads;
16069  int maxnthreads;
16070 
16071  SCIP_CALL( checkStage(scip, "SCIPsolveParallel", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16072 
16073  SCIP_CALL( SCIPsetIntParam(scip, "timing/clocktype", SCIP_CLOCKTYPE_WALL) );
16074 
16075  minnthreads = scip->set->parallel_minnthreads;
16076  maxnthreads = scip->set->parallel_maxnthreads;
16077 
16078  if( minnthreads > maxnthreads )
16079  {
16080  SCIPerrorMessage("minimum number of threads greater than maximum number of threads\n");
16081  return SCIP_INVALIDDATA;
16082  }
16083  if( scip->concurrent == NULL )
16084  {
16085  int nconcsolvertypes;
16086  SCIP_CONCSOLVERTYPE** concsolvertypes;
16087  SCIP_Longint nthreads;
16088  SCIP_Real memorylimit;
16089  int* solvertypes;
16090  SCIP_Longint* weights;
16091  SCIP_Real* prios;
16092  int ncandsolvertypes;
16093  SCIP_Real prefpriosum;
16094 
16095  /* check if concurrent solve is configured to presolve the problem
16096  * before setting up the concurrent solvers
16097  */
16098  if( scip->set->concurrent_presolvebefore )
16099  {
16100  /* if yes, then presolve the problem */
16101  SCIP_CALL( SCIPpresolve(scip) );
16102  }
16103  else
16104  {
16105  SCIP_Bool infeas;
16106 
16107  /* if not, transform the problem and switch stage to presolved */
16108  SCIP_CALL( SCIPtransformProb(scip) );
16109  SCIP_CALL( initPresolve(scip) );
16110  SCIP_CALL( exitPresolve(scip, TRUE, &infeas) );
16111  assert(!infeas);
16112  }
16113 
16114  /* the presolving must have run into a limit, so we stop here */
16115  if( scip->set->stage < SCIP_STAGE_PRESOLVED )
16116  {
16118  return SCIP_OKAY;
16119  }
16120 
16121  nthreads = INT_MAX;
16122  /* substract the memory already used by the main SCIP and the estimated memory usage of external software */
16123  memorylimit = scip->set->limit_memory;
16124  if( memorylimit < SCIP_MEM_NOLIMIT )
16125  {
16126  memorylimit -= SCIPgetMemUsed(scip)/1048576.0;
16127  memorylimit -= SCIPgetMemExternEstim(scip)/1048576.0;
16128  /* estimate maximum number of copies that be created based on memory limit */
16129  nthreads = MAX(1, memorylimit / (4.0*SCIPgetMemExternEstim(scip)/1048576.0));
16130  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "estimated a maximum of %lli threads based on memory limit\n", nthreads);
16131  }
16132  nconcsolvertypes = SCIPgetNConcsolverTypes(scip);
16133  concsolvertypes = SCIPgetConcsolverTypes(scip);
16134 
16135  if( minnthreads > nthreads )
16136  {
16137  SCIP_CALL( initSolve(scip, TRUE) );
16138  scip->stat->status = SCIP_STATUS_MEMLIMIT;
16140  SCIPwarningMessage(scip, "requested minimum number of threads could not be satisfied with given memory limit\n");
16142  return SCIP_OKAY;
16143  }
16144 
16145  if( nthreads == 1 )
16146  {
16147  SCIPwarningMessage(scip, "can only use 1 thread, doing sequential solve instead\n");
16148  SCIP_CALL( SCIPfreeConcurrent(scip) );
16149  return SCIPsolve(scip);
16150  }
16151  nthreads = MIN(nthreads, maxnthreads);
16152  SCIPverbMessage(scip, SCIP_VERBLEVEL_FULL, NULL, "using %lli threads for concurrent solve\n", nthreads);
16153 
16154  /* now set up nthreads many concurrent solvers that will be used for the concurrent solve
16155  * using the preferred priorities of each concurrent solver
16156  */
16157  prefpriosum = 0.0;
16158  for( i = 0; i < nconcsolvertypes; ++i )
16159  prefpriosum += SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]);
16160 
16161  ncandsolvertypes = 0;
16162  SCIP_CALL( SCIPallocBufferArray(scip, &solvertypes, nthreads + nconcsolvertypes) );
16163  SCIP_CALL( SCIPallocBufferArray(scip, &weights, nthreads + nconcsolvertypes) );
16164  SCIP_CALL( SCIPallocBufferArray(scip, &prios, nthreads + nconcsolvertypes) );
16165  for( i = 0; i < nconcsolvertypes; ++i )
16166  {
16167  int j;
16168  SCIP_Real prio;
16169  prio = nthreads * SCIPconcsolverTypeGetPrefPrio(concsolvertypes[i]) / prefpriosum;
16170  while( prio > 0.0 )
16171  {
16172  j = ncandsolvertypes++;
16173  assert(j < 2*nthreads);
16174  weights[j] = 1;
16175  solvertypes[j] = i;
16176  prios[j] = MIN(1.0, prio);
16177  prio = prio - 1.0;
16178  }
16179  }
16180  /* select nthreads many concurrent solver types to create instances
16181  * according to the preferred prioriteis the user has set
16182  * This basically corresponds to a knapsack problem
16183  * with unit weights and capacity nthreads, where the profits are
16184  * the unrounded fraction of the total number of threads to be used.
16185  */
16186  SCIPselectDownRealInt(prios, solvertypes, nthreads, ncandsolvertypes);
16187 
16189  for( i = 0; i < nthreads; ++i )
16190  {
16191  SCIP_CONCSOLVER* concsolver;
16192 
16193  SCIP_CALL( SCIPconcsolverCreateInstance(scip->set, concsolvertypes[solvertypes[i]], &concsolver) );
16194  if( scip->set->concurrent_changeseeds && SCIPgetNConcurrentSolvers(scip) > 1 )
16195  SCIP_CALL( SCIPconcsolverInitSeeds(concsolver, SCIPrandomGetInt(rndgen, 0, INT_MAX)) );
16196  }
16197  SCIPrandomFree(&rndgen);
16198  SCIPfreeBufferArray(scip, &prios);
16199  SCIPfreeBufferArray(scip, &weights);
16200  SCIPfreeBufferArray(scip, &solvertypes);
16201 
16202  assert(SCIPgetNConcurrentSolvers(scip) == nthreads);
16203 
16204  SCIP_CALL( SCIPsyncstoreInit(scip) );
16205  }
16206 
16207  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVED )
16208  {
16209  /* switch stage to solving */
16210  SCIP_CALL( initSolve(scip, TRUE) );
16211  }
16212 
16213  SCIPclockStart(scip->stat->solvingtime, scip->set);
16214  retcode = SCIPsolveConcurrent(scip);
16215  SCIPclockStop(scip->stat->solvingtime, scip->set);
16217 
16218  return retcode;
16219 #endif
16220 }
16221 
16222 /** include specific heuristics and branching rules for reoptimization
16223  *
16224  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16225  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16226  *
16227  * @pre This method can be called if @p scip is in one of the following stages:
16228  * - \ref SCIP_STAGE_PROBLEM
16229  */
16231  SCIP* scip, /**< SCIP data structure */
16232  SCIP_Bool enable /**< enable reoptimization (TRUE) or disable it (FALSE) */
16233  )
16234 {
16235  assert(scip != NULL);
16236 
16237  /* we want to skip if nothing has changed */
16238  if( (enable && scip->set->reopt_enable && scip->reopt != NULL)
16239  || (!enable && !scip->set->reopt_enable && scip->reopt == NULL) )
16240  return SCIP_OKAY;
16241 
16242  /* check stage and throw an error if we try to disable reoptimization during the solving process.
16243  *
16244  * @note the case that we will disable the reoptimization and have already performed presolving can only happen if
16245  * we are try to solve a general MIP
16246  *
16247  * @note this fix is only for the bugfix release 3.2.1, in the next major release reoptimization can be used for
16248  * general MIPs, too.
16249  */
16250  if( scip->set->stage > SCIP_STAGE_PROBLEM && !(!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
16251  {
16252  SCIPerrorMessage("reoptimization cannot be %s after starting the (pre)solving process\n", enable ? "enabled" : "disabled");
16253  return SCIP_INVALIDCALL;
16254  }
16255 
16256  /* if the current stage is SCIP_STAGE_PROBLEM we have to include the heuristics and branching rule */
16257  if( scip->set->stage == SCIP_STAGE_PROBLEM || (!enable && scip->set->stage == SCIP_STAGE_PRESOLVED) )
16258  {
16259  /* initialize all reoptimization data structures */
16260  if( enable && scip->reopt == NULL )
16261  {
16262  SCIP_CALL( SCIPreoptCreate(&scip->reopt, scip->set, scip->mem->probmem) );
16264  }
16265  /* disable all reoptimization plugins and free the structure if necessary */
16266  else if( (!enable && scip->reopt != NULL) || (!enable && scip->set->reopt_enable && scip->reopt == NULL) )
16267  {
16268  if( scip->reopt != NULL )
16269  {
16270  SCIP_CALL( SCIPreoptFree(&(scip->reopt), scip->set, scip->origprimal, scip->mem->probmem) );
16271  assert(scip->reopt == NULL);
16272  }
16274  }
16275  }
16276 
16277  /* set enable flag */
16278  scip->set->reopt_enable = enable;
16279 
16280  return SCIP_OKAY;
16281 }
16282 
16283 /** save bound change based on dual information in the reoptimization tree
16284  *
16285  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16286  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16287  *
16288  * @pre This method can be called if @p scip is in one of the following stages:
16289  * - \ref SCIP_STAGE_SOLVING
16290  * - \ref SCIP_STAGE_SOLVED
16291  */
16293  SCIP* scip, /**< SCIP data structure */
16294  SCIP_NODE* node, /**< node of the search tree */
16295  SCIP_VAR* var, /**< variable whose bound changed */
16296  SCIP_Real newbound, /**< new bound of the variable */
16297  SCIP_Real oldbound /**< old bound of the variable */
16298  )
16299 {
16300  SCIP_CALL( checkStage(scip, "SCIPaddReoptDualBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16301 
16302  assert(SCIPsetIsFeasLT(scip->set, newbound, oldbound) || SCIPsetIsFeasGT(scip->set, newbound, oldbound));
16303 
16304  SCIP_CALL( SCIPreoptAddDualBndchg(scip->reopt, scip->set, scip->mem->probmem, node, var, newbound, oldbound) );
16305 
16306  return SCIP_OKAY;
16307 }
16308 
16309 /** returns the optimal solution of the last iteration or NULL of none exists */
16311  SCIP* scip /**< SCIP data structure */
16312  )
16313 {
16314  SCIP_SOL* sol;
16315 
16316  assert(scip != NULL);
16317 
16318  sol = NULL;
16319 
16320  if( scip->set->reopt_enable && scip->stat->nreoptruns > 1 )
16321  {
16322  sol = SCIPreoptGetLastBestSol(scip->reopt);
16323  }
16324 
16325  return sol;
16326 }
16327 
16328 /** returns the objective coefficent of a given variable in a previous iteration
16329  *
16330  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16331  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16332  *
16333  * @pre This method can be called if @p scip is in one of the following stages:
16334  * - \ref SCIP_STAGE_PRESOLVING
16335  * - \ref SCIP_STAGE_SOLVING
16336  */
16338  SCIP* scip, /**< SCIP data structure */
16339  SCIP_VAR* var, /**< variable */
16340  int run, /**< number of the run */
16341  SCIP_Real* objcoef /**< pointer to store the objective coefficient */
16342  )
16343 {
16344  assert(scip != NULL);
16345  assert(var != NULL);
16346  assert(0 < run && run <= scip->stat->nreoptruns);
16347 
16348  SCIP_CALL( checkStage(scip, "SCIPgetReoptOldObjCoef", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16349 
16350  if( SCIPvarIsOriginal(var) )
16351  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(var));
16352  else
16353  {
16354  SCIP_VAR* origvar;
16355  SCIP_Real constant;
16356  SCIP_Real scalar;
16357 
16358  assert(SCIPvarIsActive(var));
16359 
16360  origvar = var;
16361  constant = 0.0;
16362  scalar = 1.0;
16363 
16364  SCIP_CALL( SCIPvarGetOrigvarSum(&origvar, &scalar, &constant) );
16365  assert(origvar != NULL);
16366  assert(SCIPvarIsOriginal(origvar));
16367 
16368  *objcoef = SCIPreoptGetOldObjCoef(scip->reopt, run, SCIPvarGetIndex(origvar));
16369  }
16370  return SCIP_OKAY;
16371 }
16372 
16373 /** return the ids of child nodes stored in the reoptimization tree
16374  *
16375  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16376  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16377  *
16378  * @pre This method can be called if @p scip is in one of the following stages:
16379  * - \ref SCIP_STAGE_PRESOLVED
16380  * - \ref SCIP_STAGE_SOLVING
16381  * - \ref SCIP_STAGE_SOLVED
16382  */
16384  SCIP* scip, /**< SCIP data structure */
16385  SCIP_NODE* node, /**< node of the search tree */
16386  unsigned int* ids, /**< array of ids */
16387  int idssize, /**< allocated memory */
16388  int* nids /**< number of child nodes */
16389  )
16390 {
16391  assert(scip != NULL);
16392 
16393  SCIP_CALL( checkStage(scip, "SCIPgetReoptChildIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16394 
16395  (*nids) = 0;
16396 
16397  if( !scip->set->reopt_enable )
16398  return SCIP_OKAY;
16399 
16400  SCIP_CALL( SCIPreoptGetChildIDs(scip->reopt, scip->set, scip->mem->probmem, node, ids, idssize, nids) );
16401 
16402  return SCIP_OKAY;
16403 }
16404 
16405 /** return the ids of all leave nodes store in the reoptimization tree induced by the given node
16406  *
16407  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16408  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16409  *
16410  * @pre This method can be called if @p scip is in one of the following stages:
16411  * - \ref SCIP_STAGE_PRESOLVED
16412  * - \ref SCIP_STAGE_SOLVING
16413  * - \ref SCIP_STAGE_SOLVED
16414  */
16416  SCIP* scip, /**< SCIP data structure */
16417  SCIP_NODE* node, /**< node of the search tree */
16418  unsigned int* ids, /**< array of ids */
16419  int idssize, /**< size of ids array */
16420  int* nids /**< number of child nodes */
16421  )
16422 {
16423  assert(scip != NULL);
16424 
16425  SCIP_CALL( checkStage(scip, "SCIPgetReoptLeaveIDs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16426 
16427  (*nids) = 0;
16428 
16429  if( idssize == 0 || !scip->set->reopt_enable )
16430  return SCIP_OKAY;
16431 
16432  SCIP_CALL( SCIPreoptGetLeaves(scip->reopt, node, ids, idssize, nids) );
16433 
16434  return SCIP_OKAY;
16435 }
16436 
16437 /** returns the number of nodes in the reoptimization tree induced by @p node; if @p node == NULL the method
16438  * returns the number of nodes of the whole reoptimization tree.
16439  */
16441  SCIP* scip, /**< SCIP data structure */
16442  SCIP_NODE* node /**< node of the search tree */
16443  )
16444 {
16445  assert(scip != NULL);
16446  assert(scip->set->reopt_enable);
16447  assert(scip->reopt != NULL);
16448 
16449  return SCIPreoptGetNNodes(scip->reopt, node);
16450 }
16451 
16452 /** returns the number of leaf nodes of the subtree induced by @p node; if @p node == NULL, the method
16453  * returns the number of leaf nodes of the whole reoptimization tree.
16454  */
16456  SCIP* scip, /**< SCIP data structure */
16457  SCIP_NODE* node /**< node of the search tree */
16458  )
16459 {
16460  assert(scip != NULL);
16461  assert(scip->set->reopt_enable);
16462  assert(scip->reopt != NULL);
16463 
16464  return SCIPreoptGetNLeaves(scip->reopt, node);
16465 }
16466 
16467 /** gets the node of the reoptimization tree corresponding to the unique @p id */
16469  SCIP* scip, /**< SCIP data structure */
16470  unsigned int id /**< unique id */
16471  )
16472 {
16473  assert(scip != NULL);
16474  assert(scip->set->reopt_enable);
16475  assert(scip->reopt != NULL);
16476 
16477  return SCIPreoptGetReoptnode(scip->reopt, id);
16478 }
16479 
16480 /** add a variable bound change to a given reoptnode
16481  *
16482  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16483  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16484  *
16485  * @pre This method can be called if @p scip is in one of the following stages:
16486  * - \ref SCIP_STAGE_PRESOLVED
16487  * - \ref SCIP_STAGE_SOLVING
16488  * - \ref SCIP_STAGE_SOLVED
16489  */
16491  SCIP* scip, /**< SCIP data structure */
16492  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16493  SCIP_VAR* var, /**< variable pointer */
16494  SCIP_Real bound, /**< variable bound to add */
16495  SCIP_BOUNDTYPE boundtype /**< bound type of the variable value */
16496  )
16497 {
16498  assert(scip != NULL);
16499  assert(reoptnode != NULL);
16500  assert(scip->set->reopt_enable);
16501  assert(scip->reopt != NULL);
16502 
16503  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeBndchg", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16504 
16505  SCIP_CALL( SCIPreoptnodeAddBndchg(reoptnode, scip->set, scip->mem->probmem, var, bound, boundtype) );
16506 
16507  return SCIP_OKAY;
16508 }
16509 
16510 /** set the @p representation as the new search frontier
16511  *
16512  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16513  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16514  *
16515  * @pre This method can be called if @p scip is in one of the following stages:
16516  * - \ref SCIP_STAGE_PRESOLVED
16517  */
16519  SCIP* scip, /**< SCIP data structure */
16520  SCIP_REOPTNODE** representation, /**< array of representatives */
16521  int nrepresentatives, /**< number of representatives */
16522  SCIP_Bool* success /**< pointer to store the result */
16523  )
16524 {
16525  assert(scip != NULL);
16526  assert(representation != NULL);
16527  assert(nrepresentatives > 0);
16528  assert(scip->set->reopt_enable);
16529  assert(scip->reopt != NULL);
16530 
16531  SCIP_CALL( checkStage(scip, "SCIPsetReoptCompression", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16532 
16533  SCIP_CALL( SCIPreoptApplyCompression(scip->reopt, scip->set, scip->mem->probmem, representation, nrepresentatives, success) );
16534 
16535  return SCIP_OKAY;
16536 }
16537 
16538 /** add stored constraint to a reoptimization node
16539  *
16540  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16541  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16542  *
16543  * @pre This method can be called if @p scip is in one of the following stages:
16544  * - \ref SCIP_STAGE_PRESOLVED
16545  */
16547  SCIP* scip, /**< SCIP data structure */
16548  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16549  SCIP_VAR** vars, /**< array of variables */
16550  SCIP_Real* vals, /**< array of variable bounds */
16551  SCIP_BOUNDTYPE* boundtypes, /**< array of variable boundtypes */
16552  SCIP_Real lhs, /**< lhs of the constraint */
16553  SCIP_Real rhs, /**< rhs of the constraint */
16554  int nvars, /**< number of variables */
16555  REOPT_CONSTYPE constype, /**< type of the constraint */
16556  SCIP_Bool linear /**< the given constraint has a linear representation */
16557  )
16558 {
16559  assert(scip != NULL);
16560  assert(reoptnode != NULL);
16561  assert(vars != NULL);
16562  assert(vals != NULL);
16563  assert(nvars >= 0);
16564 
16565  SCIP_CALL( checkStage(scip, "SCIPaddReoptnodeCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16566 
16567  SCIP_CALL( SCIPreoptnodeAddCons(reoptnode, scip->set, scip->mem->probmem, vars, vals, boundtypes, lhs, rhs, nvars,
16568  constype, linear) );
16569 
16570  return SCIP_OKAY;
16571 }
16572 
16573 /** return the branching path stored in the reoptree at ID id */
16575  SCIP* scip, /**< SCIP data structure */
16576  SCIP_REOPTNODE* reoptnode, /**< node of the reoptimization tree */
16577  SCIP_VAR** vars, /**< array of variables */
16578  SCIP_Real* vals, /**< array of variable bounds */
16579  SCIP_BOUNDTYPE* boundtypes, /**< array of bound types */
16580  int mem, /**< allocated memory */
16581  int* nvars, /**< number of variables */
16582  int* nafterdualvars /**< number of variables directly after the first based on dual information */
16583  )
16584 {
16585  assert(scip != NULL);
16586  assert(vars != NULL);
16587  assert(vals != NULL);
16588  assert(boundtypes != NULL);
16589  assert(scip->set->reopt_enable);
16590  assert(scip->reopt != NULL);
16591 
16592  SCIPreoptnodeGetPath(scip->reopt, reoptnode, vars, vals, boundtypes, mem, nvars, nafterdualvars);
16593 }
16594 
16595 /** initialize a set of empty reoptimization nodes
16596  *
16597  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16598  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16599  *
16600  * @pre This method can be called if @p scip is in one of the following stages:
16601  * - \ref SCIP_STAGE_PRESOLVED
16602  */
16604  SCIP* scip, /**< SCIP data structure */
16605  SCIP_REOPTNODE** representatives, /**< array of representatives */
16606  int nrepresentatives /**< number of representatives */
16607  )
16608 {
16609  int r;
16610 
16611  assert(scip != NULL);
16612  assert(representatives != NULL);
16613 
16614  SCIP_CALL( checkStage(scip, "SCIPinitRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16615 
16616  for( r = 0; r < nrepresentatives; r++ )
16617  {
16618  SCIP_CALL( SCIPallocBlockMemory(scip, &representatives[r]) ); /*lint !e866*/
16619  SCIPreoptnodeInit(representatives[r], scip->set);
16620  }
16621 
16622  return SCIP_OKAY;
16623 }
16624 
16625 /** reset a set of initialized reoptimization nodes
16626  *
16627  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16628  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16629  *
16630  * @pre This method can be called if @p scip is in one of the following stages:
16631  * - \ref SCIP_STAGE_PRESOLVED
16632  */
16634  SCIP* scip, /**< SCIP data structure */
16635  SCIP_REOPTNODE** representatives, /**< array of representatives */
16636  int nrepresentatives /**< number of representatives */
16637  )
16638 {
16639  int r;
16640 
16641  assert(scip != NULL);
16642  assert(representatives != NULL);
16643 
16644  SCIP_CALL( checkStage(scip, "SCIPresetRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16645 
16646  for( r = 0; r < nrepresentatives; r++ )
16647  {
16648  SCIP_CALL( SCIPreoptnodeReset(scip->reopt, scip->set, scip->mem->probmem, representatives[r]) );
16649  }
16650 
16651  return SCIP_OKAY;
16652 }
16653 
16654 /** free a set of initialized reoptimization nodes
16655  *
16656  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16657  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16658  *
16659  * @pre This method can be called if @p scip is in one of the following stages:
16660  * - \ref SCIP_STAGE_PRESOLVED
16661  */
16663  SCIP* scip, /**< SCIP data structure */
16664  SCIP_REOPTNODE** representatives, /**< array of representatives */
16665  int nrepresentatives /**< number of representatives */
16666  )
16667 {
16668  int r;
16669 
16670  assert(scip != NULL);
16671  assert(representatives != NULL);
16672 
16673  SCIP_CALL( checkStage(scip, "SCIPfreeRepresentation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
16674 
16675  for( r = 0; r < nrepresentatives; r++ )
16676  {
16677  if( representatives[r] != NULL )
16678  {
16679  SCIP_CALL( SCIPreoptnodeDelete(&representatives[r], scip->mem->probmem) );
16680  assert(representatives[r] == NULL);
16681  }
16682  }
16683 
16684  return SCIP_OKAY;
16685 }
16686 
16687 /** reactivate the given @p reoptnode and split them into several nodes if necessary
16688  *
16689  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16690  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16691  *
16692  * @pre This method can be called if @p scip is in one of the following stages:
16693  * - \ref SCIP_STAGE_SOLVING
16694  * - \ref SCIP_STAGE_SOLVED
16695  */
16697  SCIP* scip, /**< SCIP data structure */
16698  SCIP_REOPTNODE* reoptnode, /**< node to reactivate */
16699  unsigned int id, /**< unique id of the reoptimization node */
16700  SCIP_Real estimate, /**< estimate of the child nodes that should be created */
16701  SCIP_NODE** childnodes, /**< array to store the created child nodes */
16702  int* ncreatedchilds, /**< pointer to store number of created child nodes */
16703  int* naddedconss, /**< pointer to store number of generated constraints */
16704  int childnodessize, /**< available size of childnodes array */
16705  SCIP_Bool* success /**< pointer store the result*/
16706  )
16707 {
16708  assert(scip != NULL);
16709  assert(reoptnode != NULL);
16710 
16711  SCIP_CALL( checkStage(scip, "SCIPapplyReopt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16712 
16713  SCIP_CALL( SCIPreoptApply(scip->reopt, scip, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
16714  scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, scip->mem->probmem, reoptnode, id, estimate,
16715  childnodes, ncreatedchilds, naddedconss, childnodessize, success) );
16716 
16717  return SCIP_OKAY;
16718 }
16719 
16720 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
16721  * preserved
16722  *
16723  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16724  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16725  *
16726  * @pre This method can be called if @p scip is in one of the following stages:
16727  * - \ref SCIP_STAGE_INIT
16728  * - \ref SCIP_STAGE_PROBLEM
16729  * - \ref SCIP_STAGE_TRANSFORMED
16730  * - \ref SCIP_STAGE_PRESOLVING
16731  * - \ref SCIP_STAGE_PRESOLVED
16732  * - \ref SCIP_STAGE_SOLVING
16733  * - \ref SCIP_STAGE_SOLVED
16734  *
16735  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT or \ref SCIP_STAGE_PROBLEM, the stage of
16736  * \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_TRANSFORMED
16737  *
16738  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16739  */
16741  SCIP* scip, /**< SCIP data structure */
16742  SCIP_Bool restart /**< should certain data be preserved for improved restarting? */
16743  )
16744 {
16745  SCIP_CALL( checkStage(scip, "SCIPfreeSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16746 
16747  switch( scip->set->stage )
16748  {
16749  case SCIP_STAGE_INIT:
16751  case SCIP_STAGE_PROBLEM:
16752  return SCIP_OKAY;
16753 
16754  case SCIP_STAGE_PRESOLVING:
16755  {
16756  SCIP_Bool infeasible;
16757 
16758  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
16759  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
16760  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
16761  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
16762 
16763  /* exit presolving */
16764  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
16765  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
16766  }
16767 
16768  /*lint -fallthrough*/
16769  case SCIP_STAGE_PRESOLVED:
16770  /* switch stage to TRANSFORMED */
16771  scip->set->stage = SCIP_STAGE_TRANSFORMED;
16772  return SCIP_OKAY;
16773 
16774  case SCIP_STAGE_SOLVING:
16775  case SCIP_STAGE_SOLVED:
16776  /* free solution process data structures */
16777  SCIP_CALL( freeSolve(scip, restart) );
16778  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
16779  return SCIP_OKAY;
16780 
16781  default:
16782  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16783  return SCIP_INVALIDCALL;
16784  } /*lint !e788*/
16785 }
16786 
16787 /** frees branch and bound tree and all solution process data; statistics, presolving data and transformed problem is
16788  * preserved
16789  *
16790  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16791  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16792  *
16793  * @pre This method can be called if @p scip is in one of the following stages:
16794  * - \ref SCIP_STAGE_INIT
16795  * - \ref SCIP_STAGE_PROBLEM
16796  * - \ref SCIP_STAGE_TRANSFORMED
16797  * - \ref SCIP_STAGE_PRESOLVING
16798  * - \ref SCIP_STAGE_PRESOLVED
16799  * - \ref SCIP_STAGE_SOLVING
16800  * - \ref SCIP_STAGE_SOLVED
16801  *
16802  * @post If this method is called in \SCIP stage \ref SCIP_STAGE_INIT or \ref SCIP_STAGE_PROBLEM, the stage of
16803  * \SCIP is not changed; otherwise, the \SCIP stage is changed to \ref SCIP_STAGE_PRESOLVED.
16804  *
16805  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16806  */
16808  SCIP* scip /**< SCIP data structure */
16809  )
16810 {
16811  SCIP_CALL( checkStage(scip, "SCIPfreeReoptSolve", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16812 
16813  switch( scip->set->stage )
16814  {
16815  case SCIP_STAGE_INIT:
16817  case SCIP_STAGE_PROBLEM:
16818  return SCIP_OKAY;
16819 
16820  case SCIP_STAGE_PRESOLVING:
16821  {
16822  SCIP_Bool infeasible;
16823 
16824  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
16825  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
16826  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
16827  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
16828 
16829  /* exit presolving */
16830  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
16831  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
16832  }
16833 
16834  /*lint -fallthrough*/
16835  case SCIP_STAGE_PRESOLVED:
16836  /* switch stage to TRANSFORMED */
16837  scip->set->stage = SCIP_STAGE_TRANSFORMED;
16838  return SCIP_OKAY;
16839 
16840  case SCIP_STAGE_SOLVING:
16841  case SCIP_STAGE_SOLVED:
16842  /* free solution process data structures */
16843  SCIP_CALL( freeReoptSolve(scip) );
16844  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
16845  return SCIP_OKAY;
16846 
16847  default:
16848  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16849  return SCIP_INVALIDCALL;
16850  } /*lint !e788*/
16851 }
16852 
16853 /** frees all solution process data including presolving and transformed problem, only original problem is kept
16854  *
16855  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16856  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16857  *
16858  * @pre This method can be called if @p scip is in one of the following stages:
16859  * - \ref SCIP_STAGE_INIT
16860  * - \ref SCIP_STAGE_PROBLEM
16861  * - \ref SCIP_STAGE_TRANSFORMED
16862  * - \ref SCIP_STAGE_PRESOLVING
16863  * - \ref SCIP_STAGE_PRESOLVED
16864  * - \ref SCIP_STAGE_SOLVING
16865  * - \ref SCIP_STAGE_SOLVED
16866  *
16867  * @post After calling this method \SCIP reaches one of the following stages:
16868  * - \ref SCIP_STAGE_INIT if the method was called from \SCIP stage \ref SCIP_STAGE_INIT
16869  * - \ref SCIP_STAGE_PROBLEM if the method was called from any other of the allowed stages
16870  *
16871  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
16872  */
16874  SCIP* scip /**< SCIP data structure */
16875  )
16876 {
16877  SCIP_CALL( checkStage(scip, "SCIPfreeTransform", TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
16878 
16879  switch( scip->set->stage )
16880  {
16881  case SCIP_STAGE_INIT:
16882  case SCIP_STAGE_PROBLEM:
16883  return SCIP_OKAY;
16884 
16885  case SCIP_STAGE_PRESOLVING:
16886  {
16887  SCIP_Bool infeasible;
16888 
16889  assert(scip->stat->status != SCIP_STATUS_INFEASIBLE);
16890  assert(scip->stat->status != SCIP_STATUS_INFORUNBD);
16891  assert(scip->stat->status != SCIP_STATUS_UNBOUNDED);
16892  assert(scip->stat->status != SCIP_STATUS_OPTIMAL);
16893 
16894  /* exit presolving */
16895  SCIP_CALL( exitPresolve(scip, FALSE, &infeasible) );
16896  assert(scip->set->stage == SCIP_STAGE_PRESOLVED);
16897  }
16898 
16899  /*lint -fallthrough*/
16900  case SCIP_STAGE_PRESOLVED:
16901  case SCIP_STAGE_SOLVING:
16902  case SCIP_STAGE_SOLVED:
16903  /* free solution process data */
16904  SCIP_CALL( SCIPfreeSolve(scip, FALSE) );
16905  assert(scip->set->stage == SCIP_STAGE_TRANSFORMED);
16906 
16907  /*lint -fallthrough*/
16908 
16910  /* free transformed problem data structures */
16911  SCIP_CALL( freeTransform(scip) );
16912  assert(scip->set->stage == SCIP_STAGE_PROBLEM);
16913  return SCIP_OKAY;
16914 
16915  default:
16916  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
16917  return SCIP_INVALIDCALL;
16918  } /*lint !e788*/
16919 }
16920 
16921 /** informs \SCIP that the solving process should be interrupted as soon as possible (e.g., after the current node has
16922  * been solved)
16923  *
16924  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16925  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16926  *
16927  * @pre This method can be called if @p scip is in one of the following stages:
16928  * - \ref SCIP_STAGE_PROBLEM
16929  * - \ref SCIP_STAGE_TRANSFORMING
16930  * - \ref SCIP_STAGE_TRANSFORMED
16931  * - \ref SCIP_STAGE_INITPRESOLVE
16932  * - \ref SCIP_STAGE_PRESOLVING
16933  * - \ref SCIP_STAGE_EXITPRESOLVE
16934  * - \ref SCIP_STAGE_PRESOLVED
16935  * - \ref SCIP_STAGE_SOLVING
16936  * - \ref SCIP_STAGE_SOLVED
16937  * - \ref SCIP_STAGE_EXITSOLVE
16938  * - \ref SCIP_STAGE_FREETRANS
16939  *
16940  * @note the \SCIP stage does not get changed
16941  */
16943  SCIP* scip /**< SCIP data structure */
16944  )
16945 {
16946  SCIP_CALL( checkStage(scip, "SCIPinterruptSolve", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE) );
16947 
16948  /* set the userinterrupt flag */
16949  scip->stat->userinterrupt = TRUE;
16950 
16951  return SCIP_OKAY;
16952 }
16953 
16954 /** informs SCIP that the solving process should be restarted as soon as possible (e.g., after the current node has
16955  * been solved)
16956  *
16957  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
16958  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
16959  *
16960  * @pre This method can be called if @p scip is in one of the following stages:
16961  * - \ref SCIP_STAGE_INITPRESOLVE
16962  * - \ref SCIP_STAGE_PRESOLVING
16963  * - \ref SCIP_STAGE_EXITPRESOLVE
16964  * - \ref SCIP_STAGE_SOLVING
16965  *
16966  * @note the \SCIP stage does not get changed
16967  */
16969  SCIP* scip /**< SCIP data structure */
16970  )
16971 {
16972  SCIP_CALL( checkStage(scip, "SCIPrestartSolve", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
16973 
16974  /* set the userrestart flag */
16975  scip->stat->userrestart = TRUE;
16976 
16977  return SCIP_OKAY;
16978 }
16979 
16980 /** returns whether reoptimization is enabled or not */
16982  SCIP* scip /**< SCIP data structure */
16983  )
16984 {
16985  assert(scip != NULL);
16986 
16987  return scip->set->reopt_enable;
16988 }
16989 
16990 /** returns the stored solutions corresponding to a given run */
16992  SCIP* scip, /**< SCIP data structure */
16993  int run, /**< number of the run */
16994  SCIP_SOL** sols, /**< array to store solutions */
16995  int solssize, /**< size of the array */
16996  int* nsols /**< pointer to store number of solutions */
16997  )
16998 {
16999  assert(scip != NULL);
17000  assert(sols != NULL);
17001  assert(solssize > 0);
17002 
17003  if( scip->set->reopt_enable )
17004  {
17005  assert(run > 0 && run <= scip->stat->nreoptruns);
17006  SCIP_CALL( SCIPreoptGetSolsRun(scip->reopt, run, sols, solssize, nsols) );
17007  }
17008  else
17009  {
17010  *nsols = 0;
17011  }
17012 
17013  return SCIP_OKAY;
17014 }
17015 
17016 /** mark all stored solutions as not updated */
17018  SCIP* scip /**< SCIP data structure */
17019  )
17020 {
17021  assert(scip != NULL);
17022  assert(scip->set->reopt_enable);
17023  assert(scip->reopt != NULL);
17024 
17025  if( scip->set->reopt_enable )
17026  {
17027  assert(scip->reopt != NULL);
17029  }
17030 }
17031 
17032 /** check if the reoptimization process should be restarted
17033  *
17034  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17035  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17036  *
17037  * @pre This method can be called if @p scip is in one of the following stages:
17038  * - \ref SCIP_STAGE_TRANSFORMED
17039  * - \ref SCIP_STAGE_SOLVING
17040  */
17042  SCIP* scip, /**< SCIP data structure */
17043  SCIP_NODE* node, /**< current node of the branch and bound tree (or NULL) */
17044  SCIP_Bool* restart /**< pointer to store of the reoptimitation process should be restarted */
17045  )
17046 {
17047  assert(scip != NULL);
17048  assert(scip->set->reopt_enable);
17049  assert(scip->reopt != NULL);
17050 
17051  SCIP_CALL( checkStage(scip, "SCIPcheckReoptRestart", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17052 
17053  SCIP_CALL( SCIPreoptCheckRestart(scip->reopt, scip->set, scip->mem->probmem, node, scip->transprob->vars,
17054  scip->transprob->nvars, restart) );
17055 
17056  return SCIP_OKAY;
17057 }
17058 
17059 /** return the similarity between two objective functions */
17061  SCIP* scip, /**< SCIP data structure */
17062  int run1, /**< number of run */
17063  int run2 /**< number of run */
17064  )
17065 {
17066  assert(scip != NULL);
17067  assert(run1 > 0 && run1 <= scip->stat->nreoptruns);
17068  assert(run2 > 0 && run2 <= scip->stat->nreoptruns);
17069 
17070  if( (run1 == scip->stat->nreoptruns && run2 == run1-1) || (run2 == scip->stat->nreoptruns && run1 == run2-1) )
17071  return SCIPreoptGetSimToPrevious(scip->reopt);
17072  else
17073  return SCIPreoptGetSimilarity(scip->reopt, scip->set, run1, run2, scip->origprob->vars, scip->origprob->nvars);
17074 }
17075 
17076 /** returns if a node should be reoptimized */
17078  SCIP* scip, /**< SCIP data structure */
17079  SCIP_NODE* node /**< node of the search tree */
17080  )
17081 {
17082  assert(scip != NULL);
17083  assert(node != NULL);
17084 
17085  if( scip->set->reopt_enable )
17086  {
17087  SCIP_REOPTNODE* reoptnode;
17088  unsigned int id;
17089 
17090  assert(scip->reopt != NULL);
17091 
17092  id = SCIPnodeGetReoptID(node);
17093 
17094  if( id == 0 && node != SCIPgetRootNode(scip) )
17095  return FALSE;
17096  else
17097  {
17098  reoptnode = SCIPgetReoptnode(scip, id);
17099  assert(reoptnode != NULL);
17100 
17101  return SCIPreoptnodeGetNChildren(reoptnode) > 0;
17102  }
17103  }
17104  else
17105  return FALSE;
17106 }
17107 
17108 /** deletes the given reoptimization node
17109  *
17110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17112  *
17113  * @pre This method can be called if @p scip is in one of the following stages:
17114  * - \ref SCIP_STAGE_TRANSFORMED
17115  * - \ref SCIP_STAGE_SOLVING
17116  */
17118  SCIP* scip, /**< SCIP data structure */
17119  SCIP_REOPTNODE** reoptnode /**< node of the reoptimization tree */
17120  )
17121 {
17122  assert(scip != NULL);
17123  assert(scip->set->reopt_enable);
17124  assert(scip->reopt != NULL);
17125  assert((*reoptnode) != NULL);
17126 
17127  SCIP_CALL( checkStage(scip, "SCIPdeleteReoptnode", FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17128 
17129  SCIP_CALL( SCIPreoptnodeDelete(reoptnode, scip->mem->probmem) );
17130 
17131  return SCIP_OKAY;
17132 }
17133 
17134 /** splits the root into several nodes and moves the child nodes of the root to one of the created nodes
17135  *
17136  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17137  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17138  *
17139  * @pre This method can be called if @p scip is in one of the following stages:
17140  * - \ref SCIP_STAGE_SOLVING
17141  */
17143  SCIP* scip, /**< SCIP data structure */
17144  int* ncreatedchilds, /**< pointer to store the number of created nodes */
17145  int* naddedconss /**< pointer to store the number added constraints */
17146  )
17147 {
17148  assert(scip != NULL);
17149  assert(scip->set->reopt_enable);
17150  assert(scip->reopt != NULL);
17151 
17152  SCIP_CALL( checkStage(scip, "SCIPsplitReoptRoot", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17153 
17154  SCIP_CALL( SCIPreoptSplitRoot(scip->reopt, scip->tree, scip->set, scip->stat, scip->mem->probmem, ncreatedchilds,
17155  naddedconss) );
17156 
17157  return SCIP_OKAY;
17158 }
17159 
17160 /** remove the stored information about bound changes based in dual information
17161  *
17162  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17163  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17164  *
17165  * @pre This method can be called if @p scip is in one of the following stages:
17166  * - \ref SCIP_STAGE_SOLVING
17167  * - \ref SCIP_STAGE_SOLVED
17168  */
17170  SCIP* scip, /**< SCIP data structure */
17171  SCIP_NODE* node /**< node of the search tree */
17172  )
17173 {
17174  assert(scip != NULL);
17175  assert(scip->set->reopt_enable);
17176  assert(node != NULL);
17177 
17178  SCIP_CALL( checkStage(scip, "SCIPresetReoptnodeDualcons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
17179 
17180  SCIP_CALL( SCIPreoptResetDualBndchgs(scip->reopt, node, scip->mem->probmem) );
17181 
17182  return SCIP_OKAY;
17183 }
17184 
17185 /** returns whether we are in the restarting phase
17186  *
17187  * @return TRUE, if we are in the restarting phase; FALSE, otherwise
17188  *
17189  * @pre This method can be called if @p scip is in one of the following stages:
17190  * - \ref SCIP_STAGE_INITPRESOLVE
17191  * - \ref SCIP_STAGE_PRESOLVING
17192  * - \ref SCIP_STAGE_EXITPRESOLVE
17193  * - \ref SCIP_STAGE_PRESOLVED
17194  * - \ref SCIP_STAGE_INITSOLVE
17195  * - \ref SCIP_STAGE_SOLVING
17196  * - \ref SCIP_STAGE_SOLVED
17197  * - \ref SCIP_STAGE_EXITSOLVE
17198  * - \ref SCIP_STAGE_FREETRANS
17199  */
17201  SCIP* scip /**< SCIP data structure */
17202  )
17203 {
17204  SCIP_CALL_ABORT( checkStage(scip, "SCIPisInRestart", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17205 
17206  /* return the restart status */
17207  return scip->stat->inrestart;
17208 }
17209 
17210 
17211 /*
17212  * variable methods
17213  */
17214 
17215 /** creates and captures problem variable; if variable is of integral type, fractional bounds are automatically rounded;
17216  * an integer variable with bounds zero and one is automatically converted into a binary variable;
17217  *
17218  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
17219  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
17220  * original objective function value of variables created during the solving process has to be multiplied by
17221  * -1, too.
17222  *
17223  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17224  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17225  *
17226  * @pre This method can be called if @p scip is in one of the following stages:
17227  * - \ref SCIP_STAGE_PROBLEM
17228  * - \ref SCIP_STAGE_TRANSFORMING
17229  * - \ref SCIP_STAGE_INITPRESOLVE
17230  * - \ref SCIP_STAGE_PRESOLVING
17231  * - \ref SCIP_STAGE_EXITPRESOLVE
17232  * - \ref SCIP_STAGE_PRESOLVED
17233  * - \ref SCIP_STAGE_SOLVING
17234  *
17235  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
17236  */
17238  SCIP* scip, /**< SCIP data structure */
17239  SCIP_VAR** var, /**< pointer to variable object */
17240  const char* name, /**< name of variable, or NULL for automatic name creation */
17241  SCIP_Real lb, /**< lower bound of variable */
17242  SCIP_Real ub, /**< upper bound of variable */
17243  SCIP_Real obj, /**< objective function value */
17244  SCIP_VARTYPE vartype, /**< type of variable */
17245  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
17246  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
17247  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable, or NULL */
17248  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data, or NULL */
17249  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable, or NULL */
17250  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
17251  SCIP_VARDATA* vardata /**< user data for this specific variable */
17252  )
17253 {
17254  assert(var != NULL);
17255  assert(lb <= ub);
17256 
17257  SCIP_CALL( checkStage(scip, "SCIPcreateVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17258 
17259  /* forbid infinite objective function values */
17260  if( SCIPisInfinity(scip, REALABS(obj)) )
17261  {
17262  SCIPerrorMessage("invalid objective function value: value is infinite\n");
17263  return SCIP_INVALIDDATA;
17264  }
17265 
17266  switch( scip->set->stage )
17267  {
17268  case SCIP_STAGE_PROBLEM:
17269  SCIP_CALL( SCIPvarCreateOriginal(var, scip->mem->probmem, scip->set, scip->stat,
17270  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
17271  break;
17272 
17275  case SCIP_STAGE_PRESOLVING:
17277  case SCIP_STAGE_PRESOLVED:
17278  case SCIP_STAGE_SOLVING:
17279  SCIP_CALL( SCIPvarCreateTransformed(var, scip->mem->probmem, scip->set, scip->stat,
17280  name, lb, ub, obj, vartype, initial, removable, vardelorig, vartrans, vardeltrans, varcopy, vardata) );
17281  break;
17282 
17283  default:
17284  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17285  return SCIP_INVALIDCALL;
17286  } /*lint !e788*/
17287 
17288  return SCIP_OKAY;
17289 }
17290 
17291 /** creates and captures problem variable with optional callbacks and variable data set to NULL, which can be set
17292  * afterwards using SCIPvarSetDelorigData(), SCIPvarSetTransData(),
17293  * SCIPvarSetDeltransData(), SCIPvarSetCopy(), and SCIPvarSetData(); sets variable flags initial=TRUE
17294  * and removable = FALSE, which can be adjusted by using SCIPvarSetInitial() and SCIPvarSetRemovable(), resp.;
17295  * if variable is of integral type, fractional bounds are automatically rounded;
17296  * an integer variable with bounds zero and one is automatically converted into a binary variable;
17297  *
17298  * @warning When doing column generation and the original problem is a maximization problem, notice that SCIP will
17299  * transform the problem into a minimization problem by multiplying the objective function by -1. Thus, the
17300  * original objective function value of variables created during the solving process has to be multiplied by
17301  * -1, too.
17302  *
17303  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17304  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17305  *
17306  * @pre This method can be called if @p scip is in one of the following stages:
17307  * - \ref SCIP_STAGE_PROBLEM
17308  * - \ref SCIP_STAGE_TRANSFORMING
17309  * - \ref SCIP_STAGE_INITPRESOLVE
17310  * - \ref SCIP_STAGE_PRESOLVING
17311  * - \ref SCIP_STAGE_EXITPRESOLVE
17312  * - \ref SCIP_STAGE_PRESOLVED
17313  * - \ref SCIP_STAGE_SOLVING
17314  *
17315  * @note the variable gets captured, hence at one point you have to release it using the method SCIPreleaseVar()
17316  */
17318  SCIP* scip, /**< SCIP data structure */
17319  SCIP_VAR** var, /**< pointer to variable object */
17320  const char* name, /**< name of variable, or NULL for automatic name creation */
17321  SCIP_Real lb, /**< lower bound of variable */
17322  SCIP_Real ub, /**< upper bound of variable */
17323  SCIP_Real obj, /**< objective function value */
17324  SCIP_VARTYPE vartype /**< type of variable */
17325  )
17326 {
17327  SCIP_CALL( checkStage(scip, "SCIPcreateVarBasic", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17328 
17329  SCIP_CALL( SCIPcreateVar(scip, var, name, lb, ub, obj, vartype, TRUE, FALSE, NULL, NULL, NULL, NULL, NULL) );
17330 
17331  return SCIP_OKAY;
17332 }
17333 
17334 /** outputs the variable name to the file stream
17335  *
17336  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17337  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17338  *
17339  * @pre This method can be called if @p scip is in one of the following stages:
17340  * - \ref SCIP_STAGE_PROBLEM
17341  * - \ref SCIP_STAGE_TRANSFORMING
17342  * - \ref SCIP_STAGE_TRANSFORMED
17343  * - \ref SCIP_STAGE_INITPRESOLVE
17344  * - \ref SCIP_STAGE_PRESOLVING
17345  * - \ref SCIP_STAGE_EXITPRESOLVE
17346  * - \ref SCIP_STAGE_PRESOLVED
17347  * - \ref SCIP_STAGE_INITSOLVE
17348  * - \ref SCIP_STAGE_SOLVING
17349  * - \ref SCIP_STAGE_SOLVED
17350  * - \ref SCIP_STAGE_EXITSOLVE
17351  * - \ref SCIP_STAGE_FREETRANS
17352  */
17354  SCIP* scip, /**< SCIP data structure */
17355  FILE* file, /**< output file, or NULL for stdout */
17356  SCIP_VAR* var, /**< variable to output */
17357  SCIP_Bool type /**< should the variable type be also posted */
17358  )
17359 {
17360  assert(scip != NULL);
17361  assert(var != NULL);
17362 
17363  SCIP_CALL( checkStage(scip, "SCIPwriteVarName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17364 
17365  /* print variable name */
17366  if( SCIPvarIsNegated(var) )
17367  {
17368  SCIP_VAR* negatedvar;
17369 
17370  SCIP_CALL( SCIPgetNegatedVar(scip, var, &negatedvar) );
17371  SCIPinfoMessage(scip, file, "<~%s>", SCIPvarGetName(negatedvar));
17372  }
17373  else
17374  {
17375  SCIPinfoMessage(scip, file, "<%s>", SCIPvarGetName(var));
17376  }
17377 
17378  if( type )
17379  {
17380  /* print variable type */
17381  SCIPinfoMessage(scip, file, "[%c]",
17385  }
17386 
17387  return SCIP_OKAY;
17388 }
17389 
17390 /** print the given list of variables to output stream separated by the given delimiter character;
17391  *
17392  * i. e. the variables x1, x2, ..., xn with given delimiter ',' are written as: <x1>, <x2>, ..., <xn>;
17393  *
17394  * the method SCIPparseVarsList() can parse such a string
17395  *
17396  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17397  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17398  *
17399  * @pre This method can be called if @p scip is in one of the following stages:
17400  * - \ref SCIP_STAGE_PROBLEM
17401  * - \ref SCIP_STAGE_TRANSFORMING
17402  * - \ref SCIP_STAGE_TRANSFORMED
17403  * - \ref SCIP_STAGE_INITPRESOLVE
17404  * - \ref SCIP_STAGE_PRESOLVING
17405  * - \ref SCIP_STAGE_EXITPRESOLVE
17406  * - \ref SCIP_STAGE_PRESOLVED
17407  * - \ref SCIP_STAGE_INITSOLVE
17408  * - \ref SCIP_STAGE_SOLVING
17409  * - \ref SCIP_STAGE_SOLVED
17410  * - \ref SCIP_STAGE_EXITSOLVE
17411  * - \ref SCIP_STAGE_FREETRANS
17412  *
17413  * @note The printing process is done via the message handler system.
17414  */
17416  SCIP* scip, /**< SCIP data structure */
17417  FILE* file, /**< output file, or NULL for stdout */
17418  SCIP_VAR** vars, /**< variable array to output */
17419  int nvars, /**< number of variables */
17420  SCIP_Bool type, /**< should the variable type be also posted */
17421  char delimiter /**< character which is used for delimitation */
17422  )
17423 {
17424  int v;
17425 
17426  SCIP_CALL( checkStage(scip, "SCIPwriteVarsList", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17427 
17428  for( v = 0; v < nvars; ++v )
17429  {
17430  if( v > 0 )
17431  {
17432  SCIPinfoMessage(scip, file, "%c", delimiter);
17433  }
17434 
17435  /* print variable name */
17436  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
17437  }
17438 
17439  return SCIP_OKAY;
17440 }
17441 
17442 /** print the given variables and coefficients as linear sum in the following form
17443  * c1 <x1> + c2 <x2> ... + cn <xn>
17444  *
17445  * This string can be parsed by the method SCIPparseVarsLinearsum().
17446  *
17447  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17448  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17449  *
17450  * @pre This method can be called if @p scip is in one of the following stages:
17451  * - \ref SCIP_STAGE_PROBLEM
17452  * - \ref SCIP_STAGE_TRANSFORMING
17453  * - \ref SCIP_STAGE_TRANSFORMED
17454  * - \ref SCIP_STAGE_INITPRESOLVE
17455  * - \ref SCIP_STAGE_PRESOLVING
17456  * - \ref SCIP_STAGE_EXITPRESOLVE
17457  * - \ref SCIP_STAGE_PRESOLVED
17458  * - \ref SCIP_STAGE_INITSOLVE
17459  * - \ref SCIP_STAGE_SOLVING
17460  * - \ref SCIP_STAGE_SOLVED
17461  * - \ref SCIP_STAGE_EXITSOLVE
17462  * - \ref SCIP_STAGE_FREETRANS
17463  *
17464  * @note The printing process is done via the message handler system.
17465  */
17467  SCIP* scip, /**< SCIP data structure */
17468  FILE* file, /**< output file, or NULL for stdout */
17469  SCIP_VAR** vars, /**< variable array to output */
17470  SCIP_Real* vals, /**< array of coefficients or NULL if all coefficients are 1.0 */
17471  int nvars, /**< number of variables */
17472  SCIP_Bool type /**< should the variable type be also posted */
17473  )
17474 {
17475  int v;
17476 
17477  SCIP_CALL( checkStage(scip, "SCIPwriteVarsLinearsum", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17478 
17479  for( v = 0; v < nvars; ++v )
17480  {
17481  if( vals != NULL )
17482  {
17483  if( vals[v] == 1.0 )
17484  {
17485  if( v > 0 )
17486  SCIPinfoMessage(scip, file, " +");
17487  }
17488  else if( vals[v] == -1.0 )
17489  SCIPinfoMessage(scip, file, " -");
17490  else
17491  SCIPinfoMessage(scip, file, " %+.15g", vals[v]);
17492  }
17493  else if( nvars > 0 )
17494  SCIPinfoMessage(scip, file, " +");
17495 
17496  /* print variable name */
17497  SCIP_CALL( SCIPwriteVarName(scip, file, vars[v], type) );
17498  }
17499 
17500  return SCIP_OKAY;
17501 }
17502 
17503 /** print the given monomials as polynomial in the following form
17504  * c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...
17505  *
17506  * This string can be parsed by the method SCIPparseVarsPolynomial().
17507  *
17508  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17509  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17510  *
17511  * @pre This method can be called if @p scip is in one of the following stages:
17512  * - \ref SCIP_STAGE_PROBLEM
17513  * - \ref SCIP_STAGE_TRANSFORMING
17514  * - \ref SCIP_STAGE_TRANSFORMED
17515  * - \ref SCIP_STAGE_INITPRESOLVE
17516  * - \ref SCIP_STAGE_PRESOLVING
17517  * - \ref SCIP_STAGE_EXITPRESOLVE
17518  * - \ref SCIP_STAGE_PRESOLVED
17519  * - \ref SCIP_STAGE_INITSOLVE
17520  * - \ref SCIP_STAGE_SOLVING
17521  * - \ref SCIP_STAGE_SOLVED
17522  * - \ref SCIP_STAGE_EXITSOLVE
17523  * - \ref SCIP_STAGE_FREETRANS
17524  *
17525  * @note The printing process is done via the message handler system.
17526  */
17528  SCIP* scip, /**< SCIP data structure */
17529  FILE* file, /**< output file, or NULL for stdout */
17530  SCIP_VAR*** monomialvars, /**< arrays with variables for each monomial */
17531  SCIP_Real** monomialexps, /**< arrays with variable exponents, or NULL if always 1.0 */
17532  SCIP_Real* monomialcoefs, /**< array with monomial coefficients */
17533  int* monomialnvars, /**< array with number of variables for each monomial */
17534  int nmonomials, /**< number of monomials */
17535  SCIP_Bool type /**< should the variable type be also posted */
17536  )
17537 {
17538  int i;
17539  int v;
17540 
17541  assert(scip != NULL);
17542  assert(monomialvars != NULL || nmonomials == 0);
17543  assert(monomialcoefs != NULL || nmonomials == 0);
17544  assert(monomialnvars != NULL || nmonomials == 0);
17545 
17546  SCIP_CALL( checkStage(scip, "SCIPwriteVarsPolynomial", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
17547 
17548  if( nmonomials == 0 )
17549  {
17550  SCIPinfoMessage(scip, file, " 0 ");
17551  return SCIP_OKAY;
17552  }
17553 
17554  for( i = 0; i < nmonomials; ++i )
17555  {
17556  if( monomialcoefs[i] == 1.0 ) /*lint !e613*/
17557  {
17558  if( i > 0 )
17559  SCIPinfoMessage(scip, file, " +");
17560  }
17561  else if( monomialcoefs[i] == -1.0 ) /*lint !e613*/
17562  SCIPinfoMessage(scip, file, " -");
17563  else
17564  SCIPinfoMessage(scip, file, " %+.15g", monomialcoefs[i]); /*lint !e613*/
17565 
17566  assert(monomialvars[i] != NULL || monomialnvars[i] == 0); /*lint !e613*/
17567 
17568  for( v = 0; v < monomialnvars[i]; ++v ) /*lint !e613*/
17569  {
17570  SCIP_CALL( SCIPwriteVarName(scip, file, monomialvars[i][v], type) ); /*lint !e613*/
17571  if( monomialexps != NULL && monomialexps[i] != NULL && monomialexps[i][v] != 1.0 )
17572  {
17573  SCIPinfoMessage(scip, file, "^%.15g", monomialexps[i][v]);
17574  }
17575  }
17576  }
17577 
17578  return SCIP_OKAY;
17579 }
17580 
17581 /** parses variable information (in cip format) out of a string; if the parsing process was successful a variable is
17582  * created and captured; if variable is of integral type, fractional bounds are automatically rounded; an integer
17583  * variable with bounds zero and one is automatically converted into a binary variable
17584  *
17585  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17586  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17587  *
17588  * @pre This method can be called if @p scip is in one of the following stages:
17589  * - \ref SCIP_STAGE_PROBLEM
17590  * - \ref SCIP_STAGE_TRANSFORMING
17591  * - \ref SCIP_STAGE_INITPRESOLVE
17592  * - \ref SCIP_STAGE_PRESOLVING
17593  * - \ref SCIP_STAGE_EXITPRESOLVE
17594  * - \ref SCIP_STAGE_PRESOLVED
17595  * - \ref SCIP_STAGE_SOLVING
17596  */
17598  SCIP* scip, /**< SCIP data structure */
17599  SCIP_VAR** var, /**< pointer to store the problem variable */
17600  const char* str, /**< string to parse */
17601  SCIP_Bool initial, /**< should var's column be present in the initial root LP? */
17602  SCIP_Bool removable, /**< is var's column removable from the LP (due to aging or cleanup)? */
17603  SCIP_DECL_VARCOPY ((*varcopy)), /**< copies variable data if wanted to subscip, or NULL */
17604  SCIP_DECL_VARDELORIG ((*vardelorig)), /**< frees user data of original variable */
17605  SCIP_DECL_VARTRANS ((*vartrans)), /**< creates transformed user data by transforming original user data */
17606  SCIP_DECL_VARDELTRANS ((*vardeltrans)), /**< frees user data of transformed variable */
17607  SCIP_VARDATA* vardata, /**< user data for this specific variable */
17608  char** endptr, /**< pointer to store the final string position if successful */
17609  SCIP_Bool* success /**< pointer store if the paring process was successful */
17610  )
17611 {
17612  assert(var != NULL);
17613 
17614  SCIP_CALL( checkStage(scip, "SCIPparseVar", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17615 
17616  switch( scip->set->stage )
17617  {
17618  case SCIP_STAGE_PROBLEM:
17619  SCIP_CALL( SCIPvarParseOriginal(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
17620  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
17621  break;
17622 
17625  case SCIP_STAGE_PRESOLVING:
17627  case SCIP_STAGE_PRESOLVED:
17628  case SCIP_STAGE_SOLVING:
17629  SCIP_CALL( SCIPvarParseTransformed(var, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
17630  str, initial, removable, varcopy, vardelorig, vartrans, vardeltrans, vardata, endptr, success) );
17631  break;
17632 
17633  default:
17634  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
17635  return SCIP_INVALIDCALL;
17636  } /*lint !e788*/
17637 
17638  return SCIP_OKAY;
17639 }
17640 
17641 /** parses the given string for a variable name and stores the variable in the corresponding pointer if such a variable
17642  * exits and returns the position where the parsing stopped
17643  *
17644  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17645  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17646  *
17647  * @pre This method can be called if @p scip is in one of the following stages:
17648  * - \ref SCIP_STAGE_PROBLEM
17649  * - \ref SCIP_STAGE_TRANSFORMING
17650  * - \ref SCIP_STAGE_INITPRESOLVE
17651  * - \ref SCIP_STAGE_PRESOLVING
17652  * - \ref SCIP_STAGE_EXITPRESOLVE
17653  * - \ref SCIP_STAGE_PRESOLVED
17654  * - \ref SCIP_STAGE_SOLVING
17655  */
17657  SCIP* scip, /**< SCIP data structure */
17658  const char* str, /**< string to parse */
17659  SCIP_VAR** var, /**< pointer to store the problem variable, or NULL if it does not exit */
17660  char** endptr /**< pointer to store the final string position if successful */
17661  )
17662 {
17663  char varname[SCIP_MAXSTRLEN];
17664 
17665  assert(str != NULL);
17666  assert(var != NULL);
17667  assert(endptr != NULL);
17668 
17669  SCIP_CALL( checkStage(scip, "SCIPparseVarName", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17670 
17671  SCIPstrCopySection(str, '<', '>', varname, SCIP_MAXSTRLEN, endptr);
17672  assert(*endptr != NULL);
17673 
17674  if( *varname == '\0' )
17675  {
17676  SCIPerrorMessage("invalid variable name string given: could not find '<'\n");
17677  return SCIP_INVALIDDATA;
17678  }
17679 
17680  /* check if we have a negated variable */
17681  if( *varname == '~' )
17682  {
17683  SCIPdebugMsg(scip, "parsed negated variable name <%s>\n", &varname[1]);
17684 
17685  /* search for the variable and ignore '~' */
17686  (*var) = SCIPfindVar(scip, &varname[1]);
17687 
17688  if( *var != NULL )
17689  {
17690  SCIP_CALL( SCIPgetNegatedVar(scip, *var, var) );
17691  }
17692  }
17693  else
17694  {
17695  SCIPdebugMsg(scip, "parsed variable name <%s>\n", varname);
17696 
17697  /* search for the variable */
17698  (*var) = SCIPfindVar(scip, varname);
17699  }
17700 
17701  str = *endptr;
17702 
17703  /* skip additional variable type marker */
17704  if( *str == '[' && (str[1] == SCIP_VARTYPE_BINARY_CHAR || str[1] == SCIP_VARTYPE_INTEGER_CHAR ||
17705  str[1] == SCIP_VARTYPE_IMPLINT_CHAR || str[1] == SCIP_VARTYPE_CONTINUOUS_CHAR ) && str[2] == ']' )
17706  (*endptr) += 3;
17707 
17708  return SCIP_OKAY;
17709 }
17710 
17711 /** parse the given string as variable list (here ',' is the delimiter)) (<x1>, <x2>, ..., <xn>) (see
17712  * SCIPwriteVarsList() ); if it was successful, the pointer success is set to TRUE
17713  *
17714  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17715  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17716  *
17717  * @pre This method can be called if @p scip is in one of the following stages:
17718  * - \ref SCIP_STAGE_PROBLEM
17719  * - \ref SCIP_STAGE_TRANSFORMING
17720  * - \ref SCIP_STAGE_INITPRESOLVE
17721  * - \ref SCIP_STAGE_PRESOLVING
17722  * - \ref SCIP_STAGE_EXITPRESOLVE
17723  * - \ref SCIP_STAGE_PRESOLVED
17724  * - \ref SCIP_STAGE_SOLVING
17725  *
17726  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
17727  *
17728  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
17729  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
17730  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
17731  * memory functions).
17732  */
17734  SCIP* scip, /**< SCIP data structure */
17735  const char* str, /**< string to parse */
17736  SCIP_VAR** vars, /**< array to store the parsed variable */
17737  int* nvars, /**< pointer to store number of parsed variables */
17738  int varssize, /**< size of the variable array */
17739  int* requiredsize, /**< pointer to store the required array size for the active variables */
17740  char** endptr, /**< pointer to store the final string position if successful */
17741  char delimiter, /**< character which is used for delimitation */
17742  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
17743  )
17744 {
17745  SCIP_VAR** tmpvars;
17746  SCIP_VAR* var;
17747  int ntmpvars = 0;
17748  int v;
17749 
17750  assert( nvars != NULL );
17751  assert( requiredsize != NULL );
17752  assert( endptr != NULL );
17753  assert( success != NULL );
17754 
17755  SCIP_CALL( checkStage(scip, "SCIPparseVarsList", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17756 
17757  /* allocate buffer memory for temporary storing the parsed variables */
17758  SCIP_CALL( SCIPallocBufferArray(scip, &tmpvars, varssize) );
17759 
17760  (*success) = TRUE;
17761 
17762  do
17763  {
17764  *endptr = (char*)str;
17765 
17766  /* parse variable name */
17767  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
17768 
17769  if( var == NULL )
17770  {
17771  SCIPdebugMsg(scip, "variable with name <%s> does not exist\n", SCIPvarGetName(var));
17772  (*success) = FALSE;
17773  break;
17774  }
17775 
17776  /* store the variable in the tmp array */
17777  if( ntmpvars < varssize )
17778  tmpvars[ntmpvars] = var;
17779 
17780  ntmpvars++;
17781 
17782  str = *endptr;
17783 
17784  while( isspace((unsigned char)*str) )
17785  str++;
17786  }
17787  while( *str == delimiter );
17788 
17789  *endptr = (char*)str;
17790 
17791  /* if all variable name searches were successful and the variable array has enough slots, copy the collected variables */
17792  if( (*success) && ntmpvars <= varssize )
17793  {
17794  for( v = 0; v < ntmpvars; ++v )
17795  vars[v] = tmpvars[v];
17796 
17797  (*nvars) = ntmpvars;
17798  }
17799  else
17800  (*nvars) = 0;
17801 
17802  (*requiredsize) = ntmpvars;
17803 
17804  /* free buffer arrays */
17805  SCIPfreeBufferArray(scip, &tmpvars);
17806 
17807  return SCIP_OKAY;
17808 }
17809 
17810 /** parse the given string as linear sum of variables and coefficients (c1 <x1> + c2 <x2> + ... + cn <xn>)
17811  * (see SCIPwriteVarsLinearsum() ); if it was successful, the pointer success is set to TRUE
17812  *
17813  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17814  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17815  *
17816  * @pre This method can be called if @p scip is in one of the following stages:
17817  * - \ref SCIP_STAGE_PROBLEM
17818  * - \ref SCIP_STAGE_TRANSFORMING
17819  * - \ref SCIP_STAGE_INITPRESOLVE
17820  * - \ref SCIP_STAGE_PRESOLVING
17821  * - \ref SCIP_STAGE_EXITPRESOLVE
17822  * - \ref SCIP_STAGE_PRESOLVED
17823  * - \ref SCIP_STAGE_SOLVING
17824  *
17825  * @note The pointer success in only set to FALSE in the case that a variable with a parsed variable name does not exist.
17826  *
17827  * @note If the number of (parsed) variables is greater than the available slots in the variable array, nothing happens
17828  * except that the required size is stored in the corresponding integer; the reason for this approach is that we
17829  * cannot reallocate memory, since we do not know how the memory has been allocated (e.g., by a C++ 'new' or SCIP
17830  * memory functions).
17831  */
17833  SCIP* scip, /**< SCIP data structure */
17834  const char* str, /**< string to parse */
17835  SCIP_VAR** vars, /**< array to store the parsed variables */
17836  SCIP_Real* vals, /**< array to store the parsed coefficients */
17837  int* nvars, /**< pointer to store number of parsed variables */
17838  int varssize, /**< size of the variable array */
17839  int* requiredsize, /**< pointer to store the required array size for the active variables */
17840  char** endptr, /**< pointer to store the final string position if successful */
17841  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
17842  )
17843 {
17844  SCIP_VAR*** monomialvars;
17845  SCIP_Real** monomialexps;
17846  SCIP_Real* monomialcoefs;
17847  int* monomialnvars;
17848  int nmonomials;
17849 
17850  SCIP_CALL( checkStage(scip, "SCIPparseVarsLinearsum", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17851 
17852  assert(scip != NULL);
17853  assert(str != NULL);
17854  assert(vars != NULL || varssize == 0);
17855  assert(vals != NULL || varssize == 0);
17856  assert(nvars != NULL);
17857  assert(requiredsize != NULL);
17858  assert(endptr != NULL);
17859  assert(success != NULL);
17860 
17861  *requiredsize = 0;
17862 
17863  SCIP_CALL( SCIPparseVarsPolynomial(scip, str, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, &nmonomials, endptr, success) );
17864 
17865  if( !*success )
17866  {
17867  assert(nmonomials == 0); /* SCIPparseVarsPolynomial should have freed all buffers, so no need to call free here */
17868  return SCIP_OKAY;
17869  }
17870 
17871  /* check if linear sum is just "0" */
17872  if( nmonomials == 1 && monomialnvars[0] == 0 && monomialcoefs[0] == 0.0 )
17873  {
17874  *nvars = 0;
17875  *requiredsize = 0;
17876 
17877  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
17878 
17879  return SCIP_OKAY;
17880  }
17881 
17882  *nvars = nmonomials;
17883  *requiredsize = nmonomials;
17884 
17885  /* if we have enough slots in the variables array, copy variables over */
17886  if( varssize >= nmonomials )
17887  {
17888  int v;
17889 
17890  for( v = 0; v < nmonomials; ++v )
17891  {
17892  if( monomialnvars[v] == 0 )
17893  {
17894  SCIPerrorMessage("constant in linear sum\n");
17895  *success = FALSE;
17896  break;
17897  }
17898  if( monomialnvars[v] > 1 || monomialexps[v][0] != 1.0 )
17899  {
17900  SCIPerrorMessage("nonlinear monomial in linear sum\n");
17901  *success = FALSE;
17902  break;
17903  }
17904  assert(monomialnvars[v] == 1);
17905  assert(monomialvars[v][0] != NULL);
17906  assert(monomialexps[v][0] == 1.0);
17907 
17908  vars[v] = monomialvars[v][0]; /*lint !e613*/
17909  vals[v] = monomialcoefs[v]; /*lint !e613*/
17910  }
17911  }
17912 
17913  SCIPfreeParseVarsPolynomialData(scip, &monomialvars, &monomialexps, &monomialcoefs, &monomialnvars, nmonomials);
17914 
17915  return SCIP_OKAY;
17916 }
17917 
17918 /** parse the given string as polynomial of variables and coefficients
17919  * (c1 <x11>^e11 <x12>^e12 ... <x1n>^e1n + c2 <x21>^e21 <x22>^e22 ... + ... + cn <xn1>^en1 ...)
17920  * (see SCIPwriteVarsPolynomial()); if it was successful, the pointer success is set to TRUE
17921  *
17922  * The user has to call SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps,
17923  * monomialcoefs, monomialnvars, *nmonomials) short after SCIPparseVarsPolynomial to free all the
17924  * allocated memory again. Do not keep the arrays created by SCIPparseVarsPolynomial around, since
17925  * they use buffer memory that is intended for short term use only.
17926  *
17927  * Parsing is stopped at the end of string (indicated by the \\0-character) or when no more monomials
17928  * are recognized.
17929  *
17930  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
17931  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
17932  *
17933  * @pre This method can be called if @p scip is in one of the following stages:
17934  * - \ref SCIP_STAGE_PROBLEM
17935  * - \ref SCIP_STAGE_TRANSFORMING
17936  * - \ref SCIP_STAGE_INITPRESOLVE
17937  * - \ref SCIP_STAGE_PRESOLVING
17938  * - \ref SCIP_STAGE_EXITPRESOLVE
17939  * - \ref SCIP_STAGE_PRESOLVED
17940  * - \ref SCIP_STAGE_SOLVING
17941  */
17943  SCIP* scip, /**< SCIP data structure */
17944  const char* str, /**< string to parse */
17945  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
17946  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
17947  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
17948  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
17949  int* nmonomials, /**< pointer to store number of parsed monomials */
17950  char** endptr, /**< pointer to store the final string position if successful */
17951  SCIP_Bool* success /**< pointer to store the whether the parsing was successful or not */
17952  )
17953 {
17954  typedef enum
17955  {
17956  SCIPPARSEPOLYNOMIAL_STATE_BEGIN, /* we are at the beginning of a monomial */
17957  SCIPPARSEPOLYNOMIAL_STATE_INTERMED, /* we are in between the factors of a monomial */
17958  SCIPPARSEPOLYNOMIAL_STATE_COEF, /* we parse the coefficient of a monomial */
17959  SCIPPARSEPOLYNOMIAL_STATE_VARS, /* we parse monomial variables */
17960  SCIPPARSEPOLYNOMIAL_STATE_EXPONENT, /* we parse the exponent of a variable */
17961  SCIPPARSEPOLYNOMIAL_STATE_END, /* we are at the end the polynomial */
17962  SCIPPARSEPOLYNOMIAL_STATE_ERROR /* a parsing error occured */
17963  } SCIPPARSEPOLYNOMIAL_STATES;
17964 
17965  SCIPPARSEPOLYNOMIAL_STATES state;
17966  int monomialssize;
17967 
17968  /* data of currently parsed monomial */
17969  int varssize;
17970  int nvars;
17971  SCIP_VAR** vars;
17972  SCIP_Real* exponents;
17973  SCIP_Real coef;
17974 
17975  assert(scip != NULL);
17976  assert(str != NULL);
17977  assert(monomialvars != NULL);
17978  assert(monomialexps != NULL);
17979  assert(monomialnvars != NULL);
17980  assert(monomialcoefs != NULL);
17981  assert(nmonomials != NULL);
17982  assert(endptr != NULL);
17983  assert(success != NULL);
17984 
17985  SCIP_CALL( checkStage(scip, "SCIPparseVarsPolynomial", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
17986 
17987  *success = FALSE;
17988  *nmonomials = 0;
17989  monomialssize = 0;
17990  *monomialvars = NULL;
17991  *monomialexps = NULL;
17992  *monomialcoefs = NULL;
17993  *monomialnvars = NULL;
17994 
17995  /* initialize state machine */
17996  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
17997  varssize = 0;
17998  nvars = 0;
17999  vars = NULL;
18000  exponents = NULL;
18001  coef = SCIP_INVALID;
18002 
18003  SCIPdebugMsg(scip, "parsing polynomial from '%s'\n", str);
18004 
18005  while( *str && state != SCIPPARSEPOLYNOMIAL_STATE_END && state != SCIPPARSEPOLYNOMIAL_STATE_ERROR )
18006  {
18007  /* skip white space */
18008  while( isspace((unsigned char)*str) )
18009  str++;
18010 
18011  assert(state != SCIPPARSEPOLYNOMIAL_STATE_END);
18012 
18013  switch( state )
18014  {
18015  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
18016  {
18017  if( coef != SCIP_INVALID ) /*lint !e777*/
18018  {
18019  SCIPdebugMsg(scip, "push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
18020  /* push previous monomial */
18021  if( monomialssize <= *nmonomials )
18022  {
18023  monomialssize = SCIPcalcMemGrowSize(scip, *nmonomials+1);
18024 
18025  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
18026  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
18027  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
18028  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
18029  }
18030 
18031  if( nvars > 0 )
18032  {
18033  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialvars)[*nmonomials], vars, nvars) ); /*lint !e866*/
18034  SCIP_CALL( SCIPduplicateBufferArray(scip, &(*monomialexps)[*nmonomials], exponents, nvars) ); /*lint !e866*/
18035  }
18036  else
18037  {
18038  (*monomialvars)[*nmonomials] = NULL;
18039  (*monomialexps)[*nmonomials] = NULL;
18040  }
18041  (*monomialcoefs)[*nmonomials] = coef;
18042  (*monomialnvars)[*nmonomials] = nvars;
18043  ++*nmonomials;
18044 
18045  nvars = 0;
18046  coef = SCIP_INVALID;
18047  }
18048 
18049  if( *str == '<' )
18050  {
18051  /* there seem to come a variable at the beginning of a monomial
18052  * so assume the coefficient is 1.0
18053  */
18054  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
18055  coef = 1.0;
18056  break;
18057  }
18058  if( *str == '-' || *str == '+' || isdigit(*str) )
18059  {
18060  state = SCIPPARSEPOLYNOMIAL_STATE_COEF;
18061  break;
18062  }
18063 
18064  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18065 
18066  break;
18067  }
18068 
18069  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
18070  {
18071  if( *str == '<' )
18072  {
18073  /* there seem to come another variable */
18074  state = SCIPPARSEPOLYNOMIAL_STATE_VARS;
18075  break;
18076  }
18077 
18078  if( *str == '-' || *str == '+' || isdigit(*str) )
18079  {
18080  /* there seem to come a coefficient, which means the next monomial */
18081  state = SCIPPARSEPOLYNOMIAL_STATE_BEGIN;
18082  break;
18083  }
18084 
18085  /* since we cannot detect the symbols we stop parsing the polynomial */
18086  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18087  break;
18088  }
18089 
18090  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
18091  {
18092  if( *str == '+' && !isdigit(str[1]) )
18093  {
18094  /* only a plus sign, without number */
18095  coef = 1.0;
18096  ++str;
18097  }
18098  else if( *str == '-' && !isdigit(str[1]) )
18099  {
18100  /* only a minus sign, without number */
18101  coef = -1.0;
18102  ++str;
18103  }
18104  else if( SCIPstrToRealValue(str, &coef, endptr) )
18105  {
18106  str = *endptr;
18107  }
18108  else
18109  {
18110  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
18111  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18112  break;
18113  }
18114 
18115  /* after the coefficient we go into the intermediate state, i.e., expecting next variables */
18116  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18117 
18118  break;
18119  }
18120 
18121  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
18122  {
18123  SCIP_VAR* var;
18124 
18125  assert(*str == '<');
18126 
18127  /* parse variable name */
18128  SCIP_CALL( SCIPparseVarName(scip, str, &var, endptr) );
18129 
18130  /* check if variable name was parsed */
18131  if( *endptr == str )
18132  {
18133  state = SCIPPARSEPOLYNOMIAL_STATE_END;
18134  break;
18135  }
18136 
18137  if( var == NULL )
18138  {
18139  SCIPerrorMessage("did not find variable in the beginning of %s\n", str);
18140  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18141  break;
18142  }
18143 
18144  /* add variable to vars array */
18145  if( nvars + 1 > varssize )
18146  {
18147  varssize = SCIPcalcMemGrowSize(scip, nvars+1);
18148  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, varssize) );
18149  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, varssize) );
18150  }
18151  assert(vars != NULL);
18152  assert(exponents != NULL);
18153 
18154  vars[nvars] = var;
18155  exponents[nvars] = 1.0;
18156  ++nvars;
18157 
18158  str = *endptr;
18159 
18160  if( *str == '^' )
18161  state = SCIPPARSEPOLYNOMIAL_STATE_EXPONENT;
18162  else
18163  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18164 
18165  break;
18166  }
18167 
18168  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
18169  {
18170  assert(*str == '^');
18171  assert(nvars > 0); /* we should be in a monomial that has already a variable */
18172  assert(exponents != NULL);
18173  ++str;
18174 
18175  if( !SCIPstrToRealValue(str, &exponents[nvars-1], endptr) )
18176  {
18177  SCIPerrorMessage("could not parse number in the beginning of '%s'\n", str);
18178  state = SCIPPARSEPOLYNOMIAL_STATE_ERROR;
18179  break;
18180  }
18181  str = *endptr;
18182 
18183  /* after the exponent we go into the intermediate state, i.e., expecting next variables */
18184  state = SCIPPARSEPOLYNOMIAL_STATE_INTERMED;
18185  break;
18186  }
18187 
18188  case SCIPPARSEPOLYNOMIAL_STATE_END:
18189  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
18190  default:
18191  SCIPerrorMessage("unexpected state\n");
18192  return SCIP_READERROR;
18193  }
18194  }
18195 
18196  /* set end pointer */
18197  *endptr = (char*)str;
18198 
18199  /* check state at end of string */
18200  switch( state )
18201  {
18202  case SCIPPARSEPOLYNOMIAL_STATE_BEGIN:
18203  case SCIPPARSEPOLYNOMIAL_STATE_END:
18204  case SCIPPARSEPOLYNOMIAL_STATE_INTERMED:
18205  {
18206  if( coef != SCIP_INVALID ) /*lint !e777*/
18207  {
18208  /* push last monomial */
18209  SCIPdebugMsg(scip, "push monomial with coefficient <%g> and <%d> vars\n", coef, nvars);
18210  if( monomialssize <= *nmonomials )
18211  {
18212  monomialssize = *nmonomials+1;
18213  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, monomialssize) );
18214  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, monomialssize) );
18215  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, monomialssize) );
18216  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, monomialssize) );
18217  }
18218 
18219  if( nvars > 0 )
18220  {
18221  /* shrink vars and exponents array to needed size and take over ownership */
18222  SCIP_CALL( SCIPreallocBufferArray(scip, &vars, nvars) );
18223  SCIP_CALL( SCIPreallocBufferArray(scip, &exponents, nvars) );
18224  (*monomialvars)[*nmonomials] = vars;
18225  (*monomialexps)[*nmonomials] = exponents;
18226  vars = NULL;
18227  exponents = NULL;
18228  }
18229  else
18230  {
18231  (*monomialvars)[*nmonomials] = NULL;
18232  (*monomialexps)[*nmonomials] = NULL;
18233  }
18234  (*monomialcoefs)[*nmonomials] = coef;
18235  (*monomialnvars)[*nmonomials] = nvars;
18236  ++*nmonomials;
18237  }
18238 
18239  *success = TRUE;
18240  break;
18241  }
18242 
18243  case SCIPPARSEPOLYNOMIAL_STATE_COEF:
18244  case SCIPPARSEPOLYNOMIAL_STATE_VARS:
18245  case SCIPPARSEPOLYNOMIAL_STATE_EXPONENT:
18246  {
18247  SCIPerrorMessage("unexpected parsing state at end of polynomial string\n");
18248  }
18249  /*lint -fallthrough*/
18250  case SCIPPARSEPOLYNOMIAL_STATE_ERROR:
18251  assert(!*success);
18252  break;
18253  }
18254 
18255  /* free memory to store current monomial, if still existing */
18256  SCIPfreeBufferArrayNull(scip, &vars);
18257  SCIPfreeBufferArrayNull(scip, &exponents);
18258 
18259  if( *success && *nmonomials > 0 )
18260  {
18261  /* shrink arrays to required size, so we do not need to keep monomialssize around */
18262  assert(*nmonomials <= monomialssize);
18263  SCIP_CALL( SCIPreallocBufferArray(scip, monomialvars, *nmonomials) );
18264  SCIP_CALL( SCIPreallocBufferArray(scip, monomialexps, *nmonomials) );
18265  SCIP_CALL( SCIPreallocBufferArray(scip, monomialnvars, *nmonomials) );
18266  SCIP_CALL( SCIPreallocBufferArray(scip, monomialcoefs, *nmonomials) );
18267 
18268  /* SCIPwriteVarsPolynomial(scip, NULL, *monomialvars, *monomialexps, *monomialcoefs, *monomialnvars, *nmonomials, FALSE); */
18269  }
18270  else
18271  {
18272  /* in case of error, cleanup all data here */
18273  SCIPfreeParseVarsPolynomialData(scip, monomialvars, monomialexps, monomialcoefs, monomialnvars, *nmonomials);
18274  *nmonomials = 0;
18275  }
18276 
18277  return SCIP_OKAY;
18278 }
18279 
18280 /** frees memory allocated when parsing a polynomial from a string
18281  *
18282  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18283  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18284  *
18285  * @pre This method can be called if @p scip is in one of the following stages:
18286  * - \ref SCIP_STAGE_PROBLEM
18287  * - \ref SCIP_STAGE_TRANSFORMING
18288  * - \ref SCIP_STAGE_INITPRESOLVE
18289  * - \ref SCIP_STAGE_PRESOLVING
18290  * - \ref SCIP_STAGE_EXITPRESOLVE
18291  * - \ref SCIP_STAGE_PRESOLVED
18292  * - \ref SCIP_STAGE_SOLVING
18293  */
18295  SCIP* scip, /**< SCIP data structure */
18296  SCIP_VAR**** monomialvars, /**< pointer to store arrays with variables for each monomial */
18297  SCIP_Real*** monomialexps, /**< pointer to store arrays with variable exponents */
18298  SCIP_Real** monomialcoefs, /**< pointer to store array with monomial coefficients */
18299  int** monomialnvars, /**< pointer to store array with number of variables for each monomial */
18300  int nmonomials /**< pointer to store number of parsed monomials */
18301  )
18302 {
18303  int i;
18304 
18305  assert(scip != NULL);
18306  assert(monomialvars != NULL);
18307  assert(monomialexps != NULL);
18308  assert(monomialcoefs != NULL);
18309  assert(monomialnvars != NULL);
18310  assert((*monomialvars != NULL) == (nmonomials > 0));
18311  assert((*monomialexps != NULL) == (nmonomials > 0));
18312  assert((*monomialcoefs != NULL) == (nmonomials > 0));
18313  assert((*monomialnvars != NULL) == (nmonomials > 0));
18314 
18315  SCIP_CALL_ABORT( checkStage(scip, "SCIPfreeParseVarsPolynomialData", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18316 
18317  if( nmonomials == 0 )
18318  return;
18319 
18320  for( i = nmonomials - 1; i >= 0; --i )
18321  {
18322  SCIPfreeBufferArrayNull(scip, &(*monomialvars)[i]);
18323  SCIPfreeBufferArrayNull(scip, &(*monomialexps)[i]);
18324  }
18325 
18326  SCIPfreeBufferArray(scip, monomialvars);
18327  SCIPfreeBufferArray(scip, monomialexps);
18328  SCIPfreeBufferArray(scip, monomialcoefs);
18329  SCIPfreeBufferArray(scip, monomialnvars);
18330 }
18331 
18332 /** increases usage counter of variable
18333  *
18334  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18335  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18336  *
18337  * @pre This method can be called if @p scip is in one of the following stages:
18338  * - \ref SCIP_STAGE_PROBLEM
18339  * - \ref SCIP_STAGE_TRANSFORMING
18340  * - \ref SCIP_STAGE_TRANSFORMED
18341  * - \ref SCIP_STAGE_INITPRESOLVE
18342  * - \ref SCIP_STAGE_PRESOLVING
18343  * - \ref SCIP_STAGE_EXITPRESOLVE
18344  * - \ref SCIP_STAGE_PRESOLVED
18345  * - \ref SCIP_STAGE_INITSOLVE
18346  * - \ref SCIP_STAGE_SOLVING
18347  * - \ref SCIP_STAGE_SOLVED
18348  * - \ref SCIP_STAGE_EXITSOLVE
18349  */
18351  SCIP* scip, /**< SCIP data structure */
18352  SCIP_VAR* var /**< variable to capture */
18353  )
18354 {
18355  SCIP_CALL( checkStage(scip, "SCIPcaptureVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
18356  assert(var->scip == scip);
18357 
18358  SCIPvarCapture(var);
18359 
18360  return SCIP_OKAY;
18361 }
18362 
18363 /** decreases usage counter of variable, if the usage pointer reaches zero the variable gets freed
18364  *
18365  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18366  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18367  *
18368  * @pre This method can be called if @p scip is in one of the following stages:
18369  * - \ref SCIP_STAGE_PROBLEM
18370  * - \ref SCIP_STAGE_TRANSFORMING
18371  * - \ref SCIP_STAGE_TRANSFORMED
18372  * - \ref SCIP_STAGE_INITPRESOLVE
18373  * - \ref SCIP_STAGE_PRESOLVING
18374  * - \ref SCIP_STAGE_EXITPRESOLVE
18375  * - \ref SCIP_STAGE_PRESOLVED
18376  * - \ref SCIP_STAGE_INITSOLVE
18377  * - \ref SCIP_STAGE_SOLVING
18378  * - \ref SCIP_STAGE_SOLVED
18379  * - \ref SCIP_STAGE_EXITSOLVE
18380  * - \ref SCIP_STAGE_FREETRANS
18381  *
18382  * @note the pointer of the variable will be NULLed
18383  */
18385  SCIP* scip, /**< SCIP data structure */
18386  SCIP_VAR** var /**< pointer to variable */
18387  )
18388 {
18389  assert(var != NULL);
18390  assert(*var != NULL);
18391  assert((*var)->scip == scip);
18392 
18393  SCIP_CALL( checkStage(scip, "SCIPreleaseVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18394 
18395  switch( scip->set->stage )
18396  {
18397  case SCIP_STAGE_PROBLEM:
18398  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
18399  return SCIP_OKAY;
18400 
18404  case SCIP_STAGE_PRESOLVING:
18406  case SCIP_STAGE_PRESOLVED:
18407  case SCIP_STAGE_INITSOLVE:
18408  case SCIP_STAGE_SOLVING:
18409  case SCIP_STAGE_SOLVED:
18410  case SCIP_STAGE_EXITSOLVE:
18411  case SCIP_STAGE_FREETRANS:
18412  if( !SCIPvarIsTransformed(*var) && (*var)->nuses == 1 )
18413  {
18414  SCIPerrorMessage("cannot release last use of original variable while the transformed problem exists\n");
18415  return SCIP_INVALIDCALL;
18416  }
18417  SCIP_CALL( SCIPvarRelease(var, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
18418  return SCIP_OKAY;
18419 
18420  default:
18421  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
18422  return SCIP_INVALIDCALL;
18423  } /*lint !e788*/
18424 }
18425 
18426 /** changes the name of a variable
18427  *
18428  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18429  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18430  *
18431  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PROBLEM
18432  *
18433  * @note to get the current name of a variable, use SCIPvarGetName() from pub_var.h
18434  */
18436  SCIP* scip, /**< SCIP data structure */
18437  SCIP_VAR* var, /**< variable */
18438  const char* name /**< new name of constraint */
18439  )
18440 {
18441  SCIP_CALL( checkStage(scip, "SCIPchgVarName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
18442  assert( var->scip == scip );
18443 
18444  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
18445  {
18446  SCIPerrorMessage("variable names can only be changed in problem creation stage\n");
18447  SCIPABORT();
18448  return SCIP_INVALIDCALL; /*lint !e527*/
18449  }
18450 
18451  /* remove variable's name from the namespace if the variable was already added */
18452  if( SCIPvarGetProbindex(var) != -1 )
18453  {
18454  SCIP_CALL( SCIPprobRemoveVarName(scip->origprob, var) );
18455  }
18456 
18457  /* change variable name */
18458  SCIP_CALL( SCIPvarChgName(var, SCIPblkmem(scip), name) );
18459 
18460  /* add variable's name to the namespace if the variable was already added */
18461  if( SCIPvarGetProbindex(var) != -1 )
18462  {
18463  SCIP_CALL( SCIPprobAddVarName(scip->origprob, var) );
18464  }
18465 
18466  return SCIP_OKAY;
18467 }
18468 
18469 /** gets and captures transformed variable of a given variable; if the variable is not yet transformed,
18470  * a new transformed variable for this variable is created
18471  *
18472  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18473  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18474  *
18475  * @pre This method can be called if @p scip is in one of the following stages:
18476  * - \ref SCIP_STAGE_TRANSFORMING
18477  * - \ref SCIP_STAGE_TRANSFORMED
18478  * - \ref SCIP_STAGE_INITPRESOLVE
18479  * - \ref SCIP_STAGE_PRESOLVING
18480  * - \ref SCIP_STAGE_EXITPRESOLVE
18481  * - \ref SCIP_STAGE_PRESOLVED
18482  * - \ref SCIP_STAGE_INITSOLVE
18483  * - \ref SCIP_STAGE_SOLVING
18484  */
18486  SCIP* scip, /**< SCIP data structure */
18487  SCIP_VAR* var, /**< variable to get/create transformed variable for */
18488  SCIP_VAR** transvar /**< pointer to store the transformed variable */
18489  )
18490 {
18491  assert(transvar != NULL);
18492 
18493  SCIP_CALL( checkStage(scip, "SCIPtransformVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18494 
18495  if( SCIPvarIsTransformed(var) )
18496  {
18497  *transvar = var;
18498  SCIPvarCapture(*transvar);
18499  }
18500  else
18501  {
18502  SCIP_CALL( SCIPvarTransform(var, scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense, transvar) );
18503  }
18504 
18505  return SCIP_OKAY;
18506 }
18507 
18508 /** gets and captures transformed variables for an array of variables;
18509  * if a variable of the array is not yet transformed, a new transformed variable for this variable is created;
18510  * it is possible to call this method with vars == transvars
18511  *
18512  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18513  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18514  *
18515  * @pre This method can be called if @p scip is in one of the following stages:
18516  * - \ref SCIP_STAGE_TRANSFORMING
18517  * - \ref SCIP_STAGE_TRANSFORMED
18518  * - \ref SCIP_STAGE_INITPRESOLVE
18519  * - \ref SCIP_STAGE_PRESOLVING
18520  * - \ref SCIP_STAGE_EXITPRESOLVE
18521  * - \ref SCIP_STAGE_PRESOLVED
18522  * - \ref SCIP_STAGE_INITSOLVE
18523  * - \ref SCIP_STAGE_SOLVING
18524  */
18526  SCIP* scip, /**< SCIP data structure */
18527  int nvars, /**< number of variables to get/create transformed variables for */
18528  SCIP_VAR** vars, /**< array with variables to get/create transformed variables for */
18529  SCIP_VAR** transvars /**< array to store the transformed variables */
18530  )
18531 {
18532  int v;
18533 
18534  assert(nvars == 0 || vars != NULL);
18535  assert(nvars == 0 || transvars != NULL);
18536 
18537  SCIP_CALL( checkStage(scip, "SCIPtransformVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
18538 
18539  for( v = 0; v < nvars; ++v )
18540  {
18541  if( SCIPvarIsTransformed(vars[v]) )
18542  {
18543  transvars[v] = vars[v];
18544  SCIPvarCapture(transvars[v]);
18545  }
18546  else
18547  {
18548  SCIP_CALL( SCIPvarTransform(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->origprob->objsense,
18549  &transvars[v]) );
18550  }
18551  }
18552 
18553  return SCIP_OKAY;
18554 }
18555 
18556 /** gets corresponding transformed variable of a given variable;
18557  * returns NULL as transvar, if transformed variable is not yet existing
18558  *
18559  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18560  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18561  *
18562  * @pre This method can be called if @p scip is in one of the following stages:
18563  * - \ref SCIP_STAGE_TRANSFORMING
18564  * - \ref SCIP_STAGE_TRANSFORMED
18565  * - \ref SCIP_STAGE_INITPRESOLVE
18566  * - \ref SCIP_STAGE_PRESOLVING
18567  * - \ref SCIP_STAGE_EXITPRESOLVE
18568  * - \ref SCIP_STAGE_PRESOLVED
18569  * - \ref SCIP_STAGE_INITSOLVE
18570  * - \ref SCIP_STAGE_SOLVING
18571  * - \ref SCIP_STAGE_SOLVED
18572  * - \ref SCIP_STAGE_EXITSOLVE
18573  * - \ref SCIP_STAGE_FREETRANS
18574  */
18576  SCIP* scip, /**< SCIP data structure */
18577  SCIP_VAR* var, /**< variable to get transformed variable for */
18578  SCIP_VAR** transvar /**< pointer to store the transformed variable */
18579  )
18580 {
18581  assert(transvar != NULL);
18582 
18583  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVar", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18584 
18585  if( SCIPvarIsTransformed(var) )
18586  *transvar = var;
18587  else
18588  {
18589  SCIP_CALL( SCIPvarGetTransformed(var, scip->mem->probmem, scip->set, scip->stat, transvar) );
18590  }
18591 
18592  return SCIP_OKAY;
18593 }
18594 
18595 /** gets corresponding transformed variables for an array of variables;
18596  * stores NULL in a transvars slot, if the transformed variable is not yet existing;
18597  * it is possible to call this method with vars == transvars, but remember that variables that are not
18598  * yet transformed will be replaced with NULL
18599  *
18600  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18601  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18602  *
18603  * @pre This method can be called if @p scip is in one of the following stages:
18604  * - \ref SCIP_STAGE_TRANSFORMING
18605  * - \ref SCIP_STAGE_TRANSFORMED
18606  * - \ref SCIP_STAGE_INITPRESOLVE
18607  * - \ref SCIP_STAGE_PRESOLVING
18608  * - \ref SCIP_STAGE_EXITPRESOLVE
18609  * - \ref SCIP_STAGE_PRESOLVED
18610  * - \ref SCIP_STAGE_INITSOLVE
18611  * - \ref SCIP_STAGE_SOLVING
18612  * - \ref SCIP_STAGE_SOLVED
18613  * - \ref SCIP_STAGE_EXITSOLVE
18614  * - \ref SCIP_STAGE_FREETRANS
18615  */
18617  SCIP* scip, /**< SCIP data structure */
18618  int nvars, /**< number of variables to get transformed variables for */
18619  SCIP_VAR** vars, /**< array with variables to get transformed variables for */
18620  SCIP_VAR** transvars /**< array to store the transformed variables */
18621  )
18622 {
18623  int v;
18624 
18625  assert(nvars == 0 || vars != NULL);
18626  assert(nvars == 0 || transvars != NULL);
18627 
18628  SCIP_CALL( checkStage(scip, "SCIPgetTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18629 
18630  for( v = 0; v < nvars; ++v )
18631  {
18632  if( SCIPvarIsTransformed(vars[v]) )
18633  transvars[v] = vars[v];
18634  else
18635  {
18636  SCIP_CALL( SCIPvarGetTransformed(vars[v], scip->mem->probmem, scip->set, scip->stat, &transvars[v]) );
18637  }
18638  }
18639 
18640  return SCIP_OKAY;
18641 }
18642 
18643 /** gets negated variable x' = lb + ub - x of variable x; negated variable is created, if not yet existing;
18644  * in difference to \ref SCIPcreateVar, the negated variable must not be released (unless captured explicitly)
18645  *
18646  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18647  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18648  *
18649  * @pre This method can be called if @p scip is in one of the following stages:
18650  * - \ref SCIP_STAGE_PROBLEM
18651  * - \ref SCIP_STAGE_TRANSFORMING
18652  * - \ref SCIP_STAGE_TRANSFORMED
18653  * - \ref SCIP_STAGE_INITPRESOLVE
18654  * - \ref SCIP_STAGE_PRESOLVING
18655  * - \ref SCIP_STAGE_EXITPRESOLVE
18656  * - \ref SCIP_STAGE_PRESOLVED
18657  * - \ref SCIP_STAGE_INITSOLVE
18658  * - \ref SCIP_STAGE_SOLVING
18659  * - \ref SCIP_STAGE_SOLVED
18660  * - \ref SCIP_STAGE_EXITSOLVE
18661  * - \ref SCIP_STAGE_FREETRANS
18662  */
18664  SCIP* scip, /**< SCIP data structure */
18665  SCIP_VAR* var, /**< variable to get negated variable for */
18666  SCIP_VAR** negvar /**< pointer to store the negated variable */
18667  )
18668 {
18669  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18670  assert( var->scip == scip );
18671 
18672  SCIP_CALL( SCIPvarNegate(var, scip->mem->probmem, scip->set, scip->stat, negvar) );
18673 
18674  return SCIP_OKAY;
18675 }
18676 
18677 /** gets negated variables x' = lb + ub - x of variables x; negated variables are created, if not yet existing
18678  *
18679  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18680  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18681  *
18682  * @pre This method can be called if @p scip is in one of the following stages:
18683  * - \ref SCIP_STAGE_PROBLEM
18684  * - \ref SCIP_STAGE_TRANSFORMING
18685  * - \ref SCIP_STAGE_TRANSFORMED
18686  * - \ref SCIP_STAGE_INITPRESOLVE
18687  * - \ref SCIP_STAGE_PRESOLVING
18688  * - \ref SCIP_STAGE_EXITPRESOLVE
18689  * - \ref SCIP_STAGE_PRESOLVED
18690  * - \ref SCIP_STAGE_INITSOLVE
18691  * - \ref SCIP_STAGE_SOLVING
18692  * - \ref SCIP_STAGE_SOLVED
18693  * - \ref SCIP_STAGE_EXITSOLVE
18694  * - \ref SCIP_STAGE_FREETRANS
18695  */
18697  SCIP* scip, /**< SCIP data structure */
18698  int nvars, /**< number of variables to get negated variables for */
18699  SCIP_VAR** vars, /**< array of variables to get negated variables for */
18700  SCIP_VAR** negvars /**< array to store the negated variables */
18701  )
18702 {
18703  int v;
18704 
18705  SCIP_CALL( checkStage(scip, "SCIPgetNegatedVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18706 
18707  for( v = 0; v < nvars; ++v )
18708  {
18709  SCIP_CALL( SCIPvarNegate(vars[v], scip->mem->probmem, scip->set, scip->stat, &(negvars[v])) );
18710  }
18711 
18712  return SCIP_OKAY;
18713 }
18714 
18715 /** gets a binary variable that is equal to the given binary variable, and that is either active, fixed, or
18716  * multi-aggregated, or the negated variable of an active, fixed, or multi-aggregated variable
18717  *
18718  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18719  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18720  *
18721  * @pre This method can be called if @p scip is in one of the following stages:
18722  * - \ref SCIP_STAGE_PROBLEM
18723  * - \ref SCIP_STAGE_TRANSFORMED
18724  * - \ref SCIP_STAGE_INITPRESOLVE
18725  * - \ref SCIP_STAGE_PRESOLVING
18726  * - \ref SCIP_STAGE_EXITPRESOLVE
18727  * - \ref SCIP_STAGE_PRESOLVED
18728  * - \ref SCIP_STAGE_INITSOLVE
18729  * - \ref SCIP_STAGE_SOLVING
18730  * - \ref SCIP_STAGE_SOLVED
18731  * - \ref SCIP_STAGE_EXITSOLVE
18732  */
18734  SCIP* scip, /**< SCIP data structure */
18735  SCIP_VAR* var, /**< binary variable to get binary representative for */
18736  SCIP_VAR** repvar, /**< pointer to store the binary representative */
18737  SCIP_Bool* negated /**< pointer to store whether the negation of an active variable was returned */
18738  )
18739 {
18740  assert(scip != NULL);
18741  assert(var != NULL);
18742  assert(repvar != NULL);
18743  assert(negated != NULL);
18744  assert(var->scip == scip);
18745 
18746  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentative", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
18747 
18748  /* get the active representative of the given variable */
18749  *repvar = var;
18750  *negated = FALSE;
18751  SCIP_CALL( SCIPvarGetProbvarBinary(repvar, negated) );
18752 
18753  /* negate the representative, if it corresponds to the negation of the given variable */
18754  if( *negated )
18755  {
18756  SCIP_CALL( SCIPgetNegatedVar(scip, *repvar, repvar) );
18757  }
18758 
18759  return SCIP_OKAY;
18760 }
18761 
18762 /** gets binary variables that are equal to the given binary variables, and which are either active, fixed, or
18763  * multi-aggregated, or the negated variables of active, fixed, or multi-aggregated variables
18764  *
18765  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18766  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18767  *
18768  * @pre This method can be called if @p scip is in one of the following stages:
18769  * - \ref SCIP_STAGE_PROBLEM
18770  * - \ref SCIP_STAGE_TRANSFORMED
18771  * - \ref SCIP_STAGE_INITPRESOLVE
18772  * - \ref SCIP_STAGE_PRESOLVING
18773  * - \ref SCIP_STAGE_EXITPRESOLVE
18774  * - \ref SCIP_STAGE_PRESOLVED
18775  * - \ref SCIP_STAGE_INITSOLVE
18776  * - \ref SCIP_STAGE_SOLVING
18777  * - \ref SCIP_STAGE_SOLVED
18778  * - \ref SCIP_STAGE_EXITSOLVE
18779  */
18781  SCIP* scip, /**< SCIP data structure */
18782  int nvars, /**< number of binary variables to get representatives for */
18783  SCIP_VAR** vars, /**< binary variables to get binary representatives for */
18784  SCIP_VAR** repvars, /**< array to store the binary representatives */
18785  SCIP_Bool* negated /**< array to store whether the negation of an active variable was returned */
18786  )
18787 {
18788  int v;
18789 
18790  assert(scip != NULL);
18791  assert(vars != NULL || nvars == 0);
18792  assert(repvars != NULL || nvars == 0);
18793  assert(negated != NULL || nvars == 0);
18794 
18795  SCIP_CALL( checkStage(scip, "SCIPgetBinvarRepresentatives", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
18796 
18797  if( nvars == 0 )
18798  return SCIP_OKAY;
18799 
18800  /* get the active representative of the given variable */
18801  BMScopyMemoryArray(repvars, vars, nvars);
18802  BMSclearMemoryArray(negated, nvars);
18803  SCIP_CALL( SCIPvarsGetProbvarBinary(&repvars, &negated, nvars) );
18804 
18805  /* negate the representatives, if they correspond to the negation of the given variables */
18806  for( v = nvars - 1; v >= 0; --v )
18807  if( negated[v] )
18808  {
18809  SCIP_CALL( SCIPgetNegatedVar(scip, repvars[v], &(repvars[v])) );
18810  }
18811 
18812  return SCIP_OKAY;
18813 }
18814 
18815 /** flattens aggregation graph of multi-aggregated variable in order to avoid exponential recursion later on
18816  *
18817  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18818  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18819  *
18820  * @pre This method can be called if @p scip is in one of the following stages:
18821  * - \ref SCIP_STAGE_INITPRESOLVE
18822  * - \ref SCIP_STAGE_PRESOLVING
18823  * - \ref SCIP_STAGE_EXITPRESOLVE
18824  * - \ref SCIP_STAGE_PRESOLVED
18825  * - \ref SCIP_STAGE_INITSOLVE
18826  * - \ref SCIP_STAGE_SOLVING
18827  * - \ref SCIP_STAGE_SOLVED
18828  */
18830  SCIP* scip, /**< SCIP data structure */
18831  SCIP_VAR* var /**< problem variable */
18832  )
18833 {
18834  assert( scip != NULL );
18835  assert( var != NULL );
18836  SCIP_CALL( checkStage(scip, "SCIPflattenVarAggregationGraph", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
18837 
18838  SCIP_CALL( SCIPvarFlattenAggregationGraph(var, scip->mem->probmem, scip->set) );
18839  return SCIP_OKAY;
18840 }
18841 
18842 /** Transforms a given linear sum of variables, that is a_1*x_1 + ... + a_n*x_n + c into a corresponding linear sum of
18843  * active variables, that is b_1*y_1 + ... + b_m*y_m + d.
18844  *
18845  * If the number of needed active variables is greater than the available slots in the variable array, nothing happens
18846  * except that the required size is stored in the corresponding variable (requiredsize). Otherwise, the active variable
18847  * representation is stored in the variable array, scalar array and constant.
18848  *
18849  * The reason for this approach is that we cannot reallocate memory, since we do not know how the memory has been
18850  * allocated (e.g., by a C++ 'new' or SCIP functions).
18851  *
18852  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18853  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18854  *
18855  * @pre This method can be called if @p scip is in one of the following stages:
18856  * - \ref SCIP_STAGE_TRANSFORMED
18857  * - \ref SCIP_STAGE_INITPRESOLVE
18858  * - \ref SCIP_STAGE_PRESOLVING
18859  * - \ref SCIP_STAGE_EXITPRESOLVE
18860  * - \ref SCIP_STAGE_PRESOLVED
18861  * - \ref SCIP_STAGE_INITSOLVE
18862  * - \ref SCIP_STAGE_SOLVING
18863  * - \ref SCIP_STAGE_SOLVED
18864  * - \ref SCIP_STAGE_EXITSOLVE
18865  * - \ref SCIP_STAGE_FREETRANS
18866  *
18867  * @note The resulting linear sum is stored into the given variable array, scalar array, and constant. That means the
18868  * given entries are overwritten.
18869  *
18870  * @note That method can be used to convert a single variables into variable space of active variables. Therefore call
18871  * the method with the linear sum 1.0*x + 0.0.
18872  */
18874  SCIP* scip, /**< SCIP data structure */
18875  SCIP_VAR** vars, /**< variable array x_1, ..., x_n in the linear sum which will be
18876  * overwritten by the variable array y_1, ..., y_m in the linear sum
18877  * w.r.t. active variables */
18878  SCIP_Real* scalars, /**< scalars a_1, ..., a_n in linear sum which will be overwritten to the
18879  * scalars b_1, ..., b_m in the linear sum of the active variables */
18880  int* nvars, /**< pointer to number of variables in the linear sum which will be
18881  * overwritten by the number of variables in the linear sum corresponding
18882  * to the active variables */
18883  int varssize, /**< available slots in vars and scalars array which is needed to check if
18884  * the array are large enough for the linear sum w.r.t. active
18885  * variables */
18886  SCIP_Real* constant, /**< pointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c which
18887  * will chnage to constant d in the linear sum b_1*y_1 + ... + b_m*y_m +
18888  * d w.r.t. the active variables */
18889  int* requiredsize, /**< pointer to store the required array size for the linear sum w.r.t. the
18890  * active variables */
18891  SCIP_Bool mergemultiples /**< should multiple occurrences of a var be replaced by a single coeff? */
18892  )
18893 {
18894  assert( scip != NULL );
18895  assert( nvars != NULL );
18896  assert( vars != NULL || *nvars == 0 );
18897  assert( scalars != NULL || *nvars == 0 );
18898  assert( constant != NULL );
18899  assert( requiredsize != NULL );
18900  assert( *nvars <= varssize );
18901 
18902  SCIP_CALL( checkStage(scip, "SCIPgetProbvarLinearSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18903  SCIP_CALL( SCIPvarGetActiveRepresentatives(scip->set, vars, scalars, nvars, varssize, constant, requiredsize, mergemultiples) );
18904 
18905  return SCIP_OKAY;
18906 }
18907 
18908 /** transforms given variable, scalar and constant to the corresponding active, fixed, or
18909  * multi-aggregated variable, scalar and constant; if the variable resolves to a fixed variable,
18910  * "scalar" will be 0.0 and the value of the sum will be stored in "constant"; a multi-aggregation
18911  * with only one active variable (this can happen due to fixings after the multi-aggregation),
18912  * is treated like an aggregation; if the multi-aggregation constant is infinite, "scalar" will be 0.0
18913  *
18914  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18915  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18916  *
18917  * @pre This method can be called if @p scip is in one of the following stages:
18918  * - \ref SCIP_STAGE_TRANSFORMED
18919  * - \ref SCIP_STAGE_INITPRESOLVE
18920  * - \ref SCIP_STAGE_PRESOLVING
18921  * - \ref SCIP_STAGE_EXITPRESOLVE
18922  * - \ref SCIP_STAGE_PRESOLVED
18923  * - \ref SCIP_STAGE_INITSOLVE
18924  * - \ref SCIP_STAGE_SOLVING
18925  * - \ref SCIP_STAGE_SOLVED
18926  * - \ref SCIP_STAGE_EXITSOLVE
18927  * - \ref SCIP_STAGE_FREETRANS
18928  */
18930  SCIP* scip, /**< SCIP data structure */
18931  SCIP_VAR** var, /**< pointer to problem variable x in sum a*x + c */
18932  SCIP_Real* scalar, /**< pointer to scalar a in sum a*x + c */
18933  SCIP_Real* constant /**< pointer to constant c in sum a*x + c */
18934  )
18935 {
18936  assert(scip != NULL);
18937  assert(var != NULL);
18938  assert(scalar != NULL);
18939  assert(constant != NULL);
18940 
18941  SCIP_CALL( checkStage(scip, "SCIPgetProbvarSum", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18942  SCIP_CALL( SCIPvarGetProbvarSum(var, scip->set, scalar, constant) );
18943 
18944  return SCIP_OKAY;
18945 }
18946 
18947 /** return for given variables all their active counterparts; all active variables will be pairwise different
18948  * @note It does not hold that the first output variable is the active variable for the first input variable.
18949  *
18950  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
18951  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
18952  *
18953  * @pre This method can be called if @p scip is in one of the following stages:
18954  * - \ref SCIP_STAGE_TRANSFORMED
18955  * - \ref SCIP_STAGE_INITPRESOLVE
18956  * - \ref SCIP_STAGE_PRESOLVING
18957  * - \ref SCIP_STAGE_EXITPRESOLVE
18958  * - \ref SCIP_STAGE_PRESOLVED
18959  * - \ref SCIP_STAGE_INITSOLVE
18960  * - \ref SCIP_STAGE_SOLVING
18961  * - \ref SCIP_STAGE_SOLVED
18962  * - \ref SCIP_STAGE_EXITSOLVE
18963  * - \ref SCIP_STAGE_FREETRANS
18964  */
18966  SCIP* scip, /**< SCIP data structure */
18967  SCIP_VAR** vars, /**< variable array with given variables and as output all active
18968  * variables, if enough slots exist
18969  */
18970  int* nvars, /**< number of given variables, and as output number of active variables,
18971  * if enough slots exist
18972  */
18973  int varssize, /**< available slots in vars array */
18974  int* requiredsize /**< pointer to store the required array size for the active variables */
18975  )
18976 {
18977  assert(scip != NULL);
18978  assert(nvars != NULL);
18979  assert(vars != NULL || *nvars == 0);
18980  assert(varssize >= *nvars);
18981  assert(requiredsize != NULL);
18982 
18983  SCIP_CALL( checkStage(scip, "SCIPgetActiveVars", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
18984  SCIP_CALL( SCIPvarsGetActiveVars(scip->set, vars, nvars, varssize, requiredsize) );
18985 
18986  return SCIP_OKAY;
18987 }
18988 
18989 /** returns the reduced costs of the variable in the current node's LP relaxation;
18990  * the current node has to have a feasible LP.
18991  *
18992  * returns SCIP_INVALID if the variable is active but not in the current LP;
18993  * returns 0 if the variable has been aggregated out or fixed in presolving.
18994  *
18995  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
18996  */
18998  SCIP* scip, /**< SCIP data structure */
18999  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
19000  )
19001 {
19002  assert( scip != NULL );
19003  assert( var != NULL );
19004  assert( var->scip == scip );
19005 
19006  switch( SCIPvarGetStatus(var) )
19007  {
19009  if( var->data.original.transvar == NULL )
19010  return SCIP_INVALID;
19011  return SCIPgetVarRedcost(scip, var->data.original.transvar);
19012 
19013  case SCIP_VARSTATUS_COLUMN:
19014  return SCIPgetColRedcost(scip, SCIPvarGetCol(var));
19015 
19016  case SCIP_VARSTATUS_LOOSE:
19017  return SCIP_INVALID;
19018 
19019  case SCIP_VARSTATUS_FIXED:
19023  return 0.0;
19024 
19025  default:
19026  SCIPerrorMessage("unknown variable status\n");
19027  SCIPABORT();
19028  return 0.0; /*lint !e527*/
19029  }
19030 }
19031 
19032 /** returns the implied reduced costs of the variable in the current node's LP relaxation;
19033  * the current node has to have a feasible LP.
19034  *
19035  * returns SCIP_INVALID if the variable is active but not in the current LP;
19036  * returns 0 if the variable has been aggregated out or fixed in presolving.
19037  *
19038  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19039  */
19041  SCIP* scip, /**< SCIP data structure */
19042  SCIP_VAR* var, /**< variable to get reduced costs, should be a column in current node LP */
19043  SCIP_Bool varfixing /**< FALSE if for x == 0, TRUE for x == 1 */
19044  )
19045 {
19046  assert( scip != NULL );
19047  assert( var != NULL );
19048  assert( var->scip == scip );
19049 
19050  switch( SCIPvarGetStatus(var) )
19051  {
19053  if( var->data.original.transvar == NULL )
19054  return SCIP_INVALID;
19055  return SCIPgetVarImplRedcost(scip, var->data.original.transvar, varfixing);
19056 
19057  case SCIP_VARSTATUS_COLUMN:
19058  return SCIPvarGetImplRedcost(var, scip->set, varfixing, scip->stat, scip->transprob, scip->lp);
19059 
19060  case SCIP_VARSTATUS_LOOSE:
19061  return SCIP_INVALID;
19062 
19063  case SCIP_VARSTATUS_FIXED:
19067  return 0.0;
19068 
19069  default:
19070  SCIPerrorMessage("unknown variable status\n");
19071  SCIPABORT();
19072  return 0.0; /*lint !e527*/
19073  }
19074 }
19075 
19076 
19077 /** returns the Farkas coefficient of the variable in the current node's LP relaxation;
19078  * the current node has to have an infeasible LP.
19079  *
19080  * returns SCIP_INVALID if the variable is active but not in the current LP;
19081  * returns 0 if the variable has been aggregated out or fixed in presolving.
19082  *
19083  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
19084  */
19086  SCIP* scip, /**< SCIP data structure */
19087  SCIP_VAR* var /**< variable to get reduced costs, should be a column in current node LP */
19088  )
19089 {
19090  assert(scip != NULL);
19091  assert(var != NULL);
19092  assert(var->scip == scip);
19093 
19094  switch( SCIPvarGetStatus(var) )
19095  {
19097  if( var->data.original.transvar == NULL )
19098  return SCIP_INVALID;
19099  return SCIPgetVarFarkasCoef(scip,var->data.original.transvar);
19100 
19101  case SCIP_VARSTATUS_COLUMN:
19102  return SCIPgetColFarkasCoef(scip,SCIPvarGetCol(var));
19103 
19104  case SCIP_VARSTATUS_LOOSE:
19105  return SCIP_INVALID;
19106 
19107  case SCIP_VARSTATUS_FIXED:
19111  return 0.0;
19112 
19113  default:
19114  SCIPerrorMessage("unknown variable status\n");
19115  SCIPABORT();
19116  return 0.0; /*lint !e527*/
19117  }
19118 }
19119 
19120 /** returns lower bound of variable directly before or after the bound change given by the bound change index
19121  * was applied
19122  */
19124  SCIP* scip, /**< SCIP data structure */
19125  SCIP_VAR* var, /**< problem variable */
19126  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19127  SCIP_Bool after /**< should the bound change with given index be included? */
19128  )
19129 {
19130  SCIP_VARSTATUS varstatus;
19131  assert(var != NULL);
19132 
19133  varstatus = SCIPvarGetStatus(var);
19134 
19135  if( varstatus == SCIP_VARSTATUS_COLUMN || varstatus == SCIP_VARSTATUS_LOOSE )
19136  {
19137  if( bdchgidx == NULL )
19138  return SCIPvarGetLbLocal(var);
19139  else
19140  {
19141  SCIP_BDCHGINFO* bdchginfo;
19142 
19143  bdchginfo = SCIPvarGetLbchgInfo(var, bdchgidx, after);
19144  if( bdchginfo != NULL )
19145  return SCIPbdchginfoGetNewbound(bdchginfo);
19146  else
19147  return var->glbdom.lb;
19148  }
19149  }
19150 
19151  /* get bounds of attached variables */
19152  switch( varstatus )
19153  {
19155  assert(var->data.original.transvar != NULL);
19156  return SCIPgetVarLbAtIndex(scip, var->data.original.transvar, bdchgidx, after);
19157 
19158  case SCIP_VARSTATUS_FIXED:
19159  return var->glbdom.lb;
19160 
19161  case SCIP_VARSTATUS_AGGREGATED: /* x = a*y + c -> y = (x-c)/a */
19162  assert(var->data.aggregate.var != NULL);
19163  if( var->data.aggregate.scalar > 0.0 )
19164  {
19165  SCIP_Real lb;
19166 
19167  lb = SCIPgetVarLbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19168 
19169  /* a > 0 -> get lower bound of y */
19170  if( SCIPisInfinity(scip, -lb) )
19171  return -SCIPinfinity(scip);
19172  else if( SCIPisInfinity(scip, lb) )
19173  return SCIPinfinity(scip);
19174  else
19175  return var->data.aggregate.scalar * lb + var->data.aggregate.constant;
19176  }
19177  else if( var->data.aggregate.scalar < 0.0 )
19178  {
19179  SCIP_Real ub;
19180 
19181  ub = SCIPgetVarUbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19182 
19183  /* a < 0 -> get upper bound of y */
19184  if( SCIPisInfinity(scip, -ub) )
19185  return SCIPinfinity(scip);
19186  else if( SCIPisInfinity(scip, ub) )
19187  return -SCIPinfinity(scip);
19188  else
19189  return var->data.aggregate.scalar * ub + var->data.aggregate.constant;
19190  }
19191  else
19192  {
19193  SCIPerrorMessage("scalar is zero in aggregation\n");
19194  SCIPABORT();
19195  return SCIP_INVALID; /*lint !e527*/
19196  }
19197 
19199  /* handle multi-aggregated variables depending on one variable only (possibly caused by SCIPvarFlattenAggregationGraph()) */
19200  if ( var->data.multaggr.nvars == 1 )
19201  {
19202  assert(var->data.multaggr.vars != NULL);
19203  assert(var->data.multaggr.scalars != NULL);
19204  assert(var->data.multaggr.vars[0] != NULL);
19205 
19206  if( var->data.multaggr.scalars[0] > 0.0 )
19207  {
19208  SCIP_Real lb;
19209 
19210  lb = SCIPgetVarLbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19211 
19212  /* a > 0 -> get lower bound of y */
19213  if( SCIPisInfinity(scip, -lb) )
19214  return -SCIPinfinity(scip);
19215  else if( SCIPisInfinity(scip, lb) )
19216  return SCIPinfinity(scip);
19217  else
19218  return var->data.multaggr.scalars[0] * lb + var->data.multaggr.constant;
19219  }
19220  else if( var->data.multaggr.scalars[0] < 0.0 )
19221  {
19222  SCIP_Real ub;
19223 
19224  ub = SCIPgetVarUbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19225 
19226  /* a < 0 -> get upper bound of y */
19227  if( SCIPisInfinity(scip, -ub) )
19228  return SCIPinfinity(scip);
19229  else if( SCIPisInfinity(scip, ub) )
19230  return -SCIPinfinity(scip);
19231  else
19232  return var->data.multaggr.scalars[0] * ub + var->data.multaggr.constant;
19233  }
19234  else
19235  {
19236  SCIPerrorMessage("scalar is zero in multi-aggregation\n");
19237  SCIPABORT();
19238  return SCIP_INVALID; /*lint !e527*/
19239  }
19240  }
19241  SCIPerrorMessage("cannot get the bounds of a multi-aggregated variable.\n");
19242  SCIPABORT();
19243  return SCIP_INVALID; /*lint !e527*/
19244 
19245  case SCIP_VARSTATUS_NEGATED: /* x' = offset - x -> x = offset - x' */
19246  assert(var->negatedvar != NULL);
19248  assert(var->negatedvar->negatedvar == var);
19249  return var->data.negate.constant - SCIPgetVarUbAtIndex(scip, var->negatedvar, bdchgidx, after);
19250 
19251  case SCIP_VARSTATUS_COLUMN: /* for lint */
19252  case SCIP_VARSTATUS_LOOSE: /* for lint */
19253  default:
19254  SCIPerrorMessage("unknown variable status\n");
19255  SCIPABORT();
19256  return SCIP_INVALID; /*lint !e527*/
19257  }
19258 }
19259 
19260 /** returns upper bound of variable directly before or after the bound change given by the bound change index
19261  * was applied
19262  */
19264  SCIP* scip, /**< SCIP data structure */
19265  SCIP_VAR* var, /**< problem variable */
19266  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19267  SCIP_Bool after /**< should the bound change with given index be included? */
19268  )
19269 {
19270  SCIP_VARSTATUS varstatus;
19271  assert(var != NULL);
19272 
19273  varstatus = SCIPvarGetStatus(var);
19274 
19275  if( varstatus == SCIP_VARSTATUS_COLUMN || varstatus == SCIP_VARSTATUS_LOOSE )
19276  {
19277  if( bdchgidx == NULL )
19278  return SCIPvarGetUbLocal(var);
19279  else
19280  {
19281  SCIP_BDCHGINFO* bdchginfo;
19282 
19283  bdchginfo = SCIPvarGetUbchgInfo(var, bdchgidx, after);
19284  if( bdchginfo != NULL )
19285  return SCIPbdchginfoGetNewbound(bdchginfo);
19286  else
19287  return var->glbdom.ub;
19288  }
19289  }
19290 
19291  /* get bounds of attached variables */
19292  switch( varstatus )
19293  {
19295  assert(var->data.original.transvar != NULL);
19296  return SCIPgetVarUbAtIndex(scip, var->data.original.transvar, bdchgidx, after);
19297 
19298  case SCIP_VARSTATUS_FIXED:
19299  return var->glbdom.ub;
19300 
19301  case SCIP_VARSTATUS_AGGREGATED: /* x = a*y + c -> y = (x-c)/a */
19302  assert(var->data.aggregate.var != NULL);
19303  if( var->data.aggregate.scalar > 0.0 )
19304  {
19305  SCIP_Real ub;
19306 
19307  ub = SCIPgetVarUbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19308 
19309  /* a > 0 -> get lower bound of y */
19310  if( SCIPisInfinity(scip, -ub) )
19311  return -SCIPinfinity(scip);
19312  else if( SCIPisInfinity(scip, ub) )
19313  return SCIPinfinity(scip);
19314  else
19315  return var->data.aggregate.scalar * ub + var->data.aggregate.constant;
19316  }
19317  else if( var->data.aggregate.scalar < 0.0 )
19318  {
19319  SCIP_Real lb;
19320 
19321  lb = SCIPgetVarLbAtIndex(scip, var->data.aggregate.var, bdchgidx, after);
19322 
19323  /* a < 0 -> get upper bound of y */
19324  if ( SCIPisInfinity(scip, -lb) )
19325  return SCIPinfinity(scip);
19326  else if ( SCIPisInfinity(scip, lb) )
19327  return -SCIPinfinity(scip);
19328  else
19329  return var->data.aggregate.scalar * lb + var->data.aggregate.constant;
19330  }
19331  else
19332  {
19333  SCIPerrorMessage("scalar is zero in aggregation\n");
19334  SCIPABORT();
19335  return SCIP_INVALID; /*lint !e527*/
19336  }
19337 
19339  /* handle multi-aggregated variables depending on one variable only (possibly caused by SCIPvarFlattenAggregationGraph()) */
19340  if ( var->data.multaggr.nvars == 1 )
19341  {
19342  assert(var->data.multaggr.vars != NULL);
19343  assert(var->data.multaggr.scalars != NULL);
19344  assert(var->data.multaggr.vars[0] != NULL);
19345 
19346  if( var->data.multaggr.scalars[0] > 0.0 )
19347  {
19348  SCIP_Real ub;
19349 
19350  ub = SCIPgetVarUbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19351 
19352  /* a > 0 -> get lower bound of y */
19353  if ( SCIPisInfinity(scip, -ub) )
19354  return -SCIPinfinity(scip);
19355  else if ( SCIPisInfinity(scip, ub) )
19356  return SCIPinfinity(scip);
19357  else
19358  return var->data.multaggr.scalars[0] * ub + var->data.multaggr.constant;
19359  }
19360  else if( var->data.multaggr.scalars[0] < 0.0 )
19361  {
19362  SCIP_Real lb;
19363 
19364  lb = SCIPgetVarLbAtIndex(scip, var->data.multaggr.vars[0], bdchgidx, after);
19365 
19366  /* a < 0 -> get upper bound of y */
19367  if ( SCIPisInfinity(scip, -lb) )
19368  return SCIPinfinity(scip);
19369  else if ( SCIPisInfinity(scip, lb) )
19370  return -SCIPinfinity(scip);
19371  else
19372  return var->data.multaggr.scalars[0] * lb + var->data.multaggr.constant;
19373  }
19374  else
19375  {
19376  SCIPerrorMessage("scalar is zero in multi-aggregation\n");
19377  SCIPABORT();
19378  return SCIP_INVALID; /*lint !e527*/
19379  }
19380  }
19381  SCIPerrorMessage("cannot get the bounds of a multiple aggregated variable.\n");
19382  SCIPABORT();
19383  return SCIP_INVALID; /*lint !e527*/
19384 
19385  case SCIP_VARSTATUS_NEGATED: /* x' = offset - x -> x = offset - x' */
19386  assert(var->negatedvar != NULL);
19388  assert(var->negatedvar->negatedvar == var);
19389  return var->data.negate.constant - SCIPgetVarLbAtIndex(scip, var->negatedvar, bdchgidx, after);
19390 
19391  case SCIP_VARSTATUS_COLUMN: /* for lint */
19392  case SCIP_VARSTATUS_LOOSE: /* for lint */
19393  default:
19394  SCIPerrorMessage("unknown variable status\n");
19395  SCIPABORT();
19396  return SCIP_INVALID; /*lint !e527*/
19397  }
19398 }
19399 
19400 /** returns lower or upper bound of variable directly before or after the bound change given by the bound change index
19401  * was applied
19402  */
19404  SCIP* scip, /**< SCIP data structure */
19405  SCIP_VAR* var, /**< problem variable */
19406  SCIP_BOUNDTYPE boundtype, /**< type of bound: lower or upper bound */
19407  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19408  SCIP_Bool after /**< should the bound change with given index be included? */
19409  )
19410 {
19411  if( boundtype == SCIP_BOUNDTYPE_LOWER )
19412  return SCIPgetVarLbAtIndex(scip, var, bdchgidx, after);
19413  else
19414  {
19415  assert(boundtype == SCIP_BOUNDTYPE_UPPER);
19416  return SCIPgetVarUbAtIndex(scip, var, bdchgidx, after);
19417  }
19418 }
19419 
19420 /** returns whether the binary variable was fixed at the time given by the bound change index */
19422  SCIP* scip, /**< SCIP data structure */
19423  SCIP_VAR* var, /**< problem variable */
19424  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node */
19425  SCIP_Bool after /**< should the bound change with given index be included? */
19426  )
19427 {
19428  assert(var != NULL);
19429  assert(SCIPvarIsBinary(var));
19430 
19431  /* check the current bounds first in order to decide at which bound change information we have to look
19432  * (which is expensive because we have to follow the aggregation tree to the active variable)
19433  */
19434  return ((SCIPvarGetLbLocal(var) > 0.5 && SCIPgetVarLbAtIndex(scip, var, bdchgidx, after) > 0.5)
19435  || (SCIPvarGetUbLocal(var) < 0.5 && SCIPgetVarUbAtIndex(scip, var, bdchgidx, after) < 0.5));
19436 }
19437 
19438 /** gets solution value for variable in current node
19439  *
19440  * @return solution value for variable in current node
19441  *
19442  * @pre This method can be called if @p scip is in one of the following stages:
19443  * - \ref SCIP_STAGE_PRESOLVED
19444  * - \ref SCIP_STAGE_SOLVING
19445  */
19447  SCIP* scip, /**< SCIP data structure */
19448  SCIP_VAR* var /**< variable to get solution value for */
19449  )
19450 {
19451  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19452  assert( var->scip == scip );
19453 
19454  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
19455 }
19456 
19457 /** gets solution values of multiple variables in current node
19458  *
19459  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19460  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19461  *
19462  * @pre This method can be called if @p scip is in one of the following stages:
19463  * - \ref SCIP_STAGE_PRESOLVED
19464  * - \ref SCIP_STAGE_SOLVING
19465  */
19467  SCIP* scip, /**< SCIP data structure */
19468  int nvars, /**< number of variables to get solution value for */
19469  SCIP_VAR** vars, /**< array with variables to get value for */
19470  SCIP_Real* vals /**< array to store solution values of variables */
19471  )
19472 {
19473  int v;
19474 
19475  assert(nvars == 0 || vars != NULL);
19476  assert(nvars == 0 || vals != NULL);
19477 
19478  SCIP_CALL( checkStage(scip, "SCIPgetVarSols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19479 
19480  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
19481  {
19482  for( v = 0; v < nvars; ++v )
19483  vals[v] = SCIPvarGetLPSol(vars[v]);
19484  }
19485  else
19486  {
19487  for( v = 0; v < nvars; ++v )
19488  vals[v] = SCIPvarGetPseudoSol(vars[v]);
19489  }
19490 
19491  return SCIP_OKAY;
19492 }
19493 
19494 /** sets the solution value of all variables in the global relaxation solution to zero
19495  *
19496  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19497  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19498  *
19499  * @pre This method can be called if @p scip is in one of the following stages:
19500  * - \ref SCIP_STAGE_PRESOLVED
19501  * - \ref SCIP_STAGE_SOLVING
19502  */
19504  SCIP* scip /**< SCIP data structure */
19505  )
19506 {
19507  SCIP_VAR** vars;
19508  int nvars;
19509  int v;
19510 
19511  assert(scip != NULL);
19512 
19513  SCIP_CALL( checkStage(scip, "SCIPclearRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19514 
19515  /* the relaxation solution is already cleared */
19516  if( SCIPrelaxationIsSolZero(scip->relaxation) )
19517  return SCIP_OKAY;
19518 
19519  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
19520 
19521  for( v = 0; v < nvars; v++ )
19522  {
19523  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, 0.0, FALSE) );
19524  }
19525 
19526  SCIPrelaxationSetSolObj(scip->relaxation, 0.0);
19528 
19529  return SCIP_OKAY;
19530 }
19531 
19532 /** sets the value of the given variable in the global relaxation solution;
19533  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
19534  * You can use SCIPclearRelaxSolVals() to set all values to zero, initially;
19535  * after setting all solution values, you have to call SCIPmarkRelaxSolValid()
19536  * to inform SCIP that the stored solution is valid
19537  *
19538  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19539  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19540  *
19541  * @pre This method can be called if @p scip is in one of the following stages:
19542  * - \ref SCIP_STAGE_PRESOLVED
19543  * - \ref SCIP_STAGE_SOLVING
19544  */
19546  SCIP* scip, /**< SCIP data structure */
19547  SCIP_VAR* var, /**< variable to set value for */
19548  SCIP_Real val /**< solution value of variable */
19549  )
19550 {
19551  assert(scip != NULL);
19552 
19553  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19554 
19555  SCIP_CALL( SCIPvarSetRelaxSol(var, scip->set, scip->relaxation, val, TRUE) );
19556 
19557  if( val != 0.0 )
19560 
19561  return SCIP_OKAY;
19562 }
19563 
19564 /** sets the values of the given variables in the global relaxation solution;
19565  * this solution can be filled by the relaxation handlers and can be used by heuristics and for separation;
19566  * the solution is automatically cleared, s.t. all other variables get value 0.0
19567  *
19568  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19569  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19570  *
19571  * @pre This method can be called if @p scip is in one of the following stages:
19572  * - \ref SCIP_STAGE_PRESOLVED
19573  * - \ref SCIP_STAGE_SOLVING
19574  */
19576  SCIP* scip, /**< SCIP data structure */
19577  int nvars, /**< number of variables to set relaxation solution value for */
19578  SCIP_VAR** vars, /**< array with variables to set value for */
19579  SCIP_Real* vals /**< array with solution values of variables */
19580  )
19581 {
19582  int v;
19583 
19584  assert(scip != NULL);
19585  assert(nvars == 0 || vars != NULL);
19586  assert(nvars == 0 || vals != NULL);
19587 
19588  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19589 
19591 
19592  for( v = 0; v < nvars; v++ )
19593  {
19594  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], TRUE) );
19595  }
19596 
19599 
19600  return SCIP_OKAY;
19601 }
19602 
19603 /** sets the values of the variables in the global relaxation solution to the values
19604  * in the given primal solution; the relaxation solution can be filled by the relaxation hanlders
19605  * and might be used by heuristics and for separation
19606  *
19607  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19608  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19609  *
19610  * @pre This method can be called if @p scip is in one of the following stages:
19611  * - \ref SCIP_STAGE_PRESOLVED
19612  * - \ref SCIP_STAGE_SOLVING
19613  */
19615  SCIP* scip, /**< SCIP data structure */
19616  SCIP_SOL* sol /**< primal relaxation solution */
19617  )
19618 {
19619  SCIP_VAR** vars;
19620  SCIP_Real* vals;
19621  int nvars;
19622  int v;
19623 
19624  assert(scip != NULL);
19625 
19626  SCIP_CALL( checkStage(scip, "SCIPsetRelaxSolValsSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19627 
19628  SCIP_CALL( SCIPgetVarsData(scip, &vars, &nvars, NULL, NULL, NULL, NULL) );
19629 
19630  /* alloc buffer array for solution values of the variables and get the values */
19631  SCIP_CALL( SCIPallocBufferArray(scip, &vals, nvars) );
19632  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, vars, vals) );
19633 
19635 
19636  for( v = 0; v < nvars; v++ )
19637  {
19638  SCIP_CALL( SCIPvarSetRelaxSol(vars[v], scip->set, scip->relaxation, vals[v], FALSE) );
19639  }
19640 
19641  SCIPrelaxationSetSolObj(scip->relaxation, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
19642 
19645 
19646  SCIPfreeBufferArray(scip, &vals);
19647 
19648  return SCIP_OKAY;
19649 }
19650 
19651 /** returns whether the relaxation solution is valid
19652  *
19653  * @return TRUE, if the relaxation solution is valid; FALSE, otherwise
19654  *
19655  * @pre This method can be called if @p scip is in one of the following stages:
19656  * - \ref SCIP_STAGE_PRESOLVED
19657  * - \ref SCIP_STAGE_SOLVING
19658  */
19660  SCIP* scip /**< SCIP data structure */
19661  )
19662 {
19663  assert(scip != NULL);
19664 
19665  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19666 
19667  return SCIPrelaxationIsSolValid(scip->relaxation);
19668 }
19669 
19670 /** informs SCIP, that the relaxation solution is valid
19671  *
19672  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19673  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19674  *
19675  * @pre This method can be called if @p scip is in one of the following stages:
19676  * - \ref SCIP_STAGE_PRESOLVED
19677  * - \ref SCIP_STAGE_SOLVING
19678  */
19680  SCIP* scip /**< SCIP data structure */
19681  )
19682 {
19683  assert(scip != NULL);
19684 
19685  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolValid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19686 
19688 
19689  return SCIP_OKAY;
19690 }
19691 
19692 /** informs SCIP, that the relaxation solution is invalid
19693  *
19694  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19695  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19696  *
19697  * @pre This method can be called if @p scip is in one of the following stages:
19698  * - \ref SCIP_STAGE_PRESOLVED
19699  * - \ref SCIP_STAGE_SOLVING
19700  */
19702  SCIP* scip /**< SCIP data structure */
19703  )
19704 {
19705  assert(scip != NULL);
19706 
19707  SCIP_CALL( checkStage(scip, "SCIPmarkRelaxSolInvalid", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19708 
19710 
19711  return SCIP_OKAY;
19712 }
19713 
19714 /** gets the relaxation solution value of the given variable
19715  *
19716  * @return the relaxation solution value of the given variable
19717  *
19718  * @pre This method can be called if @p scip is in one of the following stages:
19719  * - \ref SCIP_STAGE_PRESOLVED
19720  * - \ref SCIP_STAGE_SOLVING
19721  */
19723  SCIP* scip, /**< SCIP data structure */
19724  SCIP_VAR* var /**< variable to get value for */
19725  )
19726 {
19727  assert(scip != NULL);
19728  assert(var != NULL);
19729  assert(var->scip == scip);
19730 
19731  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19732 
19733  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
19734  {
19735  SCIPerrorMessage("Relaxation Solution is not valid!\n");
19736  SCIPABORT();
19737  return SCIP_INVALID; /*lint !e527*/
19738  }
19739 
19740  return SCIPvarGetRelaxSol(var, scip->set);
19741 }
19742 
19743 /** gets the relaxation solution objective value
19744  *
19745  * @return the objective value of the relaxation solution
19746  *
19747  * @pre This method can be called if @p scip is in one of the following stages:
19748  * - \ref SCIP_STAGE_PRESOLVED
19749  * - \ref SCIP_STAGE_SOLVING
19750  */
19752  SCIP* scip /**< SCIP data structure */
19753  )
19754 {
19755  assert(scip != NULL);
19756 
19757  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19758 
19759  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
19760  {
19761  SCIPerrorMessage("Relaxation Solution is not valid!\n");
19762  SCIPABORT();
19763  return SCIP_INVALID; /*lint !e527*/
19764  }
19765 
19766  return SCIPrelaxationGetSolObj(scip->relaxation);
19767 }
19768 
19769 /** start strong branching - call before any strong branching
19770  *
19771  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19772  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19773  *
19774  * @pre This method can be called if @p scip is in one of the following stages:
19775  * - \ref SCIP_STAGE_PRESOLVED
19776  * - \ref SCIP_STAGE_SOLVING
19777  *
19778  * @note if propagation is enabled, strong branching is not done directly on the LP, but probing nodes are created
19779  * which allow to perform propagation but also creates some overhead
19780  */
19782  SCIP* scip, /**< SCIP data structure */
19783  SCIP_Bool enablepropagation /**< should propagation be done before solving the strong branching LP? */
19784  )
19785 {
19786  assert( scip != NULL );
19787  SCIP_CALL( checkStage(scip, "SCIPstartStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19788 
19789  assert(!SCIPinProbing(scip));
19790 
19791  SCIPdebugMsg(scip, "starting strong branching mode%s: lpcount=%" SCIP_LONGINT_FORMAT "\n", enablepropagation ? " with propagation" : "", scip->stat->lpcount - scip->stat->nsbdivinglps);
19792 
19793  /* start probing mode to allow propagation before solving the strong branching LPs; if no propagation should be done,
19794  * start the strong branching mode in the LP interface
19795  */
19796  if( enablepropagation )
19797  {
19798  if( SCIPtreeProbing(scip->tree) )
19799  {
19800  SCIPerrorMessage("cannot start strong branching with propagation while in probing mode\n");
19801  return SCIP_INVALIDCALL;
19802  }
19803 
19804  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
19805  {
19806  SCIPerrorMessage("cannot start strong branching with propagation while in diving mode\n");
19807  return SCIP_INVALIDCALL;
19808  }
19809 
19810  /* other then in SCIPstartProbing(), we do not disable collecting variable statistics during strong branching;
19811  * we cannot disable it, because the pseudo costs would not be updated, otherwise,
19812  * and reliability branching would end up doing strong branching all the time
19813  */
19814  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, TRUE) );
19815 
19816  /* inform the LP that the current probing mode is used for strong branching */
19818 
19819  }
19820  else
19821  {
19823  }
19824 
19825  /* reset local strong branching info */
19827 
19828  return SCIP_OKAY;
19829 }
19830 
19831 /** end strong branching - call after any strong branching
19832  *
19833  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
19834  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
19835  *
19836  * @pre This method can be called if @p scip is in one of the following stages:
19837  * - \ref SCIP_STAGE_PRESOLVED
19838  * - \ref SCIP_STAGE_SOLVING
19839  */
19841  SCIP* scip /**< SCIP data structure */
19842  )
19843 {
19844  assert( scip != NULL );
19845 
19846  SCIP_CALL( checkStage(scip, "SCIPendStrongbranch", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
19847 
19848  /* depending on whether the strong branching mode was started with propagation enabled or not, we end the strong
19849  * branching probing mode or the LP strong branching mode
19850  */
19851  if( SCIPtreeProbing(scip->tree) )
19852  {
19853  SCIP_NODE* node;
19854  SCIP_DOMCHG* domchg;
19855  SCIP_VAR** boundchgvars;
19856  SCIP_Real* bounds;
19857  SCIP_BOUNDTYPE* boundtypes;
19858  int nboundchgs;
19859  int nbnds;
19860  int i;
19861 
19862  /* collect all bound changes deducted during probing, which were applied at the probing root and apply them to the
19863  * focusnode
19864  */
19865  node = SCIPgetCurrentNode(scip);
19866  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
19867  assert(SCIPgetProbingDepth(scip) == 0);
19868 
19869  domchg = SCIPnodeGetDomchg(node);
19870  nboundchgs = SCIPdomchgGetNBoundchgs(domchg);
19871 
19872  SCIP_CALL( SCIPallocBufferArray(scip, &boundchgvars, nboundchgs) );
19873  SCIP_CALL( SCIPallocBufferArray(scip, &bounds, nboundchgs) );
19874  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, nboundchgs) );
19875 
19876  for( i = 0, nbnds = 0; i < nboundchgs; ++i )
19877  {
19878  SCIP_BOUNDCHG* boundchg;
19879 
19880  boundchg = SCIPdomchgGetBoundchg(domchg, i);
19881 
19882  /* ignore redundant bound changes */
19883  if( SCIPboundchgIsRedundant(boundchg) )
19884  continue;
19885 
19886  boundchgvars[nbnds] = SCIPboundchgGetVar(boundchg);
19887  bounds[nbnds] = SCIPboundchgGetNewbound(boundchg);
19888  boundtypes[nbnds] = SCIPboundchgGetBoundtype(boundchg);
19889  ++nbnds;
19890  }
19891 
19892  SCIPdebugMsg(scip, "ending strong branching with probing: %d bound changes collected\n", nbnds);
19893 
19894  /* inform the LP that the probing mode is not used for strong branching anymore */
19896 
19897  SCIP_CALL( SCIPendProbing(scip) );
19898 
19899  /* apply the collected bound changes */
19900  for( i = 0; i < nbnds; ++i )
19901  {
19902  if( boundtypes[i] == SCIP_BOUNDTYPE_LOWER )
19903  {
19904  SCIPdebugMsg(scip, "apply probing lower bound change <%s> >= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
19905  SCIP_CALL( SCIPchgVarLb(scip, boundchgvars[i], bounds[i]) );
19906  }
19907  else
19908  {
19909  SCIPdebugMsg(scip, "apply probing upper bound change <%s> <= %.9g\n", SCIPvarGetName(boundchgvars[i]), bounds[i]);
19910  SCIP_CALL( SCIPchgVarUb(scip, boundchgvars[i], bounds[i]) );
19911  }
19912  }
19913 
19914  SCIPfreeBufferArray(scip, &boundtypes);
19915  SCIPfreeBufferArray(scip, &bounds);
19916  SCIPfreeBufferArray(scip, &boundchgvars);
19917  }
19918  else
19919  {
19920  SCIPdebugMsg(scip, "ending strong branching\n");
19921 
19923  }
19924 
19925  return SCIP_OKAY;
19926 }
19927 
19928 /** analyze the strong branching for the given variable; that includes conflict analysis for infeasible branches and
19929  * storing of root reduced cost information
19930  */
19931 static
19933  SCIP* scip, /**< SCIP data structure */
19934  SCIP_VAR* var, /**< variable to analyze */
19935  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
19936  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
19937  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
19938  * infeasible downwards branch, or NULL */
19939  SCIP_Bool* upconflict /**< pointer to store whether a conflict constraint was created for an
19940  * infeasible upwards branch, or NULL */
19941  )
19942 {
19943  SCIP_COL* col;
19944  SCIP_Bool downcutoff;
19945  SCIP_Bool upcutoff;
19946 
19947  col = SCIPvarGetCol(var);
19948  assert(col != NULL);
19949 
19950  downcutoff = col->sbdownvalid && SCIPsetIsGE(scip->set, col->sbdown, scip->lp->cutoffbound);
19951  upcutoff = col->sbupvalid && SCIPsetIsGE(scip->set, col->sbup, scip->lp->cutoffbound);
19952 
19953  if( downinf != NULL )
19954  *downinf = downcutoff;
19955  if( upinf != NULL )
19956  *upinf = upcutoff;
19957 
19958  /* analyze infeasible strong branching sub problems:
19959  * because the strong branching's bound change is necessary for infeasibility, it cannot be undone;
19960  * therefore, infeasible strong branchings on non-binary variables will not produce a valid conflict constraint
19961  */
19962  if( scip->set->conf_enable && scip->set->conf_usesb && scip->set->nconflicthdlrs > 0
19963  && SCIPvarIsBinary(var) && SCIPtreeGetCurrentDepth(scip->tree) > 0 )
19964  {
19965  if( (downcutoff && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5)
19966  || (upcutoff && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5) )
19967  {
19968  assert(downconflict != NULL);
19969  assert(upconflict != NULL);
19970  SCIP_CALL( SCIPconflictAnalyzeStrongbranch(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat,
19971  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, col, downconflict, upconflict) );
19972  }
19973  }
19974 
19975  /* the strong branching results can be used to strengthen the root reduced cost information which is used for example
19976  * to propagate against the cutoff bound
19977  *
19978  * @note Ignore the results if the LP solution of the down (up) branch LP is smaller which should not happened by
19979  * theory but can arise due to numerical issues.
19980  */
19981  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 && SCIPvarIsBinary(var) )
19982  {
19983  SCIP_Real lpobjval;
19984 
19985  assert(SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL);
19986 
19987  lpobjval = SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
19988 
19989  if( col->sbdownvalid && SCIPsetFeasCeil(scip->set, col->primsol-1.0) >= col->lb - 0.5 && lpobjval < col->sbdown )
19990  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetUbGlobal(var), -(col->sbdown - lpobjval), lpobjval);
19991  if( col->sbupvalid && SCIPsetFeasFloor(scip->set, col->primsol+1.0) <= col->ub + 0.5 && lpobjval < col->sbup )
19992  SCIPvarUpdateBestRootSol(var, scip->set, SCIPvarGetLbGlobal(var), col->sbup - lpobjval, lpobjval);
19993  }
19994 
19995  return SCIP_OKAY;
19996 }
19997 
19998 /** gets strong branching information on column variable with fractional value
19999  *
20000  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
20001  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
20002  * SCIPendStrongbranch(). Since this method does not apply domain propagation before strongbranching,
20003  * propagation should not be enabled in the SCIPstartStrongbranch() call.
20004  *
20005  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20006  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20007  *
20008  * @pre This method can be called if @p scip is in one of the following stages:
20009  * - \ref SCIP_STAGE_PRESOLVED
20010  * - \ref SCIP_STAGE_SOLVING
20011  */
20013  SCIP* scip, /**< SCIP data structure */
20014  SCIP_VAR* var, /**< variable to get strong branching values for */
20015  int itlim, /**< iteration limit for strong branchings */
20016  SCIP_Real* down, /**< stores dual bound after branching column down */
20017  SCIP_Real* up, /**< stores dual bound after branching column up */
20018  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
20019  * otherwise, it can only be used as an estimate value */
20020  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
20021  * otherwise, it can only be used as an estimate value */
20022  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20023  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20024  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20025  * infeasible downwards branch, or NULL */
20026  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
20027  * infeasible upwards branch, or NULL */
20028  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
20029  * solving process should be stopped (e.g., due to a time limit) */
20030  )
20031 {
20032  SCIP_COL* col;
20033 
20034  assert(scip != NULL);
20035  assert(var != NULL);
20036  assert(lperror != NULL);
20037  assert(!SCIPtreeProbing(scip->tree)); /* we should not be in strong branching with propagation mode */
20038  assert(var->scip == scip);
20039 
20040  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20041 
20042  if( downvalid != NULL )
20043  *downvalid = FALSE;
20044  if( upvalid != NULL )
20045  *upvalid = FALSE;
20046  if( downinf != NULL )
20047  *downinf = FALSE;
20048  if( upinf != NULL )
20049  *upinf = FALSE;
20050  if( downconflict != NULL )
20051  *downconflict = FALSE;
20052  if( upconflict != NULL )
20053  *upconflict = FALSE;
20054 
20056  {
20057  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20058  return SCIP_INVALIDDATA;
20059  }
20060 
20061  col = SCIPvarGetCol(var);
20062  assert(col != NULL);
20063 
20064  if( !SCIPcolIsInLP(col) )
20065  {
20066  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20067  return SCIP_INVALIDDATA;
20068  }
20069 
20070  /* check if the solving process should be aborted */
20071  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20072  {
20073  /* mark this as if the LP failed */
20074  *lperror = TRUE;
20075  return SCIP_OKAY;
20076  }
20077 
20078  /* call strong branching for column with fractional value */
20079  SCIP_CALL( SCIPcolGetStrongbranch(col, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
20080  down, up, downvalid, upvalid, lperror) );
20081 
20082  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
20083  * declare the sub nodes infeasible
20084  */
20085  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
20086  {
20087  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
20088  }
20089 
20090  return SCIP_OKAY;
20091 }
20092 
20093 /** create, solve, and evaluate a single strong branching child (for strong branching with propagation) */
20094 static
20096  SCIP* scip, /**< SCIP data structure */
20097  SCIP_VAR* var, /**< variable to get strong branching values for */
20098  SCIP_Bool down, /**< do we regard the down child? */
20099  SCIP_Bool firstchild, /**< is this the first of the two strong branching children? */
20100  SCIP_Bool propagate, /**< should domain propagation be performed? */
20101  SCIP_Real newbound, /**< new bound to apply at the strong branching child */
20102  int itlim, /**< iteration limit for strong branchings */
20103  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
20104  * settings) */
20105  SCIP_Real* value, /**< stores dual bound for strong branching child */
20106  SCIP_Bool* valid, /**< stores whether the returned value is a valid dual bound, or NULL;
20107  * otherwise, it can only be used as an estimate value */
20108  SCIP_Longint* ndomreductions, /**< pointer to store the number of domain reductions found, or NULL */
20109  SCIP_Bool* conflict, /**< pointer to store whether a conflict constraint was created for an
20110  * infeasible strong branching child, or NULL */
20111  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
20112  * solving process should be stopped (e.g., due to a time limit) */
20113  SCIP_VAR** vars, /**< active problem variables */
20114  int nvars, /**< number of active problem variables */
20115  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
20116  SCIP_Real* newubs, /**< array to store valid upper bounds for all active variables, or NULL */
20117  SCIP_Bool* foundsol, /**< pointer to store whether a primal solution was found during strong branching */
20118  SCIP_Bool* cutoff /**< pointer to store whether the strong branching child is infeasible */
20119  )
20120 {
20121  SCIP_Longint ndomreds;
20122 
20123  assert(value != NULL);
20124  assert(foundsol != NULL);
20125  assert(cutoff != NULL);
20126  assert(valid != NULL ? !(*valid) : TRUE);
20127 
20128  *foundsol = FALSE;
20129 
20130  /* check whether the strong branching child is already infeasible due to the bound change */
20131  if( down )
20132  {
20133  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
20134  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20135  * are valid for and were already applied at the probing root
20136  */
20137  if( newbound < SCIPvarGetLbLocal(var) - 0.5 )
20138  {
20139  *value = SCIPinfinity(scip);
20140 
20141  if( valid != NULL )
20142  *valid = TRUE;
20143 
20144  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20145  if( conflict != NULL )
20146  *conflict = TRUE;
20147 
20148  *cutoff = TRUE;
20149 
20150  return SCIP_OKAY;
20151  }
20152  }
20153  else
20154  {
20155  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
20156  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20157  * are valid for and were already applied at the probing root
20158  */
20159  if( newbound > SCIPvarGetUbLocal(var) + 0.5 )
20160  {
20161  *value = SCIPinfinity(scip);
20162 
20163  if( valid != NULL )
20164  *valid = TRUE;
20165 
20166  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20167  if( conflict != NULL )
20168  *conflict = TRUE;
20169 
20170  *cutoff = TRUE;
20171 
20172  return SCIP_OKAY;
20173  }
20174  }
20175 
20176  /* we need to ensure that we can create at least one new probing node without exceeding the maximal tree depth */
20178  {
20179  /* create a new probing node for the strong branching child and apply the new bound for the variable */
20180  SCIP_CALL( SCIPnewProbingNode(scip) );
20181 
20182  if( down )
20183  {
20184  assert(SCIPisGE(scip, newbound, SCIPvarGetLbLocal(var)));
20185  if( SCIPisLT(scip, newbound, SCIPvarGetUbLocal(var)) )
20186  {
20187  SCIP_CALL( SCIPchgVarUbProbing(scip, var, newbound) );
20188  }
20189  }
20190  else
20191  {
20192  assert(SCIPisLE(scip, newbound, SCIPvarGetUbLocal(var)));
20193  if( SCIPisGT(scip, newbound, SCIPvarGetLbLocal(var)) )
20194  {
20195  SCIP_CALL( SCIPchgVarLbProbing(scip, var, newbound) );
20196  }
20197  }
20198  }
20199  else
20200  {
20201  if( valid != NULL )
20202  *valid = FALSE;
20203 
20204  if( cutoff != NULL ) /*lint !e774*/
20205  *cutoff = FALSE;
20206 
20207  if( conflict != NULL )
20208  *conflict = FALSE;
20209 
20210  return SCIP_OKAY;
20211  }
20212 
20213  /* propagate domains at the probing node */
20214  if( propagate )
20215  {
20216  /* start time measuring */
20217  SCIPclockStart(scip->stat->strongpropclock, scip->set);
20218 
20219  ndomreds = 0;
20220  SCIP_CALL( SCIPpropagateProbing(scip, maxproprounds, cutoff, &ndomreds) );
20221 
20222  /* store number of domain reductions in strong branching */
20223  if( down )
20224  SCIPstatAdd(scip->stat, scip->set, nsbdowndomchgs, ndomreds);
20225  else
20226  SCIPstatAdd(scip->stat, scip->set, nsbupdomchgs, ndomreds);
20227 
20228  if( ndomreductions != NULL )
20229  *ndomreductions = ndomreds;
20230 
20231  /* stop time measuring */
20232  SCIPclockStop(scip->stat->strongpropclock, scip->set);
20233 
20234  if( *cutoff )
20235  {
20236  *value = SCIPinfinity(scip);
20237 
20238  if( valid != NULL )
20239  *valid = TRUE;
20240 
20241  SCIPdebugMsg(scip, "%s branch of var <%s> detected infeasible during propagation\n",
20242  down ? "down" : "up", SCIPvarGetName(var));
20243  }
20244  }
20245 
20246  /* if propagation did not already detect infeasibility, solve the probing LP */
20247  if( !(*cutoff) )
20248  {
20249  SCIP_CALL( SCIPsolveProbingLP(scip, itlim, lperror, cutoff) );
20250  assert(SCIPisLPRelax(scip));
20251 
20252  if( *cutoff )
20253  {
20254  assert(!(*lperror));
20255 
20256  *value = SCIPinfinity(scip);
20257 
20258  if( valid != NULL )
20259  *valid = TRUE;
20260 
20261  SCIPdebugMsg(scip, "%s branch of var <%s> detected infeasible in LP solving: status=%d\n",
20262  down ? "down" : "up", SCIPvarGetName(var), SCIPgetLPSolstat(scip));
20263  }
20264  else if( !(*lperror) )
20265  {
20266  /* save the lp solution status */
20267  scip->stat->lastsblpsolstats[down ? 0 : 1] = SCIPgetLPSolstat(scip);
20268 
20269  switch( SCIPgetLPSolstat(scip) )
20270  {
20272  {
20273  SCIP_Longint oldnbestsolsfound = scip->primal->nbestsolsfound;
20274  *value = SCIPgetLPObjval(scip);
20275  assert(SCIPisLT(scip, *value, SCIPgetCutoffbound(scip)));
20276 
20277  SCIPdebugMsg(scip, "probing LP solved to optimality, objective value: %16.9g\n", *value);
20278 
20279  if( valid != NULL )
20280  *valid = TRUE;
20281 
20282  /* check the strong branching LP solution for feasibility */
20283  if( scip->set->branch_checksbsol )
20284  {
20285  SCIP_SOL* sol;
20286  SCIP_Bool rounded = TRUE;
20287 
20288  /* start clock for strong branching solutions */
20289  SCIPclockStart(scip->stat->sbsoltime, scip->set);
20290 
20291  SCIP_CALL( SCIPcreateLPSol(scip, &sol, NULL) );
20292 
20293  /* try to round the strong branching solution */
20294  if( scip->set->branch_roundsbsol )
20295  {
20296  SCIP_CALL( SCIProundSol(scip, sol, &rounded) );
20297  }
20298 
20299  /* check the solution for feasibility if rounding worked well (or was not tried) */
20300  if( rounded )
20301  {
20302  SCIP_CALL( SCIPtrySolFree(scip, &sol, FALSE, FALSE, FALSE, TRUE, FALSE, foundsol) );
20303  }
20304  else
20305  {
20306  SCIP_CALL( SCIPfreeSol(scip, &sol) );
20307  }
20308 
20309  if( *foundsol )
20310  {
20311  SCIPdebugMsg(scip, "found new solution in strong branching\n");
20312 
20313  scip->stat->nsbsolsfound++;
20314 
20315  if( scip->primal->nbestsolsfound != oldnbestsolsfound )
20316  {
20317  scip->stat->nsbbestsolsfound++;
20318  }
20319 
20320  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
20321  *cutoff = TRUE;
20322  }
20323 
20324  /* stop clock for strong branching solutions */
20325  SCIPclockStop(scip->stat->sbsoltime, scip->set);
20326  }
20327 
20328  break;
20329  }
20331  ++scip->stat->nsbtimesiterlimhit;
20332  /*lint -fallthrough*/
20334  {
20335  /* use LP value as estimate */
20336  SCIP_LPI* lpi;
20337  SCIP_Real objval;
20338  SCIP_Real looseobjval;
20339 
20340  SCIPdebugMsg(scip, "probing LP hit %s limit\n", SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_ITERLIMIT ? "iteration" : "time");
20341 
20342  /* we access the LPI directly, because when a time limit was hit, we cannot access objective value and dual
20343  * feasibility using the SCIPlp... methods; we should try to avoid direct calls to the LPI, but this is rather
20344  * uncritical here, because we are immediately after the SCIPsolveProbingLP() call, because we access the LPI
20345  * read-only, and we check SCIPlpiWasSolved() first
20346  */
20347  SCIP_CALL( SCIPgetLPI(scip, &lpi) );
20348 
20349  if( SCIPlpiWasSolved(lpi) )
20350  {
20351  SCIP_CALL( SCIPlpiGetObjval(lpi, &objval) );
20352  looseobjval = SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
20353 
20354  /* the infinity value in the LPI should not be smaller than SCIP's infinity value */
20355  assert(!SCIPlpiIsInfinity(lpi, objval) || SCIPisInfinity(scip, objval));
20356 
20357  /* we use SCIP's infinity value here because a value larger than this is counted as infeasible by SCIP */
20358  if( SCIPisInfinity(scip, objval) )
20359  *value = SCIPinfinity(scip);
20360  else if( SCIPisInfinity(scip, -looseobjval) )
20361  *value = -SCIPinfinity(scip);
20362  else
20363  *value = objval + looseobjval;
20364 
20365  if( SCIPlpiIsDualFeasible(lpi) )
20366  {
20367  if( valid != NULL )
20368  *valid = TRUE;
20369 
20370  if( SCIPisGE(scip, *value, SCIPgetCutoffbound(scip)) )
20371  *cutoff = TRUE;
20372  }
20373  }
20374  break;
20375  }
20376  case SCIP_LPSOLSTAT_ERROR:
20378  *lperror = TRUE;
20379  break;
20380  case SCIP_LPSOLSTAT_NOTSOLVED: /* should only be the case for *cutoff = TRUE or *lperror = TRUE */
20381  case SCIP_LPSOLSTAT_OBJLIMIT: /* in this case, *cutoff should be TRUE and we should not get here */
20382  case SCIP_LPSOLSTAT_INFEASIBLE: /* in this case, *cutoff should be TRUE and we should not get here */
20383  default:
20384  SCIPerrorMessage("invalid LP solution status <%d>\n", SCIPgetLPSolstat(scip));
20385  return SCIP_INVALIDDATA;
20386  } /*lint !e788*/
20387  }
20388 
20389  /* If columns are missing in the LP, the cutoff flag may be wrong. Therefore, we need to set it and the valid pointer
20390  * to false here.
20391  */
20392  if( (*cutoff) && !SCIPallColsInLP(scip) )
20393  {
20394  *cutoff = FALSE;
20395  }
20396 
20397 #ifndef NDEBUG
20398  if( *lperror )
20399  {
20400  SCIPdebugMsg(scip, "error during strong branching probing LP solving: status=%d\n", SCIPgetLPSolstat(scip));
20401  }
20402 #endif
20403  }
20404 
20405 
20406  /* if the subproblem was feasible, we store the local bounds of the variables after propagation and (possibly)
20407  * conflict analysis
20408  * @todo do this after propagation? should be able to get valid bounds more often, but they might be weaker
20409  */
20410  if( !(*cutoff) && newlbs != NULL)
20411  {
20412  int v;
20413 
20414  assert(newubs != NULL);
20415 
20416  /* initialize the newlbs and newubs to the current local bounds */
20417  if( firstchild )
20418  {
20419  for( v = 0; v < nvars; ++v )
20420  {
20421  newlbs[v] = SCIPvarGetLbLocal(vars[v]);
20422  newubs[v] = SCIPvarGetUbLocal(vars[v]);
20423  }
20424  }
20425  /* update newlbs and newubs: take the weaker of the already stored bounds and the current local bounds */
20426  else
20427  {
20428  for( v = 0; v < nvars; ++v )
20429  {
20430  SCIP_Real lb = SCIPvarGetLbLocal(vars[v]);
20431  SCIP_Real ub = SCIPvarGetUbLocal(vars[v]);
20432 
20433  newlbs[v] = MIN(newlbs[v], lb);
20434  newubs[v] = MAX(newubs[v], ub);
20435  }
20436  }
20437  }
20438 
20439  /* revert all changes at the probing node */
20440  SCIP_CALL( SCIPbacktrackProbing(scip, 0) );
20441 
20442  return SCIP_OKAY;
20443 }
20444 
20445 /** gets strong branching information with previous domain propagation on column variable
20446  *
20447  * Before calling this method, the strong branching mode must have been activated by calling SCIPstartStrongbranch();
20448  * after strong branching was done for all candidate variables, the strong branching mode must be ended by
20449  * SCIPendStrongbranch(). Since this method applies domain propagation before strongbranching, propagation has to be be
20450  * enabled in the SCIPstartStrongbranch() call.
20451  *
20452  * Before solving the strong branching LP, domain propagation can be performed. The number of propagation rounds
20453  * can be specified by the parameter @p maxproprounds.
20454  *
20455  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20456  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20457  *
20458  * @pre This method can be called if @p scip is in one of the following stages:
20459  * - \ref SCIP_STAGE_PRESOLVED
20460  * - \ref SCIP_STAGE_SOLVING
20461  *
20462  * @warning When using this method, LP banching candidates and solution values must be copied beforehand, because
20463  * they are updated w.r.t. the strong branching LP solution.
20464  */
20466  SCIP* scip, /**< SCIP data structure */
20467  SCIP_VAR* var, /**< variable to get strong branching values for */
20468  SCIP_Real solval, /**< value of the variable in the current LP solution */
20469  SCIP_Real lpobjval, /**< LP objective value of the current LP solution */
20470  int itlim, /**< iteration limit for strong branchings */
20471  int maxproprounds, /**< maximum number of propagation rounds (-1: no limit, -2: parameter
20472  * settings) */
20473  SCIP_Real* down, /**< stores dual bound after branching column down */
20474  SCIP_Real* up, /**< stores dual bound after branching column up */
20475  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
20476  * otherwise, it can only be used as an estimate value */
20477  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
20478  * otherwise, it can only be used as an estimate value */
20479  SCIP_Longint* ndomredsdown, /**< pointer to store the number of domain reductions down, or NULL */
20480  SCIP_Longint* ndomredsup, /**< pointer to store the number of domain reductions up, or NULL */
20481  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20482  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20483  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20484  * infeasible downwards branch, or NULL */
20485  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
20486  * infeasible upwards branch, or NULL */
20487  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred or the
20488  * solving process should be stopped (e.g., due to a time limit) */
20489  SCIP_Real* newlbs, /**< array to store valid lower bounds for all active variables, or NULL */
20490  SCIP_Real* newubs /**< array to store valid upper bounds for all active variables, or NULL */
20491  )
20492 {
20493  SCIP_COL* col;
20494  SCIP_VAR** vars;
20495  SCIP_Longint oldniters;
20496  SCIP_Real newub;
20497  SCIP_Real newlb;
20498  SCIP_Bool propagate;
20499  SCIP_Bool cutoff;
20500  SCIP_Bool downchild;
20501  SCIP_Bool firstchild;
20502  SCIP_Bool foundsol;
20503  SCIP_Bool downvalidlocal;
20504  SCIP_Bool upvalidlocal;
20505  SCIP_Bool allcolsinlp;
20506  int oldnconflicts;
20507  int nvars;
20508 
20509  assert(scip != NULL);
20510  assert(var != NULL);
20511  assert(SCIPvarIsIntegral(var));
20512  assert(down != NULL);
20513  assert(up != NULL);
20514  assert(lperror != NULL);
20515  assert((newlbs != NULL) == (newubs != NULL));
20516  assert(SCIPinProbing(scip));
20517  assert(var->scip == scip);
20518 
20519  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchWithPropagation", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20520 
20521  /* check whether propagation should be performed */
20522  propagate = (maxproprounds != 0);
20523 
20524  /* Check, if all existing columns are in LP.
20525  * If this is not the case, we may still return that the up and down dual bounds are valid, because the branching
20526  * rule should not apply them otherwise.
20527  * However, we must not set the downinf or upinf pointers to TRUE based on the dual bound, because we cannot
20528  * guarantee that this node can be cut off.
20529  */
20530  allcolsinlp = SCIPallColsInLP(scip);
20531 
20532  /* if maxproprounds is -2, change it to 0, which for the following calls means using the parameter settings */
20533  if( maxproprounds == -2 )
20534  maxproprounds = 0;
20535 
20536  *down = lpobjval;
20537  *up = lpobjval;
20538  if( downvalid != NULL )
20539  *downvalid = FALSE;
20540  if( upvalid != NULL )
20541  *upvalid = FALSE;
20542  if( downinf != NULL )
20543  *downinf = FALSE;
20544  if( upinf != NULL )
20545  *upinf = FALSE;
20546  if( downconflict != NULL )
20547  *downconflict = FALSE;
20548  if( upconflict != NULL )
20549  *upconflict = FALSE;
20550  if( ndomredsdown != NULL )
20551  *ndomredsdown = 0;
20552  if( ndomredsup != NULL )
20553  *ndomredsup = 0;
20554 
20555  *lperror = FALSE;
20556 
20557  vars = SCIPgetVars(scip);
20558  nvars = SCIPgetNVars(scip);
20559 
20561 
20562  /* check if the solving process should be aborted */
20563  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20564  {
20565  /* mark this as if the LP failed */
20566  *lperror = TRUE;
20567  return SCIP_OKAY;
20568  }
20569 
20571  {
20572  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20573  return SCIP_INVALIDDATA;
20574  }
20575 
20576  col = SCIPvarGetCol(var);
20577  assert(col != NULL);
20578 
20579  if( !SCIPcolIsInLP(col) )
20580  {
20581  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20582  return SCIP_INVALIDDATA;
20583  }
20584 
20585  newlb = SCIPfeasFloor(scip, solval + 1.0);
20586  newub = SCIPfeasCeil(scip, solval - 1.0);
20587 
20588  SCIPdebugMsg(scip, "strong branching on var <%s>: solval=%g, lb=%g, ub=%g\n", SCIPvarGetName(var), solval,
20590 
20591  /* the up branch is infeasible due to the branching bound change; since this means that solval is not within the
20592  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20593  * are valid for and were already applied at the probing root
20594  */
20595  if( newlb > SCIPvarGetUbLocal(var) + 0.5 )
20596  {
20597  *up = SCIPinfinity(scip);
20598 
20599  if( upinf != NULL )
20600  *upinf = TRUE;
20601 
20602  if( upvalid != NULL )
20603  *upvalid = TRUE;
20604 
20605  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20606  if( upconflict != NULL )
20607  *upconflict = TRUE;
20608 
20609  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
20610  *down, *up, FALSE, TRUE, 0LL, INT_MAX);
20611 
20612  /* we do not regard the down branch; its valid pointer stays set to FALSE */
20613  return SCIP_OKAY;
20614  }
20615 
20616  /* the down branch is infeasible due to the branching bound change; since this means that solval is not within the
20617  * bounds, this should only happen if previous strong branching calls on other variables detected bound changes which
20618  * are valid for and were already applied at the probing root
20619  */
20620  if( newub < SCIPvarGetLbLocal(var) - 0.5 )
20621  {
20622  *down = SCIPinfinity(scip);
20623 
20624  if( downinf != NULL )
20625  *downinf = TRUE;
20626 
20627  if( downvalid != NULL )
20628  *downvalid = TRUE;
20629 
20630  /* bound changes are applied in SCIPendStrongbranch(), which can be seen as a conflict constraint */
20631  if( downconflict != NULL )
20632  *downconflict = TRUE;
20633 
20634  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
20635  *down, *up, TRUE, FALSE, 0LL, INT_MAX);
20636 
20637  /* we do not regard the up branch; its valid pointer stays set to FALSE */
20638  return SCIP_OKAY;
20639  }
20640 
20641  /* We now do strong branching by creating the two potential child nodes as probing nodes and solving them one after
20642  * the other. We will stop when the first child is detected infeasible, saving the effort we would need for the
20643  * second child. Since empirically, the up child tends to be infeasible more often, we do strongbranching first on
20644  * the up branch.
20645  */
20646  oldniters = scip->stat->nsbdivinglpiterations;
20647  firstchild = TRUE;
20648  cutoff = FALSE;
20649 
20650  /* @todo: decide the branch to look at first based on the cutoffs in previous calls? */
20651  switch( scip->set->branch_firstsbchild )
20652  {
20653  case 'u':
20654  downchild = FALSE;
20655  break;
20656  case 'd':
20657  downchild = TRUE;
20658  break;
20659  case 'a':
20660  downchild = SCIPvarGetNLocksDown(var) > SCIPvarGetNLocksUp(var);
20661  break;
20662  case 'h':
20664  break;
20665  default:
20666  SCIPerrorMessage("Error: Unknown parameter value <%c> for branching/firstsbchild parameter:\n",scip->set->branch_firstsbchild);
20667  SCIPABORT();
20668  return SCIP_PARAMETERWRONGVAL; /*lint !e527*/
20669  }
20670 
20671  downvalidlocal = FALSE;
20672  upvalidlocal = FALSE;
20673 
20674  do
20675  {
20676  oldnconflicts = SCIPconflictGetNConflicts(scip->conflict);
20677 
20678  if( downchild )
20679  {
20680  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newub, itlim, maxproprounds,
20681  down, &downvalidlocal, ndomredsdown, downconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
20682 
20683  /* check whether a new solutions rendered the previous child infeasible */
20684  if( foundsol && !firstchild && allcolsinlp )
20685  {
20686  if( SCIPisGE(scip, *up, SCIPgetCutoffbound(scip)) )
20687  {
20688  if( upinf != NULL )
20689  *upinf = TRUE;
20690  }
20691  }
20692 
20693  /* check for infeasibility */
20694  if( cutoff )
20695  {
20696  if( downinf != NULL )
20697  *downinf = TRUE;
20698 
20699  if( downconflict != NULL &&
20700  (SCIPvarGetLbLocal(var) > newub + 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
20701  {
20702  *downconflict = TRUE;
20703  }
20704 
20705  if( !scip->set->branch_forceall )
20706  {
20707  /* if this is the first call, we do not regard the up branch, its valid pointer is initially set to FALSE */
20708  break;
20709  }
20710  }
20711  }
20712  else
20713  {
20714  SCIP_CALL( performStrongbranchWithPropagation(scip, var, downchild, firstchild, propagate, newlb, itlim, maxproprounds,
20715  up, &upvalidlocal, ndomredsup, upconflict, lperror, vars, nvars, newlbs, newubs, &foundsol, &cutoff) );
20716 
20717  /* check whether a new solutions rendered the previous child infeasible */
20718  if( foundsol && !firstchild && allcolsinlp )
20719  {
20720  if( SCIPisGE(scip, *down, SCIPgetCutoffbound(scip)) )
20721  {
20722  if( downinf != NULL )
20723  *downinf = TRUE;
20724  }
20725  }
20726 
20727  /* check for infeasibility */
20728  if( cutoff )
20729  {
20730  if( upinf != NULL )
20731  *upinf = TRUE;
20732 
20733  assert(upinf == NULL || (*upinf) == TRUE);
20734 
20735  if( upconflict != NULL &&
20736  (SCIPvarGetUbLocal(var) < newlb - 0.5 || SCIPconflictGetNConflicts(scip->conflict) > oldnconflicts) )
20737  {
20738  *upconflict = TRUE;
20739  }
20740 
20741  if( !scip->set->branch_forceall )
20742  {
20743  /* if this is the first call, we do not regard the down branch, its valid pointer is initially set to FALSE */
20744  break;
20745  }
20746  }
20747  }
20748 
20749  downchild = !downchild;
20750  firstchild = !firstchild;
20751  }
20752  while( !firstchild );
20753 
20754 
20755  /* set strong branching information in column */
20756  if( *lperror )
20757  {
20758  SCIPcolInvalidateStrongbranchData(col, scip->set, scip->stat, scip->lp);
20759  }
20760  else
20761  {
20762  SCIPcolSetStrongbranchData(col, scip->set, scip->stat, scip->lp, lpobjval, solval,
20763  *down, *up, downvalidlocal, upvalidlocal, scip->stat->nsbdivinglpiterations - oldniters, itlim);
20764  }
20765 
20766  if( downvalid != NULL )
20767  *downvalid = downvalidlocal;
20768  if( upvalid != NULL )
20769  *upvalid = upvalidlocal;
20770 
20771  return SCIP_OKAY;
20772 }
20773 
20774 /** gets strong branching information on column variable x with integral LP solution value (val); that is, the down branch
20775  * is (val -1.0) and the up brach ins (val +1.0)
20776  *
20777  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20778  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20779  *
20780  * @pre This method can be called if @p scip is in one of the following stages:
20781  * - \ref SCIP_STAGE_PRESOLVED
20782  * - \ref SCIP_STAGE_SOLVING
20783  *
20784  * @note If the integral LP solution value is the lower or upper bound of the variable, the corresponding branch will be
20785  * marked as infeasible. That is, the valid pointer and the infeasible pointer are set to TRUE.
20786  */
20788  SCIP* scip, /**< SCIP data structure */
20789  SCIP_VAR* var, /**< variable to get strong branching values for */
20790  int itlim, /**< iteration limit for strong branchings */
20791  SCIP_Real* down, /**< stores dual bound after branching column down */
20792  SCIP_Real* up, /**< stores dual bound after branching column up */
20793  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
20794  * otherwise, it can only be used as an estimate value */
20795  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
20796  * otherwise, it can only be used as an estimate value */
20797  SCIP_Bool* downinf, /**< pointer to store whether the downwards branch is infeasible, or NULL */
20798  SCIP_Bool* upinf, /**< pointer to store whether the upwards branch is infeasible, or NULL */
20799  SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
20800  * infeasible downwards branch, or NULL */
20801  SCIP_Bool* upconflict, /**< pointer to store whether a conflict constraint was created for an
20802  * infeasible upwards branch, or NULL */
20803  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
20804  * solving process should be stopped (e.g., due to a time limit) */
20805  )
20806 {
20807  SCIP_COL* col;
20808 
20809  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20810 
20811  assert(lperror != NULL);
20812  assert(var->scip == scip);
20813 
20814  if( downvalid != NULL )
20815  *downvalid = FALSE;
20816  if( upvalid != NULL )
20817  *upvalid = FALSE;
20818  if( downinf != NULL )
20819  *downinf = FALSE;
20820  if( upinf != NULL )
20821  *upinf = FALSE;
20822  if( downconflict != NULL )
20823  *downconflict = FALSE;
20824  if( upconflict != NULL )
20825  *upconflict = FALSE;
20826 
20828  {
20829  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20830  return SCIP_INVALIDDATA;
20831  }
20832 
20833  col = SCIPvarGetCol(var);
20834  assert(col != NULL);
20835 
20836  if( !SCIPcolIsInLP(col) )
20837  {
20838  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20839  return SCIP_INVALIDDATA;
20840  }
20841 
20842  /* check if the solving process should be aborted */
20843  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20844  {
20845  /* mark this as if the LP failed */
20846  *lperror = TRUE;
20847  return SCIP_OKAY;
20848  }
20849 
20850  /* call strong branching for column */
20851  SCIP_CALL( SCIPcolGetStrongbranch(col, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
20852  down, up, downvalid, upvalid, lperror) );
20853 
20854  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
20855  * declare the sub nodes infeasible
20856  */
20857  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
20858  {
20859  SCIP_CALL( analyzeStrongbranch(scip, var, downinf, upinf, downconflict, upconflict) );
20860  }
20861 
20862  return SCIP_OKAY;
20863 }
20864 
20865 /** gets strong branching information on column variables with fractional values
20866  *
20867  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20868  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20869  *
20870  * @pre This method can be called if @p scip is in one of the following stages:
20871  * - \ref SCIP_STAGE_PRESOLVED
20872  * - \ref SCIP_STAGE_SOLVING
20873  */
20875  SCIP* scip, /**< SCIP data structure */
20876  SCIP_VAR** vars, /**< variables to get strong branching values for */
20877  int nvars, /**< number of variables */
20878  int itlim, /**< iteration limit for strong branchings */
20879  SCIP_Real* down, /**< stores dual bounds after branching variables down */
20880  SCIP_Real* up, /**< stores dual bounds after branching variables up */
20881  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
20882  * otherwise, they can only be used as an estimate value */
20883  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
20884  * otherwise, they can only be used as an estimate value */
20885  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
20886  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
20887  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
20888  * infeasible downward branches, or NULL */
20889  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
20890  * infeasible upward branches, or NULL */
20891  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
20892  * solving process should be stopped (e.g., due to a time limit) */
20893  )
20894 {
20895  SCIP_COL** cols;
20896  int j;
20897 
20898  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesFrac", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
20899 
20900  assert( lperror != NULL );
20901  assert( vars != NULL );
20902 
20903  /* set up data */
20904  cols = NULL;
20905  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
20906  assert(cols != NULL);
20907  for( j = 0; j < nvars; ++j )
20908  {
20909  SCIP_VAR* var;
20910  SCIP_COL* col;
20911 
20912  if( downvalid != NULL )
20913  downvalid[j] = FALSE;
20914  if( upvalid != NULL )
20915  upvalid[j] = FALSE;
20916  if( downinf != NULL )
20917  downinf[j] = FALSE;
20918  if( upinf != NULL )
20919  upinf[j] = FALSE;
20920  if( downconflict != NULL )
20921  downconflict[j] = FALSE;
20922  if( upconflict != NULL )
20923  upconflict[j] = FALSE;
20924 
20925  var = vars[j];
20926  assert( var != NULL );
20928  {
20929  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
20930  SCIPfreeBufferArray(scip, &cols);
20931  return SCIP_INVALIDDATA;
20932  }
20933 
20934  col = SCIPvarGetCol(var);
20935  assert(col != NULL);
20936  cols[j] = col;
20937 
20938  if( !SCIPcolIsInLP(col) )
20939  {
20940  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
20941  SCIPfreeBufferArray(scip, &cols);
20942  return SCIP_INVALIDDATA;
20943  }
20944  }
20945 
20946  /* check if the solving process should be aborted */
20947  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
20948  {
20949  /* mark this as if the LP failed */
20950  *lperror = TRUE;
20951  }
20952  else
20953  {
20954  /* call strong branching for columns with fractional value */
20955  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, FALSE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
20956  down, up, downvalid, upvalid, lperror) );
20957 
20958  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
20959  * declare the sub nodes infeasible
20960  */
20961  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
20962  {
20963  for( j = 0; j < nvars; ++j )
20964  {
20965  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
20966  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
20967  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
20968  }
20969  }
20970  }
20971  SCIPfreeBufferArray(scip, &cols);
20972 
20973  return SCIP_OKAY;
20974 }
20975 
20976 /** gets strong branching information on column variables with integral values
20977  *
20978  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
20979  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
20980  *
20981  * @pre This method can be called if @p scip is in one of the following stages:
20982  * - \ref SCIP_STAGE_PRESOLVED
20983  * - \ref SCIP_STAGE_SOLVING
20984  */
20986  SCIP* scip, /**< SCIP data structure */
20987  SCIP_VAR** vars, /**< variables to get strong branching values for */
20988  int nvars, /**< number of variables */
20989  int itlim, /**< iteration limit for strong branchings */
20990  SCIP_Real* down, /**< stores dual bounds after branching variables down */
20991  SCIP_Real* up, /**< stores dual bounds after branching variables up */
20992  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
20993  * otherwise, they can only be used as an estimate value */
20994  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
20995  * otherwise, they can only be used as an estimate value */
20996  SCIP_Bool* downinf, /**< array to store whether the downward branches are infeasible, or NULL */
20997  SCIP_Bool* upinf, /**< array to store whether the upward branches are infeasible, or NULL */
20998  SCIP_Bool* downconflict, /**< array to store whether conflict constraints were created for
20999  * infeasible downward branches, or NULL */
21000  SCIP_Bool* upconflict, /**< array to store whether conflict constraints were created for
21001  * infeasible upward branches, or NULL */
21002  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred or the
21003  * solving process should be stopped (e.g., due to a time limit) */
21004  )
21005 {
21006  SCIP_COL** cols;
21007  int j;
21008 
21009  assert(lperror != NULL);
21010 
21011  SCIP_CALL( checkStage(scip, "SCIPgetVarsStrongbranchesInt", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21012 
21013  assert( vars != NULL );
21014 
21015  /* set up data */
21016  cols = NULL;
21017  SCIP_CALL( SCIPallocBufferArray(scip, &cols, nvars) );
21018  assert(cols != NULL);
21019  for( j = 0; j < nvars; ++j )
21020  {
21021  SCIP_VAR* var;
21022  SCIP_COL* col;
21023 
21024  if( downvalid != NULL )
21025  downvalid[j] = FALSE;
21026  if( upvalid != NULL )
21027  upvalid[j] = FALSE;
21028  if( downinf != NULL )
21029  downinf[j] = FALSE;
21030  if( upinf != NULL )
21031  upinf[j] = FALSE;
21032  if( downconflict != NULL )
21033  downconflict[j] = FALSE;
21034  if( upconflict != NULL )
21035  upconflict[j] = FALSE;
21036 
21037  var = vars[j];
21038  assert( var != NULL );
21040  {
21041  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable <%s>\n", SCIPvarGetName(var));
21042  SCIPfreeBufferArray(scip, &cols);
21043  return SCIP_INVALIDDATA;
21044  }
21045 
21046  col = SCIPvarGetCol(var);
21047  assert(col != NULL);
21048  cols[j] = col;
21049 
21050  if( !SCIPcolIsInLP(col) )
21051  {
21052  SCIPerrorMessage("cannot get strong branching information on variable <%s> not in current LP\n", SCIPvarGetName(var));
21053  SCIPfreeBufferArray(scip, &cols);
21054  return SCIP_INVALIDDATA;
21055  }
21056  }
21057 
21058  /* check if the solving process should be aborted */
21059  if( SCIPsolveIsStopped(scip->set, scip->stat, FALSE) )
21060  {
21061  /* mark this as if the LP failed */
21062  *lperror = TRUE;
21063  }
21064  else
21065  {
21066  /* call strong branching for columns */
21067  SCIP_CALL( SCIPcolGetStrongbranches(cols, nvars, TRUE, scip->set, scip->stat, scip->transprob, scip->lp, itlim,
21068  down, up, downvalid, upvalid, lperror) );
21069 
21070  /* check, if the branchings are infeasible; in exact solving mode, we cannot trust the strong branching enough to
21071  * declare the sub nodes infeasible
21072  */
21073  if( !(*lperror) && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->set->misc_exactsolve )
21074  {
21075  for( j = 0; j < nvars; ++j )
21076  {
21077  SCIP_CALL( analyzeStrongbranch(scip, vars[j], (downinf != NULL) ? (&(downinf[j])) : NULL,
21078  (upinf != NULL) ? (&(upinf[j])) : NULL, (downconflict != NULL) ? (&(downconflict[j])) : NULL,
21079  (upconflict != NULL) ? (&(upconflict[j])) : NULL) );
21080 
21081  }
21082  }
21083  }
21084  SCIPfreeBufferArray(scip, &cols);
21085 
21086  return SCIP_OKAY;
21087 }
21088 
21089 /** get LP solution status of last strong branching call (currently only works for strong branching with propagation) */
21091  SCIP* scip, /**< SCIP data structure */
21092  SCIP_BRANCHDIR branchdir /**< branching direction for which LP solution status is requested */
21093  )
21094 {
21095  assert(NULL != scip);
21096  assert(branchdir == SCIP_BRANCHDIR_DOWNWARDS || branchdir == SCIP_BRANCHDIR_UPWARDS);
21097 
21098  return scip->stat->lastsblpsolstats[branchdir == SCIP_BRANCHDIR_DOWNWARDS ? 0 : 1];
21099 }
21100 
21101 /** gets strong branching information on COLUMN variable of the last SCIPgetVarStrongbranch() call;
21102  * returns values of SCIP_INVALID, if strong branching was not yet called on the given variable;
21103  * keep in mind, that the returned old values may have nothing to do with the current LP solution
21104  *
21105  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21106  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21107  *
21108  * @pre This method can be called if @p scip is in one of the following stages:
21109  * - \ref SCIP_STAGE_SOLVING
21110  * - \ref SCIP_STAGE_SOLVED
21111  */
21113  SCIP* scip, /**< SCIP data structure */
21114  SCIP_VAR* var, /**< variable to get last strong branching values for */
21115  SCIP_Real* down, /**< stores dual bound after branching column down */
21116  SCIP_Real* up, /**< stores dual bound after branching column up */
21117  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
21118  * otherwise, it can only be used as an estimate value */
21119  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
21120  * otherwise, it can only be used as an estimate value */
21121  SCIP_Real* solval, /**< stores LP solution value of variable at the last strong branching call, or NULL */
21122  SCIP_Real* lpobjval /**< stores LP objective value at last strong branching call, or NULL */
21123  )
21124 {
21125  SCIP_CALL( checkStage(scip, "SCIPgetVarStrongbranchLast", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
21126 
21128  {
21129  SCIPerrorMessage("cannot get strong branching information on non-COLUMN variable\n");
21130  return SCIP_INVALIDDATA;
21131  }
21132 
21133  SCIPcolGetStrongbranchLast(SCIPvarGetCol(var), down, up, downvalid, upvalid, solval, lpobjval);
21134 
21135  return SCIP_OKAY;
21136 }
21137 
21138 /** gets node number of the last node in current branch and bound run, where strong branching was used on the
21139  * given variable, or -1 if strong branching was never applied to the variable in current run
21140  *
21141  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21142  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21143  *
21144  * @pre This method can be called if @p scip is in one of the following stages:
21145  * - \ref SCIP_STAGE_TRANSFORMING
21146  * - \ref SCIP_STAGE_TRANSFORMED
21147  * - \ref SCIP_STAGE_INITPRESOLVE
21148  * - \ref SCIP_STAGE_PRESOLVING
21149  * - \ref SCIP_STAGE_EXITPRESOLVE
21150  * - \ref SCIP_STAGE_PRESOLVED
21151  * - \ref SCIP_STAGE_INITSOLVE
21152  * - \ref SCIP_STAGE_SOLVING
21153  * - \ref SCIP_STAGE_SOLVED
21154  * - \ref SCIP_STAGE_EXITSOLVE
21155  */
21157  SCIP* scip, /**< SCIP data structure */
21158  SCIP_VAR* var /**< variable to get last strong branching node for */
21159  )
21160 {
21161  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchNode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21162 
21163  assert( var->scip == scip );
21164 
21166  return -1;
21167 
21169 }
21170 
21171 /** if strong branching was already applied on the variable at the current node, returns the number of LPs solved after
21172  * the LP where the strong branching on this variable was applied;
21173  * if strong branching was not yet applied on the variable at the current node, returns INT_MAX
21174  *
21175  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21176  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21177  *
21178  * @pre This method can be called if @p scip is in one of the following stages:
21179  * - \ref SCIP_STAGE_TRANSFORMING
21180  * - \ref SCIP_STAGE_TRANSFORMED
21181  * - \ref SCIP_STAGE_INITPRESOLVE
21182  * - \ref SCIP_STAGE_PRESOLVING
21183  * - \ref SCIP_STAGE_EXITPRESOLVE
21184  * - \ref SCIP_STAGE_PRESOLVED
21185  * - \ref SCIP_STAGE_INITSOLVE
21186  * - \ref SCIP_STAGE_SOLVING
21187  * - \ref SCIP_STAGE_SOLVED
21188  * - \ref SCIP_STAGE_EXITSOLVE
21189  */
21191  SCIP* scip, /**< SCIP data structure */
21192  SCIP_VAR* var /**< variable to get strong branching LP age for */
21193  )
21194 {
21195  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarStrongbranchLPAge", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21196 
21197  assert( var->scip == scip );
21198 
21200  return SCIP_LONGINT_MAX;
21201 
21202  return SCIPcolGetStrongbranchLPAge(SCIPvarGetCol(var), scip->stat);
21203 }
21204 
21205 /** gets number of times, strong branching was applied in current run on the given variable
21206  *
21207  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21208  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21209  *
21210  * @pre This method can be called if @p scip is in one of the following stages:
21211  * - \ref SCIP_STAGE_TRANSFORMING
21212  * - \ref SCIP_STAGE_TRANSFORMED
21213  * - \ref SCIP_STAGE_INITPRESOLVE
21214  * - \ref SCIP_STAGE_PRESOLVING
21215  * - \ref SCIP_STAGE_EXITPRESOLVE
21216  * - \ref SCIP_STAGE_PRESOLVED
21217  * - \ref SCIP_STAGE_INITSOLVE
21218  * - \ref SCIP_STAGE_SOLVING
21219  * - \ref SCIP_STAGE_SOLVED
21220  * - \ref SCIP_STAGE_EXITSOLVE
21221  */
21223  SCIP* scip, /**< SCIP data structure */
21224  SCIP_VAR* var /**< variable to get last strong branching node for */
21225  )
21226 {
21227  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarNStrongbranchs", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
21228 
21229  assert( var->scip == scip );
21230 
21232  return 0;
21233 
21235 }
21236 
21237 /** adds given values to lock numbers of variable for rounding
21238  *
21239  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21240  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21241  *
21242  * @pre This method can be called if @p scip is in one of the following stages:
21243  * - \ref SCIP_STAGE_PROBLEM
21244  * - \ref SCIP_STAGE_TRANSFORMING
21245  * - \ref SCIP_STAGE_TRANSFORMED
21246  * - \ref SCIP_STAGE_INITPRESOLVE
21247  * - \ref SCIP_STAGE_PRESOLVING
21248  * - \ref SCIP_STAGE_EXITPRESOLVE
21249  * - \ref SCIP_STAGE_PRESOLVED
21250  * - \ref SCIP_STAGE_INITSOLVE
21251  * - \ref SCIP_STAGE_SOLVING
21252  * - \ref SCIP_STAGE_EXITSOLVE
21253  * - \ref SCIP_STAGE_FREETRANS
21254  */
21256  SCIP* scip, /**< SCIP data structure */
21257  SCIP_VAR* var, /**< problem variable */
21258  int nlocksdown, /**< modification in number of rounding down locks */
21259  int nlocksup /**< modification in number of rounding up locks */
21260  )
21261 {
21262  SCIP_CALL( checkStage(scip, "SCIPaddVarLocks", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21263 
21264  assert( var->scip == scip );
21265 
21266  switch( scip->set->stage )
21267  {
21268  case SCIP_STAGE_PROBLEM:
21269  assert(!SCIPvarIsTransformed(var));
21270  /*lint -fallthrough*/
21274  case SCIP_STAGE_PRESOLVING:
21276  case SCIP_STAGE_PRESOLVED:
21277  case SCIP_STAGE_INITSOLVE:
21278  case SCIP_STAGE_SOLVING:
21279  case SCIP_STAGE_EXITSOLVE:
21280  case SCIP_STAGE_FREETRANS:
21281  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
21282  return SCIP_OKAY;
21283 
21284  default:
21285  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21286  return SCIP_INVALIDCALL;
21287  } /*lint !e788*/
21288 }
21289 
21290 /** locks rounding of variable with respect to the lock status of the constraint and its negation;
21291  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
21292  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
21293  * added or removed
21294  *
21295  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21296  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21297  *
21298  * @pre This method can be called if @p scip is in one of the following stages:
21299  * - \ref SCIP_STAGE_PROBLEM
21300  * - \ref SCIP_STAGE_TRANSFORMING
21301  * - \ref SCIP_STAGE_INITPRESOLVE
21302  * - \ref SCIP_STAGE_PRESOLVING
21303  * - \ref SCIP_STAGE_EXITPRESOLVE
21304  * - \ref SCIP_STAGE_INITSOLVE
21305  * - \ref SCIP_STAGE_SOLVING
21306  * - \ref SCIP_STAGE_EXITSOLVE
21307  * - \ref SCIP_STAGE_FREETRANS
21308  */
21310  SCIP* scip, /**< SCIP data structure */
21311  SCIP_VAR* var, /**< problem variable */
21312  SCIP_CONS* cons, /**< constraint */
21313  SCIP_Bool lockdown, /**< should the rounding be locked in downwards direction? */
21314  SCIP_Bool lockup /**< should the rounding be locked in upwards direction? */
21315  )
21316 {
21317  int nlocksdown;
21318  int nlocksup;
21319 
21320  SCIP_CALL( checkStage(scip, "SCIPlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21321 
21322  assert( var->scip == scip );
21323 
21324  nlocksdown = 0;
21325  nlocksup = 0;
21326  if( SCIPconsIsLockedPos(cons) )
21327  {
21328  if( lockdown )
21329  nlocksdown++;
21330  if( lockup )
21331  nlocksup++;
21332  }
21333  if( SCIPconsIsLockedNeg(cons) )
21334  {
21335  if( lockdown )
21336  nlocksup++;
21337  if( lockup )
21338  nlocksdown++;
21339  }
21340 
21341  switch( scip->set->stage )
21342  {
21343  case SCIP_STAGE_PROBLEM:
21344  assert(!SCIPvarIsTransformed(var));
21345  /*lint -fallthrough*/
21349  case SCIP_STAGE_PRESOLVING:
21351  case SCIP_STAGE_INITSOLVE:
21352  case SCIP_STAGE_SOLVING:
21353  case SCIP_STAGE_EXITSOLVE:
21354  case SCIP_STAGE_FREETRANS:
21355  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, nlocksdown, nlocksup) );
21356  return SCIP_OKAY;
21357 
21358  default:
21359  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21360  return SCIP_INVALIDCALL;
21361  } /*lint !e788*/
21362 }
21363 
21364 /** unlocks rounding of variable with respect to the lock status of the constraint and its negation;
21365  * this method should be called whenever the lock status of a variable in a constraint changes, for example if
21366  * the coefficient of the variable changed its sign or if the left or right hand sides of the constraint were
21367  * added or removed
21368  *
21369  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21370  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21371  *
21372  * @pre This method can be called if @p scip is in one of the following stages:
21373  * - \ref SCIP_STAGE_PROBLEM
21374  * - \ref SCIP_STAGE_TRANSFORMING
21375  * - \ref SCIP_STAGE_INITPRESOLVE
21376  * - \ref SCIP_STAGE_PRESOLVING
21377  * - \ref SCIP_STAGE_EXITPRESOLVE
21378  * - \ref SCIP_STAGE_INITSOLVE
21379  * - \ref SCIP_STAGE_SOLVING
21380  * - \ref SCIP_STAGE_EXITSOLVE
21381  * - \ref SCIP_STAGE_FREETRANS
21382  */
21384  SCIP* scip, /**< SCIP data structure */
21385  SCIP_VAR* var, /**< problem variable */
21386  SCIP_CONS* cons, /**< constraint */
21387  SCIP_Bool lockdown, /**< should the rounding be unlocked in downwards direction? */
21388  SCIP_Bool lockup /**< should the rounding be unlocked in upwards direction? */
21389  )
21390 {
21391  int nlocksdown;
21392  int nlocksup;
21393 
21394  SCIP_CALL( checkStage(scip, "SCIPunlockVarCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
21395 
21396  assert( var->scip == scip );
21397 
21398  nlocksdown = 0;
21399  nlocksup = 0;
21400  if( SCIPconsIsLockedPos(cons) )
21401  {
21402  if( lockdown )
21403  nlocksdown++;
21404  if( lockup )
21405  nlocksup++;
21406  }
21407  if( SCIPconsIsLockedNeg(cons) )
21408  {
21409  if( lockdown )
21410  nlocksup++;
21411  if( lockup )
21412  nlocksdown++;
21413  }
21414 
21415  switch( scip->set->stage )
21416  {
21417  case SCIP_STAGE_PROBLEM:
21418  assert(!SCIPvarIsTransformed(var));
21419  /*lint -fallthrough*/
21422  case SCIP_STAGE_PRESOLVING:
21424  case SCIP_STAGE_INITSOLVE:
21425  case SCIP_STAGE_SOLVING:
21426  case SCIP_STAGE_EXITSOLVE:
21427  case SCIP_STAGE_FREETRANS:
21428  SCIP_CALL( SCIPvarAddLocks(var, scip->mem->probmem, scip->set, scip->eventqueue, -nlocksdown, -nlocksup) );
21429  return SCIP_OKAY;
21430 
21431  default:
21432  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21433  return SCIP_INVALIDCALL;
21434  } /*lint !e788*/
21435 }
21436 
21437 /** changes variable's objective value
21438  *
21439  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21440  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21441  *
21442  * @pre This method can be called if @p scip is in one of the following stages:
21443  * - \ref SCIP_STAGE_PROBLEM
21444  * - \ref SCIP_STAGE_TRANSFORMING
21445  * - \ref SCIP_STAGE_PRESOLVING
21446  * - \ref SCIP_STAGE_PRESOLVED
21447  */
21449  SCIP* scip, /**< SCIP data structure */
21450  SCIP_VAR* var, /**< variable to change the objective value for */
21451  SCIP_Real newobj /**< new objective value */
21452  )
21453 {
21454  SCIP_CALL( checkStage(scip, "SCIPchgVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
21455 
21456  assert( var->scip == scip );
21457 
21458  /* forbid infinite objective values */
21459  if( SCIPisInfinity(scip, REALABS(newobj)) )
21460  {
21461  SCIPerrorMessage("invalid objective value: objective value is infinite\n");
21462  return SCIP_INVALIDDATA;
21463  }
21464 
21465  switch( scip->set->stage )
21466  {
21467  case SCIP_STAGE_PROBLEM:
21468  assert(!SCIPvarIsTransformed(var));
21469  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->origprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
21470  return SCIP_OKAY;
21471 
21474  case SCIP_STAGE_PRESOLVING:
21475  case SCIP_STAGE_PRESOLVED:
21476  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
21477  return SCIP_OKAY;
21478 
21479  default:
21480  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21481  return SCIP_INVALIDCALL;
21482  } /*lint !e788*/
21483 }
21484 
21485 /** adds value to variable's objective value
21486  *
21487  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21488  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21489  *
21490  * @pre This method can be called if @p scip is in one of the following stages:
21491  * - \ref SCIP_STAGE_PROBLEM
21492  * - \ref SCIP_STAGE_TRANSFORMING
21493  * - \ref SCIP_STAGE_PRESOLVING
21494  * - \ref SCIP_STAGE_EXITPRESOLVE
21495  * - \ref SCIP_STAGE_PRESOLVED
21496  */
21498  SCIP* scip, /**< SCIP data structure */
21499  SCIP_VAR* var, /**< variable to change the objective value for */
21500  SCIP_Real addobj /**< additional objective value */
21501  )
21502 {
21503  SCIP_CALL( checkStage(scip, "SCIPaddVarObj", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
21504 
21505  assert( var->scip == scip );
21506 
21507  switch( scip->set->stage )
21508  {
21509  case SCIP_STAGE_PROBLEM:
21510  assert(!SCIPvarIsTransformed(var));
21511  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
21512  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
21513  return SCIP_OKAY;
21514 
21516  case SCIP_STAGE_PRESOLVING:
21518  case SCIP_STAGE_PRESOLVED:
21519  SCIP_CALL( SCIPvarAddObj(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->primal,
21520  scip->tree, scip->reopt, scip->lp, scip->eventqueue, addobj) );
21521  return SCIP_OKAY;
21522 
21523  default:
21524  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21525  return SCIP_INVALIDCALL;
21526  } /*lint !e788*/
21527 }
21528 
21529 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) lower bound value;
21530  * does not change the bounds of the variable
21531  *
21532  * @return adjusted lower bound for the given variable; the bound of the variable is not changed
21533  *
21534  * @pre This method can be called if @p scip is in one of the following stages:
21535  * - \ref SCIP_STAGE_PROBLEM
21536  * - \ref SCIP_STAGE_TRANSFORMING
21537  * - \ref SCIP_STAGE_TRANSFORMED
21538  * - \ref SCIP_STAGE_INITPRESOLVE
21539  * - \ref SCIP_STAGE_PRESOLVING
21540  * - \ref SCIP_STAGE_EXITPRESOLVE
21541  * - \ref SCIP_STAGE_PRESOLVED
21542  * - \ref SCIP_STAGE_INITSOLVE
21543  * - \ref SCIP_STAGE_SOLVING
21544  * - \ref SCIP_STAGE_SOLVED
21545  * - \ref SCIP_STAGE_EXITSOLVE
21546  * - \ref SCIP_STAGE_FREETRANS
21547  */
21549  SCIP* scip, /**< SCIP data structure */
21550  SCIP_VAR* var, /**< variable to adjust the bound for */
21551  SCIP_Real lb /**< lower bound value to adjust */
21552  )
21553 {
21554  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarLb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
21555 
21556  SCIPvarAdjustLb(var, scip->set, &lb);
21557 
21558  return lb;
21559 }
21560 
21561 /** returns the adjusted (i.e. rounded, if the given variable is of integral type) upper bound value;
21562  * does not change the bounds of the variable
21563  *
21564  * @return adjusted upper bound for the given variable; the bound of the variable is not changed
21565  *
21566  * @pre This method can be called if @p scip is in one of the following stages:
21567  * - \ref SCIP_STAGE_PROBLEM
21568  * - \ref SCIP_STAGE_TRANSFORMING
21569  * - \ref SCIP_STAGE_TRANSFORMED
21570  * - \ref SCIP_STAGE_INITPRESOLVE
21571  * - \ref SCIP_STAGE_PRESOLVING
21572  * - \ref SCIP_STAGE_EXITPRESOLVE
21573  * - \ref SCIP_STAGE_PRESOLVED
21574  * - \ref SCIP_STAGE_INITSOLVE
21575  * - \ref SCIP_STAGE_SOLVING
21576  * - \ref SCIP_STAGE_SOLVED
21577  * - \ref SCIP_STAGE_EXITSOLVE
21578  * - \ref SCIP_STAGE_FREETRANS
21579  */
21581  SCIP* scip, /**< SCIP data structure */
21582  SCIP_VAR* var, /**< variable to adjust the bound for */
21583  SCIP_Real ub /**< upper bound value to adjust */
21584  )
21585 {
21586  SCIP_CALL_ABORT( checkStage(scip, "SCIPadjustedVarUb", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
21587 
21588  SCIPvarAdjustUb(var, scip->set, &ub);
21589 
21590  return ub;
21591 }
21592 
21593 /** depending on SCIP's stage, changes lower bound of variable in the problem, in preprocessing, or in current node;
21594  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
21595  * that in conflict analysis, this change is treated like a branching decision
21596  *
21597  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
21598  * SCIPgetVars()) gets resorted.
21599  *
21600  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21601  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21602  *
21603  * @pre This method can be called if @p scip is in one of the following stages:
21604  * - \ref SCIP_STAGE_PROBLEM
21605  * - \ref SCIP_STAGE_TRANSFORMING
21606  * - \ref SCIP_STAGE_PRESOLVING
21607  * - \ref SCIP_STAGE_SOLVING
21608  *
21609  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
21610  */
21612  SCIP* scip, /**< SCIP data structure */
21613  SCIP_VAR* var, /**< variable to change the bound for */
21614  SCIP_Real newbound /**< new value for bound */
21615  )
21616 {
21617  SCIP_CALL( checkStage(scip, "SCIPchgVarLb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21618 
21619  SCIPvarAdjustLb(var, scip->set, &newbound);
21620 
21621  /* ignore tightenings of lower bounds to +infinity during solving process */
21622  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
21623  {
21624 #ifndef NDEBUG
21625  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
21626  SCIPvarGetLbLocal(var));
21627 #endif
21628  return SCIP_OKAY;
21629  }
21630 
21631  switch( scip->set->stage )
21632  {
21633  case SCIP_STAGE_PROBLEM:
21634  assert(!SCIPvarIsTransformed(var));
21635  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21636  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21637  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21638  scip->branchcand, scip->eventqueue, newbound) );
21639  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
21640  break;
21641 
21643  case SCIP_STAGE_PRESOLVED:
21644  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21645  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21646  break;
21647 
21648  case SCIP_STAGE_PRESOLVING:
21649  if( !SCIPinProbing(scip) )
21650  {
21651  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
21652  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
21653 
21654  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21655  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
21656  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
21657 
21659  {
21660  SCIP_Bool infeasible;
21661 
21662  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
21663  assert(!infeasible);
21664  }
21665  break;
21666  }
21667  /*lint -fallthrough*/
21668  case SCIP_STAGE_SOLVING:
21670  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
21671  scip->cliquetable, var, newbound,
21673  break;
21674 
21675  default:
21676  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21677  return SCIP_INVALIDCALL;
21678  } /*lint !e788*/
21679 
21680  return SCIP_OKAY;
21681 }
21682 
21683 /** depending on SCIP's stage, changes upper bound of variable in the problem, in preprocessing, or in current node;
21684  * if possible, adjusts bound to integral value; doesn't store any inference information in the bound change, such
21685  * that in conflict analysis, this change is treated like a branching decision
21686  *
21687  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
21688  * SCIPgetVars()) gets resorted.
21689  *
21690  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21691  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21692  *
21693  * @pre This method can be called if @p scip is in one of the following stages:
21694  * - \ref SCIP_STAGE_PROBLEM
21695  * - \ref SCIP_STAGE_TRANSFORMING
21696  * - \ref SCIP_STAGE_PRESOLVING
21697  * - \ref SCIP_STAGE_SOLVING
21698  *
21699  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
21700  */
21702  SCIP* scip, /**< SCIP data structure */
21703  SCIP_VAR* var, /**< variable to change the bound for */
21704  SCIP_Real newbound /**< new value for bound */
21705  )
21706 {
21707  SCIP_CALL( checkStage(scip, "SCIPchgVarUb", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21708 
21709  SCIPvarAdjustUb(var, scip->set, &newbound);
21710 
21711  /* ignore tightenings of upper bounds to -infinity during solving process */
21712  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
21713  {
21714 #ifndef NDEBUG
21715  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
21716  SCIPvarGetUbLocal(var));
21717 #endif
21718  return SCIP_OKAY;
21719  }
21720 
21721  switch( scip->set->stage )
21722  {
21723  case SCIP_STAGE_PROBLEM:
21724  assert(!SCIPvarIsTransformed(var));
21725  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21726  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21727  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21728  scip->branchcand, scip->eventqueue, newbound) );
21729  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
21730  break;
21731 
21733  case SCIP_STAGE_PRESOLVED:
21734  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21735  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21736  break;
21737 
21738  case SCIP_STAGE_PRESOLVING:
21739  if( !SCIPinProbing(scip) )
21740  {
21741  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
21742  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
21743 
21744  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21745  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
21746  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
21747 
21749  {
21750  SCIP_Bool infeasible;
21751 
21752  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
21753  assert(!infeasible);
21754  }
21755  break;
21756  }
21757  /*lint -fallthrough*/
21758  case SCIP_STAGE_SOLVING:
21760  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
21761  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
21762  break;
21763 
21764  default:
21765  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21766  return SCIP_INVALIDCALL;
21767  } /*lint !e788*/
21768 
21769  return SCIP_OKAY;
21770 }
21771 
21772 /** changes lower bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
21773  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
21774  * decision
21775  *
21776  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21777  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21778  *
21779  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
21780  */
21782  SCIP* scip, /**< SCIP data structure */
21783  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
21784  SCIP_VAR* var, /**< variable to change the bound for */
21785  SCIP_Real newbound /**< new value for bound */
21786  )
21787 {
21788  SCIP_CALL( checkStage(scip, "SCIPchgVarLbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21789 
21790  if( node == NULL )
21791  {
21792  SCIP_CALL( SCIPchgVarLb(scip, var, newbound) );
21793  }
21794  else
21795  {
21796  SCIPvarAdjustLb(var, scip->set, &newbound);
21797 
21798  /* ignore tightenings of lower bounds to +infinity during solving process */
21799  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
21800  {
21801 #ifndef NDEBUG
21802  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
21803  SCIPvarGetLbLocal(var));
21804 #endif
21805  return SCIP_OKAY;
21806  }
21807 
21808  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21809  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21811  }
21812 
21813  return SCIP_OKAY;
21814 }
21815 
21816 /** changes upper bound of variable in the given node; if possible, adjust bound to integral value; doesn't store any
21817  * inference information in the bound change, such that in conflict analysis, this change is treated like a branching
21818  * decision
21819  *
21820  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21821  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21822  *
21823  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
21824  */
21826  SCIP* scip, /**< SCIP data structure */
21827  SCIP_NODE* node, /**< node to change bound at, or NULL for current node */
21828  SCIP_VAR* var, /**< variable to change the bound for */
21829  SCIP_Real newbound /**< new value for bound */
21830  )
21831 {
21832  SCIP_CALL( checkStage(scip, "SCIPchgVarUbNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21833 
21834  if( node == NULL )
21835  {
21836  SCIP_CALL( SCIPchgVarUb(scip, var, newbound) );
21837  }
21838  else
21839  {
21840  SCIPvarAdjustUb(var, scip->set, &newbound);
21841 
21842  /* ignore tightenings of upper bounds to -infinity during solving process */
21843  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
21844  {
21845 #ifndef NDEBUG
21846  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
21847  SCIPvarGetUbLocal(var));
21848 #endif
21849  return SCIP_OKAY;
21850  }
21851 
21852  SCIP_CALL( SCIPnodeAddBoundchg(node, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
21853  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21855  }
21856 
21857  return SCIP_OKAY;
21858 }
21859 
21860 /** changes global lower bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
21861  * if the global bound is better than the local bound
21862  *
21863  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
21864  * SCIPgetVars()) gets resorted.
21865  *
21866  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21867  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21868  *
21869  * @pre This method can be called if @p scip is in one of the following stages:
21870  * - \ref SCIP_STAGE_PROBLEM
21871  * - \ref SCIP_STAGE_TRANSFORMING
21872  * - \ref SCIP_STAGE_PRESOLVING
21873  * - \ref SCIP_STAGE_SOLVING
21874  *
21875  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
21876  */
21878  SCIP* scip, /**< SCIP data structure */
21879  SCIP_VAR* var, /**< variable to change the bound for */
21880  SCIP_Real newbound /**< new value for bound */
21881  )
21882 {
21883  SCIP_CALL( checkStage(scip, "SCIPchgVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21884 
21885  SCIPvarAdjustLb(var, scip->set, &newbound);
21886 
21887  /* ignore tightenings of lower bounds to +infinity during solving process */
21888  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
21889  {
21890 #ifndef NDEBUG
21891  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
21892  SCIPvarGetLbLocal(var));
21893 #endif
21894  return SCIP_OKAY;
21895  }
21896 
21897  switch( scip->set->stage )
21898  {
21899  case SCIP_STAGE_PROBLEM:
21900  assert(!SCIPvarIsTransformed(var));
21901  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21902  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21903  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21904  scip->branchcand, scip->eventqueue, newbound) );
21905  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
21906  break;
21907 
21909  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21910  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21911  break;
21912 
21913  case SCIP_STAGE_PRESOLVING:
21914  if( !SCIPinProbing(scip) )
21915  {
21916  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
21917  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
21918 
21919  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21920  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21922 
21924  {
21925  SCIP_Bool infeasible;
21926 
21927  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
21928  assert(!infeasible);
21929  }
21930  break;
21931  }
21932  /*lint -fallthrough*/
21933  case SCIP_STAGE_SOLVING:
21934  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
21935  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
21937  break;
21938 
21939  default:
21940  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
21941  return SCIP_INVALIDCALL;
21942  } /*lint !e788*/
21943 
21944  return SCIP_OKAY;
21945 }
21946 
21947 /** changes global upper bound of variable; if possible, adjust bound to integral value; also tightens the local bound,
21948  * if the global bound is better than the local bound
21949  *
21950  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
21951  * SCIPgetVars()) gets resorted.
21952  *
21953  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
21954  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
21955  *
21956  * @pre This method can be called if @p scip is in one of the following stages:
21957  * - \ref SCIP_STAGE_PROBLEM
21958  * - \ref SCIP_STAGE_TRANSFORMING
21959  * - \ref SCIP_STAGE_PRESOLVING
21960  * - \ref SCIP_STAGE_SOLVING
21961  *
21962  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
21963  */
21965  SCIP* scip, /**< SCIP data structure */
21966  SCIP_VAR* var, /**< variable to change the bound for */
21967  SCIP_Real newbound /**< new value for bound */
21968  )
21969 {
21970  SCIP_CALL( checkStage(scip, "SCIPchgVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
21971 
21972  SCIPvarAdjustUb(var, scip->set, &newbound);
21973 
21974  /* ignore tightenings of upper bounds to -infinity during solving process */
21975  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
21976  {
21977 #ifndef NDEBUG
21978  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
21979  SCIPvarGetUbLocal(var));
21980 #endif
21981  return SCIP_OKAY;
21982  }
21983 
21984  switch( scip->set->stage )
21985  {
21986  case SCIP_STAGE_PROBLEM:
21987  assert(!SCIPvarIsTransformed(var));
21988  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21989  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21990  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21991  scip->branchcand, scip->eventqueue, newbound) );
21992  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
21993  break;
21994 
21996  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
21997  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
21998  break;
21999 
22000  case SCIP_STAGE_PRESOLVING:
22001  if( !SCIPinProbing(scip) )
22002  {
22003  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22004  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22005 
22006  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22007  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22009 
22011  {
22012  SCIP_Bool infeasible;
22013 
22014  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, &infeasible) );
22015  assert(!infeasible);
22016  }
22017  break;
22018  }
22019  /*lint -fallthrough*/
22020  case SCIP_STAGE_SOLVING:
22021  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22022  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22024  break;
22025 
22026  default:
22027  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22028  return SCIP_INVALIDCALL;
22029  } /*lint !e788*/
22030 
22031  return SCIP_OKAY;
22032 }
22033 
22034 /** changes lazy lower bound of the variable, this is only possible if the variable is not in the LP yet
22035  *
22036  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
22037  * to be put into the LP explicitly.
22038  *
22039  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22040  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22041  *
22042  * @pre This method can be called if @p scip is in one of the following stages:
22043  * - \ref SCIP_STAGE_PROBLEM
22044  * - \ref SCIP_STAGE_TRANSFORMING
22045  * - \ref SCIP_STAGE_TRANSFORMED
22046  * - \ref SCIP_STAGE_PRESOLVING
22047  * - \ref SCIP_STAGE_SOLVING
22048  *
22049  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
22050  */
22052  SCIP* scip, /**< SCIP data structure */
22053  SCIP_VAR* var, /**< problem variable */
22054  SCIP_Real lazylb /**< the lazy lower bound to be set */
22055  )
22056 {
22057  assert(scip != NULL);
22058  assert(var != NULL);
22059 
22060  SCIP_CALL( checkStage(scip, "SCIPchgVarLbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22061 
22062  SCIP_CALL( SCIPvarChgLbLazy(var, scip->set, lazylb) );
22063 
22064  return SCIP_OKAY;
22065 }
22066 
22067 /** changes lazy upper bound of the variable, this is only possible if the variable is not in the LP yet
22068  *
22069  * lazy bounds are bounds, that are enforced by constraints and the objective function; hence, these bounds do not need
22070  * to be put into the LP explicitly.
22071  *
22072  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22073  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22074  *
22075  * @pre This method can be called if @p scip is in one of the following stages:
22076  * - \ref SCIP_STAGE_PROBLEM
22077  * - \ref SCIP_STAGE_TRANSFORMING
22078  * - \ref SCIP_STAGE_TRANSFORMED
22079  * - \ref SCIP_STAGE_PRESOLVING
22080  * - \ref SCIP_STAGE_SOLVING
22081  *
22082  * @note lazy bounds are useful for branch-and-price since the corresponding variable bounds are not part of the LP
22083  */
22085  SCIP* scip, /**< SCIP data structure */
22086  SCIP_VAR* var, /**< problem variable */
22087  SCIP_Real lazyub /**< the lazy lower bound to be set */
22088  )
22089 {
22090  assert(scip != NULL);
22091  assert(var != NULL);
22092 
22093  SCIP_CALL( checkStage(scip, "SCIPchgVarUbLazy", FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22094 
22095  SCIP_CALL( SCIPvarChgUbLazy(var, scip->set, lazyub) );
22096 
22097  return SCIP_OKAY;
22098 }
22099 
22100 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
22101  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22102  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
22103  * is treated like a branching decision
22104  *
22105  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22106  * SCIPgetVars()) gets resorted.
22107  *
22108  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22109  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22110  *
22111  * @pre This method can be called if @p scip is in one of the following stages:
22112  * - \ref SCIP_STAGE_PROBLEM
22113  * - \ref SCIP_STAGE_PRESOLVING
22114  * - \ref SCIP_STAGE_SOLVING
22115  *
22116  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22117  */
22119  SCIP* scip, /**< SCIP data structure */
22120  SCIP_VAR* var, /**< variable to change the bound for */
22121  SCIP_Real newbound, /**< new value for bound */
22122  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22123  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
22124  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22125  )
22126 {
22127  SCIP_Real lb;
22128  SCIP_Real ub;
22129 
22130  assert(infeasible != NULL);
22131  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
22132  assert(!SCIPinDive(scip));
22133 
22134  SCIP_CALL( checkStage(scip, "SCIPtightenVarLb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22135 
22136  *infeasible = FALSE;
22137  if( tightened != NULL )
22138  *tightened = FALSE;
22139 
22140  SCIPvarAdjustLb(var, scip->set, &newbound);
22141 
22142  /* ignore tightenings of lower bounds to +infinity during solving process */
22143  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22144  {
22145 #ifndef NDEBUG
22146  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22147  SCIPvarGetLbLocal(var));
22148 #endif
22149  return SCIP_OKAY;
22150  }
22151 
22152  /* get current bounds */
22153  lb = SCIPcomputeVarLbLocal(scip, var);
22154  ub = SCIPcomputeVarUbLocal(scip, var);
22155  assert(SCIPsetIsLE(scip->set, lb, ub));
22156 
22157  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
22158  {
22159  *infeasible = TRUE;
22160  return SCIP_OKAY;
22161  }
22162  newbound = MIN(newbound, ub);
22163 
22164  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
22165  return SCIP_OKAY;
22166 
22167  switch( scip->set->stage )
22168  {
22169  case SCIP_STAGE_PROBLEM:
22170  assert(!SCIPvarIsTransformed(var));
22171  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22172  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22173  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22174  scip->branchcand, scip->eventqueue, newbound) );
22175  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22176  break;
22178  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22179  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22180  break;
22181  case SCIP_STAGE_PRESOLVING:
22182  if( !SCIPinProbing(scip) )
22183  {
22184  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22185  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22186 
22187  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22188  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22190 
22192  {
22193  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22194  assert(!(*infeasible));
22195  }
22196  break;
22197  }
22198  /*lint -fallthrough*/
22199  case SCIP_STAGE_SOLVING:
22201  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22202  var, newbound, SCIP_BOUNDTYPE_LOWER, FALSE) );
22203  break;
22204 
22205  default:
22206  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22207  return SCIP_INVALIDCALL;
22208  } /*lint !e788*/
22209 
22210  if( tightened != NULL )
22211  *tightened = TRUE;
22212 
22213  return SCIP_OKAY;
22214 }
22215 
22216 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
22217  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22218  * doesn't store any inference information in the bound change, such that in conflict analysis, this change
22219  * is treated like a branching decision
22220  *
22221  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22222  * SCIPgetVars()) gets resorted.
22223  *
22224  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22225  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22226  *
22227  * @pre This method can be called if @p scip is in one of the following stages:
22228  * - \ref SCIP_STAGE_PROBLEM
22229  * - \ref SCIP_STAGE_PRESOLVING
22230  * - \ref SCIP_STAGE_SOLVING
22231  *
22232  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22233  */
22235  SCIP* scip, /**< SCIP data structure */
22236  SCIP_VAR* var, /**< variable to change the bound for */
22237  SCIP_Real newbound, /**< new value for bound */
22238  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22239  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
22240  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22241  )
22242 {
22243  SCIP_Real lb;
22244  SCIP_Real ub;
22245 
22246  assert(infeasible != NULL);
22247  /** @todo if needed provide pending local/global bound changes that will be flushed after leaving diving mode (as in struct_tree.h) */
22248  assert(!SCIPinDive(scip));
22249 
22250  SCIP_CALL( checkStage(scip, "SCIPtightenVarUb", FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22251 
22252  *infeasible = FALSE;
22253  if( tightened != NULL )
22254  *tightened = FALSE;
22255 
22256  SCIPvarAdjustUb(var, scip->set, &newbound);
22257 
22258  /* ignore tightenings of upper bounds to -infinity during solving process */
22259  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22260  {
22261 #ifndef NDEBUG
22262  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22263  SCIPvarGetUbLocal(var));
22264 #endif
22265  return SCIP_OKAY;
22266  }
22267 
22268  /* get current bounds */
22269  lb = SCIPcomputeVarLbLocal(scip, var);
22270  ub = SCIPcomputeVarUbLocal(scip, var);
22271  assert(SCIPsetIsLE(scip->set, lb, ub));
22272 
22273  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
22274  {
22275  *infeasible = TRUE;
22276  return SCIP_OKAY;
22277  }
22278  newbound = MAX(newbound, lb);
22279 
22280  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
22281  return SCIP_OKAY;
22282 
22283  switch( scip->set->stage )
22284  {
22285  case SCIP_STAGE_PROBLEM:
22286  assert(!SCIPvarIsTransformed(var));
22287  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22288  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22289  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22290  scip->branchcand, scip->eventqueue, newbound) );
22291  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22292  break;
22294  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22295  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22296  break;
22297  case SCIP_STAGE_PRESOLVING:
22298  if( !SCIPinProbing(scip) )
22299  {
22300  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22301  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22302 
22303  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22304  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22306 
22308  {
22309  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22310  assert(!(*infeasible));
22311  }
22312  break;
22313  }
22314  /*lint -fallthrough*/
22315  case SCIP_STAGE_SOLVING:
22317  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22318  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, FALSE) );
22319  break;
22320 
22321  default:
22322  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22323  return SCIP_INVALIDCALL;
22324  } /*lint !e788*/
22325 
22326  if( tightened != NULL )
22327  *tightened = TRUE;
22328 
22329  return SCIP_OKAY;
22330 }
22331 
22332 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
22333  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
22334  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
22335  *
22336  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
22337  * changes first the lowerbound by calling SCIPinferVarLbCons and second the upperbound by calling
22338  * SCIPinferVarUbCons
22339  *
22340  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
22341  * SCIPgetVars()) gets resorted.
22342  *
22343  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
22344  */
22346  SCIP* scip, /**< SCIP data structure */
22347  SCIP_VAR* var, /**< variable to change the bound for */
22348  SCIP_Real fixedval, /**< new value for fixation */
22349  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22350  int inferinfo, /**< user information for inference to help resolving the conflict */
22351  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22352  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22353  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22354  )
22355 {
22356  assert(scip != NULL);
22357  assert(var != NULL);
22358  assert(infeasible != NULL);
22359 
22360  SCIP_CALL( checkStage(scip, "SCIPinferVarFixCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22361 
22362  if( tightened != NULL )
22363  *tightened = FALSE;
22364 
22365  /* in presolving case we take the shortcut to directly fix the variables */
22366  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
22367  {
22368  SCIP_Bool fixed;
22369 
22370  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22371  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22372  fixedval, infeasible, &fixed) );
22373 
22374  if( tightened != NULL )
22375  *tightened = fixed;
22376  }
22377  /* otherwise we use the lb and ub methods */
22378  else
22379  {
22380  SCIP_Bool lbtightened;
22381 
22382  SCIP_CALL( SCIPinferVarLbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, &lbtightened) );
22383 
22384  if( ! (*infeasible) )
22385  {
22386  SCIP_CALL( SCIPinferVarUbCons(scip, var, fixedval, infercons, inferinfo, force, infeasible, tightened) );
22387 
22388  if( tightened != NULL )
22389  *tightened |= lbtightened;
22390  }
22391  }
22392 
22393  return SCIP_OKAY;
22394 }
22395 
22396 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
22397  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22398  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
22399  * for the deduction of the bound change
22400  *
22401  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22402  * SCIPgetVars()) gets resorted.
22403  *
22404  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22405  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22406  *
22407  * @pre This method can be called if @p scip is in one of the following stages:
22408  * - \ref SCIP_STAGE_PROBLEM
22409  * - \ref SCIP_STAGE_PRESOLVING
22410  * - \ref SCIP_STAGE_SOLVING
22411  *
22412  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22413  */
22415  SCIP* scip, /**< SCIP data structure */
22416  SCIP_VAR* var, /**< variable to change the bound for */
22417  SCIP_Real newbound, /**< new value for bound */
22418  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22419  int inferinfo, /**< user information for inference to help resolving the conflict */
22420  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22421  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22422  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22423  )
22424 {
22425  SCIP_Real lb;
22426  SCIP_Real ub;
22427 
22428  assert(infeasible != NULL);
22429 
22430  SCIP_CALL( checkStage(scip, "SCIPinferVarLbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22431 
22432  *infeasible = FALSE;
22433  if( tightened != NULL )
22434  *tightened = FALSE;
22435 
22436  SCIPvarAdjustLb(var, scip->set, &newbound);
22437 
22438  /* ignore tightenings of lower bounds to +infinity during solving process */
22439  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22440  {
22441 #ifndef NDEBUG
22442  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22443  SCIPvarGetLbLocal(var));
22444 #endif
22445  return SCIP_OKAY;
22446  }
22447 
22448  /* get current bounds */
22449  lb = SCIPvarGetLbLocal(var);
22450  ub = SCIPvarGetUbLocal(var);
22451  assert(SCIPsetIsLE(scip->set, lb, ub));
22452 
22453  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
22454  {
22455  *infeasible = TRUE;
22456  return SCIP_OKAY;
22457  }
22458  newbound = MIN(newbound, ub);
22459 
22460  if( (force && SCIPsetIsLE(scip->set, newbound, lb)) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
22461  return SCIP_OKAY;
22462 
22463  switch( scip->set->stage )
22464  {
22465  case SCIP_STAGE_PROBLEM:
22466  assert(!SCIPvarIsTransformed(var));
22467  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22468  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22469  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22470  scip->branchcand, scip->eventqueue, newbound) );
22471  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22472  break;
22473 
22474  case SCIP_STAGE_PRESOLVING:
22475  if( !SCIPinProbing(scip) )
22476  {
22477  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22478  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22479 
22480  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22481  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22483 
22485  {
22486  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22487  assert(!(*infeasible));
22488  }
22489  break;
22490  }
22491  /*lint -fallthrough*/
22492  case SCIP_STAGE_SOLVING:
22494  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22495  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
22496  break;
22497 
22498  default:
22499  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22500  return SCIP_INVALIDCALL;
22501  } /*lint !e788*/
22502 
22503  if( tightened != NULL )
22504  *tightened = TRUE;
22505 
22506  return SCIP_OKAY;
22507 }
22508 
22509 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
22510  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22511  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason
22512  * for the deduction of the bound change
22513  *
22514  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22515  * SCIPgetVars()) gets resorted.
22516  *
22517  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22518  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22519  *
22520  * @pre This method can be called if @p scip is in one of the following stages:
22521  * - \ref SCIP_STAGE_PROBLEM
22522  * - \ref SCIP_STAGE_PRESOLVING
22523  * - \ref SCIP_STAGE_SOLVING
22524  *
22525  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22526  */
22528  SCIP* scip, /**< SCIP data structure */
22529  SCIP_VAR* var, /**< variable to change the bound for */
22530  SCIP_Real newbound, /**< new value for bound */
22531  SCIP_CONS* infercons, /**< constraint that deduced the bound change */
22532  int inferinfo, /**< user information for inference to help resolving the conflict */
22533  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22534  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22535  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22536  )
22537 {
22538  SCIP_Real lb;
22539  SCIP_Real ub;
22540 
22541  assert(infeasible != NULL);
22542 
22543  SCIP_CALL( checkStage(scip, "SCIPinferVarUbCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22544 
22545  *infeasible = FALSE;
22546  if( tightened != NULL )
22547  *tightened = FALSE;
22548 
22549  SCIPvarAdjustUb(var, scip->set, &newbound);
22550 
22551  /* ignore tightenings of upper bounds to -infinity during solving process */
22552  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22553  {
22554 #ifndef NDEBUG
22555  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22556  SCIPvarGetUbLocal(var));
22557 #endif
22558  return SCIP_OKAY;
22559  }
22560 
22561  /* get current bounds */
22562  lb = SCIPvarGetLbLocal(var);
22563  ub = SCIPvarGetUbLocal(var);
22564  assert(SCIPsetIsLE(scip->set, lb, ub));
22565 
22566  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
22567  {
22568  *infeasible = TRUE;
22569  return SCIP_OKAY;
22570  }
22571  newbound = MAX(newbound, lb);
22572 
22573  if( (force && SCIPsetIsGE(scip->set, newbound, ub)) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
22574  return SCIP_OKAY;
22575 
22576  switch( scip->set->stage )
22577  {
22578  case SCIP_STAGE_PROBLEM:
22579  assert(!SCIPvarIsTransformed(var));
22580  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22581  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22582  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22583  scip->branchcand, scip->eventqueue, newbound) );
22584  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22585  break;
22586 
22587  case SCIP_STAGE_PRESOLVING:
22588  if( !SCIPinProbing(scip) )
22589  {
22590  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22591  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22592 
22593  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22594  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22596 
22598  {
22599  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22600  assert(!(*infeasible));
22601  }
22602  break;
22603  }
22604  /*lint -fallthrough*/
22605  case SCIP_STAGE_SOLVING:
22607  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22608  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
22609  break;
22610 
22611  default:
22612  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22613  return SCIP_INVALIDCALL;
22614  } /*lint !e788*/
22615 
22616  if( tightened != NULL )
22617  *tightened = TRUE;
22618 
22619  return SCIP_OKAY;
22620 }
22621 
22622 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
22623  * the given inference constraint is stored, such that the conflict analysis is able to find out the reason for the
22624  * deduction of the fixing
22625  *
22626  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22627  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22628  *
22629  * @pre This method can be called if @p scip is in one of the following stages:
22630  * - \ref SCIP_STAGE_PROBLEM
22631  * - \ref SCIP_STAGE_PRESOLVING
22632  * - \ref SCIP_STAGE_SOLVING
22633  */
22635  SCIP* scip, /**< SCIP data structure */
22636  SCIP_VAR* var, /**< binary variable to fix */
22637  SCIP_Bool fixedval, /**< value to fix binary variable to */
22638  SCIP_CONS* infercons, /**< constraint that deduced the fixing */
22639  int inferinfo, /**< user information for inference to help resolving the conflict */
22640  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
22641  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
22642  )
22643 {
22644  SCIP_Real lb;
22645  SCIP_Real ub;
22646 
22647  assert(SCIPvarIsBinary(var));
22648  assert(fixedval == TRUE || fixedval == FALSE);
22649  assert(infeasible != NULL);
22650 
22651  SCIP_CALL( checkStage(scip, "SCIPinferBinvarCons", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22652 
22653  *infeasible = FALSE;
22654  if( tightened != NULL )
22655  *tightened = FALSE;
22656 
22657  /* get current bounds */
22658  lb = SCIPvarGetLbLocal(var);
22659  ub = SCIPvarGetUbLocal(var);
22660  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
22661  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
22662  assert(SCIPsetIsLE(scip->set, lb, ub));
22663 
22664  /* check, if variable is already fixed */
22665  if( (lb > 0.5) || (ub < 0.5) )
22666  {
22667  *infeasible = (fixedval == (lb < 0.5));
22668 
22669  return SCIP_OKAY;
22670  }
22671 
22672  /* apply the fixing */
22673  switch( scip->set->stage )
22674  {
22675  case SCIP_STAGE_PROBLEM:
22676  assert(!SCIPvarIsTransformed(var));
22677  if( fixedval == TRUE )
22678  {
22679  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
22680  }
22681  else
22682  {
22683  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
22684  }
22685  break;
22686 
22687  case SCIP_STAGE_PRESOLVING:
22688  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
22689  {
22690  SCIP_Bool fixed;
22691 
22692  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22693  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22694  (SCIP_Real)fixedval, infeasible, &fixed) );
22695  break;
22696  }
22697  /*lint -fallthrough*/
22698  case SCIP_STAGE_SOLVING:
22699  if( fixedval == TRUE )
22700  {
22702  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22703  scip->cliquetable, var, 1.0, SCIP_BOUNDTYPE_LOWER, infercons, NULL, inferinfo, FALSE) );
22704  }
22705  else
22706  {
22708  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22709  scip->cliquetable, var, 0.0, SCIP_BOUNDTYPE_UPPER, infercons, NULL, inferinfo, FALSE) );
22710  }
22711  break;
22712 
22713  default:
22714  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22715  return SCIP_INVALIDCALL;
22716  } /*lint !e788*/
22717 
22718  if( tightened != NULL )
22719  *tightened = TRUE;
22720 
22721  return SCIP_OKAY;
22722 }
22723 
22724 /** fixes variable in preprocessing or in the current node, if the new bound is tighter (w.r.t. bound strengthening
22725  * epsilon) than the current bound; if possible, adjusts bound to integral value; the given inference constraint is
22726  * stored, such that the conflict analysis is able to find out the reason for the deduction of the bound change
22727  *
22728  * @note In presolving stage when not in probing mode the variable will be fixed directly, otherwise this method
22729  * changes first the lowerbound by calling SCIPinferVarLbProp and second the upperbound by calling
22730  * SCIPinferVarUbProp
22731  *
22732  * @note If SCIP is in presolving stage, it can happen that the internal variable array (which get be accessed via
22733  * SCIPgetVars()) gets resorted.
22734  *
22735  * @note During presolving, an integer variable which bound changes to {0,1} is upgraded to a binary variable.
22736  */
22738  SCIP* scip, /**< SCIP data structure */
22739  SCIP_VAR* var, /**< variable to change the bound for */
22740  SCIP_Real fixedval, /**< new value for fixation */
22741  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
22742  int inferinfo, /**< user information for inference to help resolving the conflict */
22743  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22744  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22745  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22746  )
22747 {
22748  assert(scip != NULL);
22749  assert(var != NULL);
22750  assert(infeasible != NULL);
22751 
22752  SCIP_CALL( checkStage(scip, "SCIPinferVarFixProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22753 
22754  if( tightened != NULL )
22755  *tightened = FALSE;
22756 
22757  /* in presolving case we take the shortcut to directly fix the variables */
22758  if( SCIPgetStage(scip) == SCIP_STAGE_PRESOLVING && SCIPtreeGetCurrentDepth(scip->tree) == 0 )
22759  {
22760  SCIP_Bool fixed;
22761 
22762  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
22763  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
22764  fixedval, infeasible, &fixed) );
22765 
22766  if( tightened != NULL )
22767  *tightened = fixed;
22768  }
22769  /* otherwise we use the lb and ub methods */
22770  else
22771  {
22772  SCIP_Bool lbtightened;
22773 
22774  SCIP_CALL( SCIPinferVarLbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, &lbtightened) );
22775 
22776  if( ! (*infeasible) )
22777  {
22778  SCIP_CALL( SCIPinferVarUbProp(scip, var, fixedval, inferprop, inferinfo, force, infeasible, tightened) );
22779 
22780  if( tightened != NULL )
22781  *tightened |= lbtightened;
22782  }
22783  }
22784 
22785  return SCIP_OKAY;
22786 }
22787 
22788 /** changes lower bound of variable in preprocessing or in the current node, if the new bound is tighter
22789  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22790  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
22791  * for the deduction of the bound change
22792  *
22793  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22794  * SCIPgetVars()) gets resorted.
22795  *
22796  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22797  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22798  *
22799  * @pre This method can be called if @p scip is in one of the following stages:
22800  * - \ref SCIP_STAGE_PROBLEM
22801  * - \ref SCIP_STAGE_PRESOLVING
22802  * - \ref SCIP_STAGE_SOLVING
22803  *
22804  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22805  */
22807  SCIP* scip, /**< SCIP data structure */
22808  SCIP_VAR* var, /**< variable to change the bound for */
22809  SCIP_Real newbound, /**< new value for bound */
22810  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
22811  int inferinfo, /**< user information for inference to help resolving the conflict */
22812  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22813  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22814  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22815  )
22816 {
22817  SCIP_Real lb;
22818  SCIP_Real ub;
22819 
22820  assert(infeasible != NULL);
22821 
22822  SCIP_CALL( checkStage(scip, "SCIPinferVarLbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22823 
22824  *infeasible = FALSE;
22825  if( tightened != NULL )
22826  *tightened = FALSE;
22827 
22828  SCIPvarAdjustLb(var, scip->set, &newbound);
22829 
22830  /* ignore tightenings of lower bounds to +infinity during solving process */
22831  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22832  {
22833 #ifndef NDEBUG
22834  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
22835  SCIPvarGetLbLocal(var));
22836 #endif
22837  return SCIP_OKAY;
22838  }
22839 
22840  /* get current bounds */
22841  lb = SCIPvarGetLbLocal(var);
22842  ub = SCIPvarGetUbLocal(var);
22843  assert(SCIPsetIsLE(scip->set, lb, ub));
22844 
22845  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
22846  {
22847  *infeasible = TRUE;
22848  return SCIP_OKAY;
22849  }
22850  newbound = MIN(newbound, ub);
22851 
22852  if( !force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub) )
22853  return SCIP_OKAY;
22854 
22855  switch( scip->set->stage )
22856  {
22857  case SCIP_STAGE_PROBLEM:
22858  assert(!SCIPvarIsTransformed(var));
22859  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22860  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22861  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22862  scip->branchcand, scip->eventqueue, newbound) );
22863  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
22864  break;
22865 
22866  case SCIP_STAGE_PRESOLVING:
22867  if( !SCIPinProbing(scip) )
22868  {
22869  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22870  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22871 
22872  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22873  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22875 
22877  {
22878  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22879  assert(!(*infeasible));
22880  }
22881  break;
22882  }
22883  /*lint -fallthrough*/
22884  case SCIP_STAGE_SOLVING:
22886  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
22887  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
22888  break;
22889 
22890  default:
22891  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
22892  return SCIP_INVALIDCALL;
22893  } /*lint !e788*/
22894 
22895  if( tightened != NULL )
22896  *tightened = TRUE;
22897 
22898  return SCIP_OKAY;
22899 }
22900 
22901 /** changes upper bound of variable in preprocessing or in the current node, if the new bound is tighter
22902  * (w.r.t. bound strengthening epsilon) than the current bound; if possible, adjusts bound to integral value;
22903  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason
22904  * for the deduction of the bound change
22905  *
22906  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
22907  * SCIPgetVars()) gets resorted.
22908  *
22909  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
22910  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
22911  *
22912  * @pre This method can be called if @p scip is in one of the following stages:
22913  * - \ref SCIP_STAGE_PROBLEM
22914  * - \ref SCIP_STAGE_PRESOLVING
22915  * - \ref SCIP_STAGE_SOLVING
22916  *
22917  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
22918  */
22920  SCIP* scip, /**< SCIP data structure */
22921  SCIP_VAR* var, /**< variable to change the bound for */
22922  SCIP_Real newbound, /**< new value for bound */
22923  SCIP_PROP* inferprop, /**< propagator that deduced the bound change */
22924  int inferinfo, /**< user information for inference to help resolving the conflict */
22925  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
22926  SCIP_Bool* infeasible, /**< pointer to store whether the bound change is infeasible */
22927  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
22928  )
22929 {
22930  SCIP_Real lb;
22931  SCIP_Real ub;
22932 
22933  assert(infeasible != NULL);
22934 
22935  SCIP_CALL( checkStage(scip, "SCIPinferVarUbProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
22936 
22937  *infeasible = FALSE;
22938  if( tightened != NULL )
22939  *tightened = FALSE;
22940 
22941  SCIPvarAdjustUb(var, scip->set, &newbound);
22942 
22943  /* ignore tightenings of upper bounds to -infinity during solving process */
22944  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
22945  {
22946 #ifndef NDEBUG
22947  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
22948  SCIPvarGetUbLocal(var));
22949 #endif
22950  return SCIP_OKAY;
22951  }
22952 
22953  /* get current bounds */
22954  lb = SCIPvarGetLbLocal(var);
22955  ub = SCIPvarGetUbLocal(var);
22956  assert(SCIPsetIsLE(scip->set, lb, ub));
22957 
22958  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
22959  {
22960  *infeasible = TRUE;
22961  return SCIP_OKAY;
22962  }
22963  newbound = MAX(newbound, lb);
22964 
22965  if( !force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub) )
22966  return SCIP_OKAY;
22967 
22968  switch( scip->set->stage )
22969  {
22970  case SCIP_STAGE_PROBLEM:
22971  assert(!SCIPvarIsTransformed(var));
22972  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22973  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
22974  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
22975  scip->branchcand, scip->eventqueue, newbound) );
22976  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
22977  break;
22978 
22979  case SCIP_STAGE_PRESOLVING:
22980  if( !SCIPinProbing(scip) )
22981  {
22982  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
22983  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
22984 
22985  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
22986  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
22988 
22990  {
22991  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
22992  assert(!(*infeasible));
22993  }
22994  break;
22995  }
22996  /*lint -fallthrough*/
22997  case SCIP_STAGE_SOLVING:
22999  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
23000  scip->cliquetable, var, newbound, SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
23001  break;
23002 
23003  default:
23004  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23005  return SCIP_INVALIDCALL;
23006  } /*lint !e788*/
23007 
23008  if( tightened != NULL )
23009  *tightened = TRUE;
23010 
23011  return SCIP_OKAY;
23012 }
23013 
23014 /** depending on SCIP's stage, fixes binary variable in the problem, in preprocessing, or in current node;
23015  * the given inference propagator is stored, such that the conflict analysis is able to find out the reason for the
23016  * deduction of the fixing
23017  *
23018  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23019  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23020  *
23021  * @pre This method can be called if @p scip is in one of the following stages:
23022  * - \ref SCIP_STAGE_PROBLEM
23023  * - \ref SCIP_STAGE_PRESOLVING
23024  * - \ref SCIP_STAGE_PRESOLVED
23025  * - \ref SCIP_STAGE_SOLVING
23026  */
23028  SCIP* scip, /**< SCIP data structure */
23029  SCIP_VAR* var, /**< binary variable to fix */
23030  SCIP_Bool fixedval, /**< value to fix binary variable to */
23031  SCIP_PROP* inferprop, /**< propagator that deduced the fixing */
23032  int inferinfo, /**< user information for inference to help resolving the conflict */
23033  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
23034  SCIP_Bool* tightened /**< pointer to store whether the fixing tightened the local bounds, or NULL */
23035  )
23036 {
23037  SCIP_Real lb;
23038  SCIP_Real ub;
23039 
23040  assert(SCIPvarIsBinary(var));
23041  assert(fixedval == TRUE || fixedval == FALSE);
23042  assert(infeasible != NULL);
23043 
23044  SCIP_CALL( checkStage(scip, "SCIPinferBinvarProp", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23045 
23046  *infeasible = FALSE;
23047  if( tightened != NULL )
23048  *tightened = FALSE;
23049 
23050  /* get current bounds */
23051  lb = SCIPvarGetLbLocal(var);
23052  ub = SCIPvarGetUbLocal(var);
23053  assert(SCIPsetIsEQ(scip->set, lb, 0.0) || SCIPsetIsEQ(scip->set, lb, 1.0));
23054  assert(SCIPsetIsEQ(scip->set, ub, 0.0) || SCIPsetIsEQ(scip->set, ub, 1.0));
23055  assert(SCIPsetIsLE(scip->set, lb, ub));
23056 
23057  /* check, if variable is already fixed */
23058  if( (lb > 0.5) || (ub < 0.5) )
23059  {
23060  *infeasible = (fixedval == (lb < 0.5));
23061 
23062  return SCIP_OKAY;
23063  }
23064 
23065  /* apply the fixing */
23066  switch( scip->set->stage )
23067  {
23068  case SCIP_STAGE_PROBLEM:
23069  assert(!SCIPvarIsTransformed(var));
23070  if( fixedval == TRUE )
23071  {
23072  SCIP_CALL( SCIPchgVarLb(scip, var, 1.0) );
23073  }
23074  else
23075  {
23076  SCIP_CALL( SCIPchgVarUb(scip, var, 0.0) );
23077  }
23078  break;
23079 
23080  case SCIP_STAGE_PRESOLVING:
23081  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
23082  {
23083  SCIP_Bool fixed;
23084 
23085  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23086  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
23087  (SCIP_Real)fixedval, infeasible, &fixed) );
23088  break;
23089  }
23090  /*lint -fallthrough*/
23091  case SCIP_STAGE_SOLVING:
23092  if( fixedval == TRUE )
23093  {
23095  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 1.0,
23096  SCIP_BOUNDTYPE_LOWER, NULL, inferprop, inferinfo, FALSE) );
23097  }
23098  else
23099  {
23101  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, 0.0,
23102  SCIP_BOUNDTYPE_UPPER, NULL, inferprop, inferinfo, FALSE) );
23103  }
23104  break;
23105 
23106  default:
23107  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23108  return SCIP_INVALIDCALL;
23109  } /*lint !e788*/
23110 
23111  if( tightened != NULL )
23112  *tightened = TRUE;
23113 
23114  return SCIP_OKAY;
23115 }
23116 
23117 /** changes global lower bound of variable in preprocessing or in the current node, if the new bound is tighter
23118  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
23119  * also tightens the local bound, if the global bound is better than the local bound
23120  *
23121  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23122  * SCIPgetVars()) gets resorted.
23123  *
23124  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23125  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23126  *
23127  * @pre This method can be called if @p scip is in one of the following stages:
23128  * - \ref SCIP_STAGE_PROBLEM
23129  * - \ref SCIP_STAGE_TRANSFORMING
23130  * - \ref SCIP_STAGE_PRESOLVING
23131  * - \ref SCIP_STAGE_SOLVING
23132  *
23133  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23134  */
23136  SCIP* scip, /**< SCIP data structure */
23137  SCIP_VAR* var, /**< variable to change the bound for */
23138  SCIP_Real newbound, /**< new value for bound */
23139  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23140  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
23141  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23142  )
23143 {
23144  SCIP_Real lb;
23145  SCIP_Real ub;
23146 
23147  assert(infeasible != NULL);
23148 
23149  SCIP_CALL( checkStage(scip, "SCIPtightenVarLbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23150 
23151  *infeasible = FALSE;
23152  if( tightened != NULL )
23153  *tightened = FALSE;
23154 
23155  SCIPvarAdjustLb(var, scip->set, &newbound);
23156 
23157  /* ignore tightenings of lower bounds to +infinity during solving process */
23158  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23159  {
23160 #ifndef NDEBUG
23161  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
23162  SCIPvarGetLbLocal(var));
23163 #endif
23164  return SCIP_OKAY;
23165  }
23166 
23167  /* get current bounds */
23168  lb = SCIPvarGetLbGlobal(var);
23169  ub = SCIPvarGetUbGlobal(var);
23170  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
23171 
23172  if( SCIPsetIsFeasGT(scip->set, newbound, ub) )
23173  {
23174  *infeasible = TRUE;
23175  return SCIP_OKAY;
23176  }
23177  newbound = MIN(newbound, ub);
23178 
23179  /* bound changes of less than epsilon are ignored by SCIPvarChgLb or raise an assert in SCIPnodeAddBoundinfer,
23180  * so don't apply them even if force is set
23181  */
23182  if( SCIPsetIsEQ(scip->set, lb, newbound) || (!force && !SCIPsetIsLbBetter(scip->set, newbound, lb, ub)) )
23183  return SCIP_OKAY;
23184 
23185  switch( scip->set->stage )
23186  {
23187  case SCIP_STAGE_PROBLEM:
23188  assert(!SCIPvarIsTransformed(var));
23189  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23190  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23191  SCIP_CALL( SCIPvarChgLbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23192  scip->branchcand, scip->eventqueue, newbound) );
23193  SCIP_CALL( SCIPvarChgLbOriginal(var, scip->set, newbound) );
23194  break;
23195 
23197  SCIP_CALL( SCIPvarChgLbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23198  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23199  break;
23200 
23201  case SCIP_STAGE_PRESOLVING:
23202  if( !SCIPinProbing(scip) )
23203  {
23204  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23205  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23206 
23207  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23208  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23210 
23212  {
23213  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23214  assert(!(*infeasible));
23215  }
23216  break;
23217  }
23218  /*lint -fallthrough*/
23219  case SCIP_STAGE_SOLVING:
23220  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23221  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23223  break;
23224 
23225  default:
23226  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23227  return SCIP_INVALIDCALL;
23228  } /*lint !e788*/
23229 
23230  /* coverity: unreachable code */
23231  if( tightened != NULL )
23232  *tightened = TRUE;
23233 
23234  return SCIP_OKAY;
23235 }
23236 
23237 /** changes global upper bound of variable in preprocessing or in the current node, if the new bound is tighter
23238  * (w.r.t. bound strengthening epsilon) than the current global bound; if possible, adjusts bound to integral value;
23239  * also tightens the local bound, if the global bound is better than the local bound
23240  *
23241  * @warning If SCIP is in presolving stage, it can happen that the internal variable array (which can be accessed via
23242  * SCIPgetVars()) gets resorted.
23243  *
23244  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23245  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23246  *
23247  * @pre This method can be called if @p scip is in one of the following stages:
23248  * - \ref SCIP_STAGE_PROBLEM
23249  * - \ref SCIP_STAGE_TRANSFORMING
23250  * - \ref SCIP_STAGE_PRESOLVING
23251  * - \ref SCIP_STAGE_SOLVING
23252  *
23253  * @note During presolving, an integer variable whose bound changes to {0,1} is upgraded to a binary variable.
23254  */
23256  SCIP* scip, /**< SCIP data structure */
23257  SCIP_VAR* var, /**< variable to change the bound for */
23258  SCIP_Real newbound, /**< new value for bound */
23259  SCIP_Bool force, /**< force tightening even if below bound strengthening tolerance */
23260  SCIP_Bool* infeasible, /**< pointer to store whether the new domain is empty */
23261  SCIP_Bool* tightened /**< pointer to store whether the bound was tightened, or NULL */
23262  )
23263 {
23264  SCIP_Real lb;
23265  SCIP_Real ub;
23266 
23267  assert(infeasible != NULL);
23268 
23269  SCIP_CALL( checkStage(scip, "SCIPtightenVarUbGlobal", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23270 
23271  *infeasible = FALSE;
23272  if( tightened != NULL )
23273  *tightened = FALSE;
23274 
23275  SCIPvarAdjustUb(var, scip->set, &newbound);
23276 
23277  /* ignore tightenings of upper bounds to -infinity during solving process */
23278  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
23279  {
23280 #ifndef NDEBUG
23281  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
23282  SCIPvarGetUbLocal(var));
23283 #endif
23284  return SCIP_OKAY;
23285  }
23286 
23287  /* get current bounds */
23288  lb = SCIPvarGetLbGlobal(var);
23289  ub = SCIPvarGetUbGlobal(var);
23290  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPsetIsLE(scip->set, lb, ub));
23291 
23292  if( SCIPsetIsFeasLT(scip->set, newbound, lb) )
23293  {
23294  *infeasible = TRUE;
23295  return SCIP_OKAY;
23296  }
23297  newbound = MAX(newbound, lb);
23298 
23299  /* bound changes of less than epsilon are ignored by SCIPvarChgUb or raise an assert in SCIPnodeAddBoundinfer,
23300  * so don't apply them even if force is set
23301  */
23302  if( SCIPsetIsEQ(scip->set, ub, newbound) || (!force && !SCIPsetIsUbBetter(scip->set, newbound, lb, ub)) )
23303  return SCIP_OKAY;
23304 
23305  switch( scip->set->stage )
23306  {
23307  case SCIP_STAGE_PROBLEM:
23308  assert(!SCIPvarIsTransformed(var));
23309  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23310  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23311  SCIP_CALL( SCIPvarChgUbLocal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23312  scip->branchcand, scip->eventqueue, newbound) );
23313  SCIP_CALL( SCIPvarChgUbOriginal(var, scip->set, newbound) );
23314  break;
23315 
23317  SCIP_CALL( SCIPvarChgUbGlobal(var, scip->mem->probmem, scip->set, scip->stat, scip->lp,
23318  scip->branchcand, scip->eventqueue, scip->cliquetable, newbound) );
23319  break;
23320 
23321  case SCIP_STAGE_PRESOLVING:
23322  if( !SCIPinProbing(scip) )
23323  {
23324  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
23325  assert(scip->tree->root == SCIPtreeGetCurrentNode(scip->tree));
23326 
23327  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23328  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23330 
23332  {
23333  SCIP_CALL( SCIPchgVarType(scip, var, SCIP_VARTYPE_BINARY, infeasible) );
23334  assert(!(*infeasible));
23335  }
23336  break;
23337  }
23338  /*lint -fallthrough*/
23339  case SCIP_STAGE_SOLVING:
23340  SCIP_CALL( SCIPnodeAddBoundchg(scip->tree->root, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23341  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, var, newbound,
23343  break;
23344 
23345  default:
23346  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
23347  return SCIP_INVALIDCALL;
23348  } /*lint !e788*/
23349 
23350  /* coverity: unreachable code */
23351  if( tightened != NULL )
23352  *tightened = TRUE;
23353 
23354  return SCIP_OKAY;
23355 }
23356 
23357 /* some simple variable functions implemented as defines */
23358 #undef SCIPcomputeVarLbGlobal
23359 #undef SCIPcomputeVarUbGlobal
23360 #undef SCIPcomputeVarLbLocal
23361 #undef SCIPcomputeVarUbLocal
23362 
23363 /** for a multi-aggregated variable, returns the global lower bound computed by adding the global bounds from all aggregation variables
23364  *
23365  * 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
23366  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbGlobal.
23367  *
23368  * @return the global lower bound computed by adding the global bounds from all aggregation variables
23369  */
23371  SCIP* scip, /**< SCIP data structure */
23372  SCIP_VAR* var /**< variable to compute the bound for */
23373  )
23374 {
23375  assert(scip != NULL);
23376  assert(var != NULL);
23377 
23379  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
23380  else
23381  return SCIPvarGetLbGlobal(var);
23382 }
23383 
23384 /** for a multi-aggregated variable, returns the global upper bound computed by adding the global bounds from all aggregation variables
23385  *
23386  * 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
23387  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbGlobal
23388  *
23389  * @return the global upper bound computed by adding the global bounds from all aggregation variables
23390  */
23392  SCIP* scip, /**< SCIP data structure */
23393  SCIP_VAR* var /**< variable to compute the bound for */
23394  )
23395 {
23396  assert(scip != NULL);
23397  assert(var != NULL);
23398 
23400  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
23401  else
23402  return SCIPvarGetUbGlobal(var);
23403 }
23404 
23405 /** for a multi-aggregated variable, returns the local lower bound computed by adding the local bounds from all aggregation variables
23406  *
23407  * 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
23408  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetLbLocal.
23409  *
23410  * @return the local lower bound computed by adding the global bounds from all aggregation variables
23411  */
23413  SCIP* scip, /**< SCIP data structure */
23414  SCIP_VAR* var /**< variable to compute the bound for */
23415  )
23416 {
23417  assert(scip != NULL);
23418  assert(var != NULL);
23419 
23421  return SCIPvarGetMultaggrLbLocal(var, scip->set);
23422  else
23423  return SCIPvarGetLbLocal(var);
23424 }
23425 
23426 /** for a multi-aggregated variable, returns the local upper bound computed by adding the local bounds from all aggregation variables
23427  *
23428  * 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
23429  * calling this function for a non-multi-aggregated variable results in a call to SCIPvarGetUbLocal.
23430  *
23431  * @return the local upper bound computed by adding the global bounds from all aggregation variables
23432  */
23434  SCIP* scip, /**< SCIP data structure */
23435  SCIP_VAR* var /**< variable to compute the bound for */
23436  )
23437 {
23438  assert(scip != NULL);
23439  assert(var != NULL);
23440 
23442  return SCIPvarGetMultaggrUbLocal(var, scip->set);
23443  else
23444  return SCIPvarGetUbLocal(var);
23445 }
23446 
23447 /** for a multi-aggregated variable, gives the global lower bound computed by adding the global bounds from all
23448  * aggregation variables, this global bound may be tighter than the one given by SCIPvarGetLbGlobal, since the latter is
23449  * not updated if bounds of aggregation variables are changing
23450  *
23451  * calling this function for a non-multi-aggregated variable is not allowed
23452  */
23454  SCIP* scip, /**< SCIP data structure */
23455  SCIP_VAR* var /**< variable to compute the bound for */
23456  )
23457 {
23458  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23459  return SCIPvarGetMultaggrLbGlobal(var, scip->set);
23460 }
23461 
23462 /** for a multi-aggregated variable, gives the global upper bound computed by adding the global bounds from all
23463  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbGlobal, since the latter is
23464  * not updated if bounds of aggregation variables are changing
23465  *
23466  * calling this function for a non-multi-aggregated variable is not allowed
23467  */
23469  SCIP* scip, /**< SCIP data structure */
23470  SCIP_VAR* var /**< variable to compute the bound for */
23471  )
23472 {
23473  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23474  return SCIPvarGetMultaggrUbGlobal(var, scip->set);
23475 }
23476 
23477 /** for a multi-aggregated variable, gives the local lower bound computed by adding the local bounds from all
23478  * aggregation variables, this lower bound may be tighter than the one given by SCIPvarGetLbLocal, since the latter is
23479  * not updated if bounds of aggregation variables are changing
23480  *
23481  * calling this function for a non-multi-aggregated variable is not allowed
23482  */
23484  SCIP* scip, /**< SCIP data structure */
23485  SCIP_VAR* var /**< variable to compute the bound for */
23486  )
23487 {
23488  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23489  return SCIPvarGetMultaggrLbLocal(var, scip->set);
23490 }
23491 
23492 /** for a multi-aggregated variable, gives the local upper bound computed by adding the local bounds from all
23493  * aggregation variables, this upper bound may be tighter than the one given by SCIPvarGetUbLocal, since the latter is
23494  * not updated if bounds of aggregation variables are changing
23495  *
23496  * calling this function for a non-multi-aggregated variable is not allowed
23497  */
23499  SCIP* scip, /**< SCIP data structure */
23500  SCIP_VAR* var /**< variable to compute the bound for */
23501  )
23502 {
23503  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_MULTAGGR);
23504  return SCIPvarGetMultaggrUbLocal(var, scip->set);
23505 }
23506 
23507 /** returns solution value and index of variable lower bound that is closest to the variable's value in the given primal
23508  * solution or current LP solution if no primal solution is given; returns an index of -1 if no variable lower bound is
23509  * available
23510  *
23511  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23512  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23513  *
23514  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
23515  */
23517  SCIP* scip, /**< SCIP data structure */
23518  SCIP_VAR* var, /**< active problem variable */
23519  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
23520  SCIP_Real* closestvlb, /**< pointer to store the value of the closest variable lower bound */
23521  int* closestvlbidx /**< pointer to store the index of the closest variable lower bound */
23522  )
23523 {
23524  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVlb", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23525 
23526  SCIPvarGetClosestVlb(var, sol, scip->set, scip->stat, closestvlb, closestvlbidx);
23527 
23528  return SCIP_OKAY;
23529 }
23530 
23531 /** returns solution value and index of variable upper bound that is closest to the variable's value in the given primal solution;
23532  * or current LP solution if no primal solution is given; returns an index of -1 if no variable upper bound is available
23533  *
23534  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23535  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23536  *
23537  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
23538  */
23540  SCIP* scip, /**< SCIP data structure */
23541  SCIP_VAR* var, /**< active problem variable */
23542  SCIP_SOL* sol, /**< primal solution, or NULL for LP solution */
23543  SCIP_Real* closestvub, /**< pointer to store the value of the closest variable lower bound */
23544  int* closestvubidx /**< pointer to store the index of the closest variable lower bound */
23545  )
23546 {
23547  SCIP_CALL( checkStage(scip, "SCIPgetVarClosestVub", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23548 
23549  SCIPvarGetClosestVub(var, sol, scip->set, scip->stat, closestvub, closestvubidx);
23550 
23551  return SCIP_OKAY;
23552 }
23553 
23554 /** informs variable x about a globally valid variable lower bound x >= b*z + d with integer variable z;
23555  * if z is binary, the corresponding valid implication for z is also added;
23556  * if z is non-continuous and 1/b not too small, the corresponding valid upper/lower bound
23557  * z <= (x-d)/b or z >= (x-d)/b (depending on the sign of of b) is added, too;
23558  * improves the global bounds of the variable and the vlb variable if possible
23559  *
23560  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23561  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23562  *
23563  * @pre This method can be called if @p scip is in one of the following stages:
23564  * - \ref SCIP_STAGE_PRESOLVING
23565  * - \ref SCIP_STAGE_PRESOLVED
23566  * - \ref SCIP_STAGE_SOLVING
23567  */
23569  SCIP* scip, /**< SCIP data structure */
23570  SCIP_VAR* var, /**< problem variable */
23571  SCIP_VAR* vlbvar, /**< variable z in x >= b*z + d */
23572  SCIP_Real vlbcoef, /**< coefficient b in x >= b*z + d */
23573  SCIP_Real vlbconstant, /**< constant d in x >= b*z + d */
23574  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
23575  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
23576  )
23577 {
23578  int nlocalbdchgs;
23579 
23580  SCIP_CALL( checkStage(scip, "SCIPaddVarVlb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23581 
23582  SCIP_CALL( SCIPvarAddVlb(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
23583  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vlbvar, vlbcoef, vlbconstant,
23584  TRUE, infeasible, &nlocalbdchgs) );
23585 
23586  *nbdchgs = nlocalbdchgs;
23587 
23588  /* 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
23589  * detected infeasibility
23590  */
23591  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vlbcoef) )
23592  {
23593  if( vlbcoef > 0.0 )
23594  {
23595  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
23596  SCIP_CALL( SCIPvarAddVub(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23597  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
23598  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
23599  }
23600  else
23601  {
23602  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
23603  SCIP_CALL( SCIPvarAddVlb(vlbvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23604  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vlbcoef,
23605  -vlbconstant/vlbcoef, TRUE, infeasible, &nlocalbdchgs) );
23606  }
23607  *nbdchgs += nlocalbdchgs;
23608  }
23609 
23610  return SCIP_OKAY;
23611 }
23612 
23613 /** informs variable x about a globally valid variable upper bound x <= b*z + d with integer variable z;
23614  * if z is binary, the corresponding valid implication for z is also added;
23615  * if z is non-continuous and 1/b not too small, the corresponding valid lower/upper bound
23616  * z >= (x-d)/b or z <= (x-d)/b (depending on the sign of of b) is added, too;
23617  * improves the global bounds of the variable and the vlb variable if possible
23618  *
23619  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23620  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23621  *
23622  * @pre This method can be called if @p scip is in one of the following stages:
23623  * - \ref SCIP_STAGE_PRESOLVING
23624  * - \ref SCIP_STAGE_PRESOLVED
23625  * - \ref SCIP_STAGE_SOLVING
23626  */
23628  SCIP* scip, /**< SCIP data structure */
23629  SCIP_VAR* var, /**< problem variable */
23630  SCIP_VAR* vubvar, /**< variable z in x <= b*z + d */
23631  SCIP_Real vubcoef, /**< coefficient b in x <= b*z + d */
23632  SCIP_Real vubconstant, /**< constant d in x <= b*z + d */
23633  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
23634  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
23635  )
23636 {
23637  int nlocalbdchgs;
23638 
23639  SCIP_CALL( checkStage(scip, "SCIPaddVarVub", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23640 
23641  SCIP_CALL( SCIPvarAddVub(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob, scip->tree,
23642  scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, vubvar, vubcoef, vubconstant, TRUE,
23643  infeasible, &nlocalbdchgs) );
23644 
23645  *nbdchgs = nlocalbdchgs;
23646 
23647  /* 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
23648  * detected infeasibility
23649  */
23650  if( !(*infeasible) && SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPisZero(scip, 1.0/vubcoef) )
23651  {
23652  if( vubcoef > 0.0 )
23653  {
23654  /* if b < 0, we have a variable lower bound: x >= b*z + d => z >= (x-d)/b */
23655  SCIP_CALL( SCIPvarAddVlb(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23656  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
23657  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
23658  }
23659  else
23660  {
23661  /* if b > 0, we have a variable upper bound: x >= b*z + d => z <= (x-d)/b */
23662  SCIP_CALL( SCIPvarAddVub(vubvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23663  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var, 1.0/vubcoef,
23664  -vubconstant/vubcoef, TRUE, infeasible, &nlocalbdchgs) );
23665  }
23666  *nbdchgs += nlocalbdchgs;
23667  }
23668 
23669  return SCIP_OKAY;
23670 }
23671 
23672 /** informs binary variable x about a globally valid implication: x == 0 or x == 1 ==> y <= b or y >= b;
23673  * also adds the corresponding implication or variable bound to the implied variable;
23674  * if the implication is conflicting, the variable is fixed to the opposite value;
23675  * if the variable is already fixed to the given value, the implication is performed immediately;
23676  * if the implication is redundant with respect to the variables' global bounds, it is ignored
23677  *
23678  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23679  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23680  *
23681  * @pre This method can be called if @p scip is in one of the following stages:
23682  * - \ref SCIP_STAGE_TRANSFORMED
23683  * - \ref SCIP_STAGE_PRESOLVING
23684  * - \ref SCIP_STAGE_PRESOLVED
23685  * - \ref SCIP_STAGE_SOLVING
23686  */
23688  SCIP* scip, /**< SCIP data structure */
23689  SCIP_VAR* var, /**< problem variable */
23690  SCIP_Bool varfixing, /**< FALSE if y should be added in implications for x == 0, TRUE for x == 1 */
23691  SCIP_VAR* implvar, /**< variable y in implication y <= b or y >= b */
23692  SCIP_BOUNDTYPE impltype, /**< type of implication y <= b (SCIP_BOUNDTYPE_UPPER)
23693  * or y >= b (SCIP_BOUNDTYPE_LOWER) */
23694  SCIP_Real implbound, /**< bound b in implication y <= b or y >= b */
23695  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
23696  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
23697  )
23698 {
23699  SCIP_CALL( checkStage(scip, "SCIPaddVarImplication", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23700 
23701  if ( nbdchgs != NULL )
23702  *nbdchgs = 0;
23703 
23704  if( !SCIPvarIsBinary(var) )
23705  {
23706  SCIPerrorMessage("can't add implication for nonbinary variable\n");
23707  return SCIP_INVALIDDATA;
23708  }
23709 
23710  /* transform implication containing two binary variables to clique */
23711  if( SCIPvarIsBinary(implvar) )
23712  {
23713  SCIP_VAR* vars[2];
23714  SCIP_Bool vals[2];
23715 
23716  assert(SCIPisFeasEQ(scip, implbound, 1.0) || SCIPisFeasZero(scip, implbound));
23717  assert((impltype == SCIP_BOUNDTYPE_UPPER) == SCIPisFeasZero(scip, implbound));
23718 
23719  vars[0] = var;
23720  vars[1] = implvar;
23721  vals[0] = varfixing;
23722  vals[1] = (impltype == SCIP_BOUNDTYPE_UPPER);
23723 
23724  SCIP_CALL( SCIPaddClique(scip, vars, vals, 2, FALSE, infeasible, nbdchgs) );
23725 
23726  return SCIP_OKAY;
23727  }
23728 
23729  /* the implication graph can only handle 'real' binary (SCIP_VARTYPE_BINARY) variables, therefore we transform the
23730  * implication in variable bounds, (lowerbound of y will be abbreviated by lby, upperbound equivlaent) the follwing
23731  * four cases are:
23732  *
23733  * 1. (x >= 1 => y >= b) => y >= (b - lby) * x + lby
23734  * 2. (x >= 1 => y <= b) => y <= (b - uby) * x + uby
23735  * 3. (x <= 0 => y >= b) => y >= (lby - b) * x + b
23736  * 4. (x <= 0 => y <= b) => y <= (uby - b) * x + b
23737  */
23738  if( SCIPvarGetType(var) != SCIP_VARTYPE_BINARY )
23739  {
23740  SCIP_Real lby;
23741  SCIP_Real uby;
23742 
23743  lby = SCIPvarGetLbGlobal(implvar);
23744  uby = SCIPvarGetUbGlobal(implvar);
23745 
23746  if( varfixing == TRUE )
23747  {
23748  if( impltype == SCIP_BOUNDTYPE_LOWER )
23749  {
23750  /* we return if the lower bound is infinity */
23751  if( SCIPisInfinity(scip, -lby) )
23752  return SCIP_OKAY;
23753 
23754  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23755  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
23756  implbound - lby, lby, TRUE, infeasible, nbdchgs) );
23757  }
23758  else
23759  {
23760  /* we return if the upper bound is infinity */
23761  if( SCIPisInfinity(scip, uby) )
23762  return SCIP_OKAY;
23763 
23764  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23765  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
23766  implbound - uby, uby, TRUE, infeasible, nbdchgs) );
23767  }
23768  }
23769  else
23770  {
23771  if( impltype == SCIP_BOUNDTYPE_LOWER )
23772  {
23773  /* we return if the lower bound is infinity */
23774  if( SCIPisInfinity(scip, -lby) )
23775  return SCIP_OKAY;
23776 
23777  SCIP_CALL( SCIPvarAddVlb(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23778  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
23779  lby - implbound, implbound, TRUE, infeasible, nbdchgs) );
23780  }
23781  else
23782  {
23783  /* we return if the upper bound is infinity */
23784  if( SCIPisInfinity(scip, uby) )
23785  return SCIP_OKAY;
23786 
23787  SCIP_CALL( SCIPvarAddVub(implvar, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23788  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, var,
23789  uby - implbound, implbound, TRUE, infeasible, nbdchgs) );
23790  }
23791  }
23792  }
23793  else
23794  {
23795  SCIP_CALL( SCIPvarAddImplic(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
23796  scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventqueue, varfixing, implvar, impltype,
23797  implbound, TRUE, infeasible, nbdchgs) );
23798  }
23799 
23800  return SCIP_OKAY;
23801 }
23802 
23803 /** adds a clique information to SCIP, stating that at most one of the given binary variables can be set to 1;
23804  * if a variable appears twice in the same clique, the corresponding implications are performed
23805  *
23806  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
23807  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
23808  *
23809  * @pre This method can be called if @p scip is in one of the following stages:
23810  * - \ref SCIP_STAGE_TRANSFORMED
23811  * - \ref SCIP_STAGE_PRESOLVING
23812  * - \ref SCIP_STAGE_PRESOLVED
23813  * - \ref SCIP_STAGE_SOLVING
23814  */
23816  SCIP* scip, /**< SCIP data structure */
23817  SCIP_VAR** vars, /**< binary variables in the clique from which at most one can be set to 1 */
23818  SCIP_Bool* values, /**< values of the variables in the clique; NULL to use TRUE for all vars */
23819  int nvars, /**< number of variables in the clique */
23820  SCIP_Bool isequation, /**< is the clique an equation or an inequality? */
23821  SCIP_Bool* infeasible, /**< pointer to store whether an infeasibility was detected */
23822  int* nbdchgs /**< pointer to store the number of performed bound changes, or NULL */
23823  )
23824 {
23825  SCIP_CALL( checkStage(scip, "SCIPaddClique", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
23826 
23827  *infeasible = FALSE;
23828  if( nbdchgs != NULL )
23829  *nbdchgs = 0;
23830 
23831  if( nvars > 1 )
23832  {
23833  /* add the clique to the clique table */
23834  SCIP_CALL( SCIPcliquetableAdd(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
23835  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, vars, values, nvars, isequation,
23836  infeasible, nbdchgs) );
23837  }
23838 
23839  return SCIP_OKAY;
23840 }
23841 
23842 /** relabels the given labels in-place in an increasing fashion: the first seen label is 0, the next label 1, etc...
23843  *
23844  * @note every label equal to -1 is treated as a previously unseen, unique label and gets a new ordered label.
23845  */
23846 static
23848  SCIP*const scip, /**< SCIP data structure */
23849  int* labels, /**< current labels that will be overwritten */
23850  int const nlabels, /**< number of variables in the clique */
23851  int* nclasses /**< pointer to store the total number of distinct labels */
23852  )
23853 {
23854  SCIP_HASHMAP* classidx2newlabel;
23855 
23856  int classidx;
23857  int i;
23858 
23859  SCIP_CALL( SCIPhashmapCreate(&classidx2newlabel, SCIPblkmem(scip), nlabels) );
23860 
23861  classidx = 0;
23862 
23863  /* loop over labels to create local class indices that obey the variable order */
23864  for( i = 0; i < nlabels; ++i )
23865  {
23866  int currentlabel = labels[i];
23867  int localclassidx;
23868 
23869  /* labels equal to -1 are stored as singleton classes */
23870  if( currentlabel == -1 )
23871  {
23872  ++classidx;
23873  localclassidx = classidx;
23874  }
23875  else
23876  {
23877  assert(currentlabel >= 0);
23878  /* look up the class index image in the hash map; if it is not stored yet, new class index is created and stored */
23879  if( !SCIPhashmapExists(classidx2newlabel, (void*)(size_t)currentlabel) )
23880  {
23881  ++classidx;
23882  localclassidx = classidx;
23883  SCIP_CALL( SCIPhashmapInsert(classidx2newlabel, (void*)(size_t)currentlabel, (void *)(size_t)classidx) );
23884  }
23885  else
23886  {
23887  localclassidx = (int)(size_t)SCIPhashmapGetImage(classidx2newlabel, (void*)(size_t)currentlabel);
23888  }
23889  }
23890  assert(localclassidx - 1 >= 0);
23891  assert(localclassidx - 1 <= i);
23892 
23893  /* indices start with zero, but we have an offset of 1 because we cannot store 0 in a hashmap */
23894  labels[i] = localclassidx - 1;
23895  }
23896 
23897  assert(classidx > 0);
23898  assert(classidx <= nlabels);
23899  *nclasses = classidx;
23900 
23901  SCIPhashmapFree(&classidx2newlabel);
23902 
23903  return SCIP_OKAY;
23904 }
23905 
23906 /** sort the variables w.r.t. the given labels; thereby ensure the current order of the variables with the same label. */
23907 static
23909  SCIP* scip, /**< SCIP data structure */
23910  SCIP_VAR** vars, /**< variable array */
23911  int* classlabels, /**< array that contains a class label for every variable */
23912  SCIP_VAR** sortedvars, /**< array to store variables after stable sorting */
23913  int* sortedindices, /**< array to store indices of sorted variables in the original vars array */
23914  int* classesstartposs, /**< starting position array for each label class (must have size nclasses + 1) */
23915  int nvars, /**< size of the vars arrays */
23916  int nclasses /**< number of label classes */
23917  )
23918 {
23919  SCIP_VAR*** varpointers;
23920  int** indexpointers;
23921  int* classcount;
23922 
23923  int nextpos;
23924  int c;
23925  int v;
23926 
23927  assert(scip != NULL);
23928  assert(vars != NULL);
23929  assert(sortedindices != NULL);
23930  assert(classesstartposs != NULL);
23931 
23932  assert(nvars == 0 || vars != NULL);
23933 
23934  if( nvars == 0 )
23935  return SCIP_OKAY;
23936 
23937  assert(classlabels != NULL);
23938  assert(nclasses > 0);
23939 
23940  /* we first count all class cardinalities and allocate temporary memory for a bucket sort */
23941  SCIP_CALL( SCIPallocBufferArray(scip, &classcount, nclasses) );
23942  BMSclearMemoryArray(classcount, nclasses);
23943 
23944  /* first we count for each class the number of elements */
23945  for( v = nvars - 1; v >= 0; --v )
23946  {
23947  assert(0 <= classlabels[v] && classlabels[v] < nclasses);
23948  ++(classcount[classlabels[v]]);
23949  }
23950 
23951 #ifndef NDEBUG
23952  BMSclearMemoryArray(sortedvars, nvars);
23953  BMSclearMemoryArray(sortedindices, nvars);
23954 #endif
23955  SCIP_CALL( SCIPallocBufferArray(scip, &varpointers, nclasses) );
23956  SCIP_CALL( SCIPallocBufferArray(scip, &indexpointers, nclasses) );
23957 
23958  nextpos = 0;
23959  /* now we initialize all start pointers for each class, so they will be ordered */
23960  for( c = 0; c < nclasses; ++c )
23961  {
23962  /* to reach the goal that all variables of each class will be standing next to each other we will initialize the
23963  * starting pointers for each class by adding the cardinality of each class to the last class starting pointer
23964  * e.g. class1 has 4 elements and class2 has 3 elements then the starting pointer for class1 will be the pointer
23965  * to sortedvars[0], the starting pointer to class2 will be the pointer to sortedvars[4] and to class3 it will be
23966  * the pointer to sortedvars[7]
23967  */
23968  varpointers[c] = (SCIP_VAR**) (sortedvars + nextpos);
23969  indexpointers[c] = (int*) (sortedindices + nextpos);
23970  classesstartposs[c] = nextpos;
23971  assert(classcount[c] > 0);
23972  nextpos += classcount[c];
23973  assert(nextpos > 0);
23974  }
23975  assert(nextpos == nvars);
23976  classesstartposs[c] = nextpos;
23977 
23978  /* now we copy all variables to the right order */
23979  for( v = 0; v < nvars; ++v )
23980  {
23981  /* copy variable itself to the right position */
23982  *(varpointers[classlabels[v]]) = vars[v]; /*lint !e613*/
23983  ++(varpointers[classlabels[v]]);
23984 
23985  /* copy index */
23986  *(indexpointers[classlabels[v]]) = v;
23987  ++(indexpointers[classlabels[v]]);
23988  }
23989 
23990 /* in debug mode, we ensure the correctness of the mapping */
23991 #ifndef NDEBUG
23992  for( v = 0; v < nvars; ++v )
23993  {
23994  assert(sortedvars[v] != NULL);
23995  assert(sortedindices[v] >= 0);
23996 
23997  /* assert that the sorted indices map back to the correct variable in the original order */
23998  assert(vars[sortedindices[v]] == sortedvars[v]);
23999  }
24000 #endif
24001 
24002  /* free temporary memory */
24003  SCIPfreeBufferArray(scip, &indexpointers);
24004  SCIPfreeBufferArray(scip, &varpointers);
24005  SCIPfreeBufferArray(scip, &classcount);
24006 
24007  return SCIP_OKAY;
24008 }
24009 
24010 
24011 /* calculate clique partition for a maximal amount of comparisons on variables due to expensive algorithm
24012  * @todo: check for a good value, maybe it's better to check parts of variables
24013  */
24014 #define MAXNCLIQUEVARSCOMP 1000000
24015 
24016 /** calculates a partition of the given set of binary variables into cliques;
24017  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24018  * were assigned to the same clique;
24019  * the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of
24020  * the preceding variables was assigned to clique i-1;
24021  * for each clique at most 1 variables can be set to TRUE in a feasible solution;
24022  *
24023  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24024  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24025  *
24026  * @pre This method can be called if @p scip is in one of the following stages:
24027  * - \ref SCIP_STAGE_INITPRESOLVE
24028  * - \ref SCIP_STAGE_PRESOLVING
24029  * - \ref SCIP_STAGE_EXITPRESOLVE
24030  * - \ref SCIP_STAGE_PRESOLVED
24031  * - \ref SCIP_STAGE_SOLVING
24032  */
24033 static
24035  SCIP*const scip, /**< SCIP data structure */
24036  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24037  SCIP_Bool*const values, /**< clique value (TRUE or FALSE) for each variable in the clique */
24038  int const nvars, /**< number of variables in the array */
24039  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24040  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24041  )
24042 {
24043  SCIP_VAR** cliquevars;
24044  SCIP_Bool* cliquevalues;
24045  int i;
24046  int maxncliquevarscomp;
24047  int ncliquevars;
24048 
24049 
24050 
24051  /* allocate temporary memory for storing the variables of the current clique */
24052  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevars, nvars) );
24053  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &cliquevalues, nvars) );
24054 
24055  /* initialize the cliquepartition array with -1 */
24056  for( i = nvars - 1; i >= 0; --i )
24057  cliquepartition[i] = -1;
24058 
24059  maxncliquevarscomp = (int) MIN(nvars * (SCIP_Longint)nvars, MAXNCLIQUEVARSCOMP);
24060  /* calculate the clique partition */
24061  *ncliques = 0;
24062  for( i = 0; i < nvars; ++i )
24063  {
24064  if( cliquepartition[i] == -1 )
24065  {
24066  int j;
24067 
24068  /* variable starts a new clique */
24069  cliquepartition[i] = *ncliques;
24070  cliquevars[0] = vars[i];
24071  cliquevalues[0] = values[i];
24072  ncliquevars = 1;
24073 
24074  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
24075  if( SCIPvarIsActive(vars[i]) && SCIPvarGetNCliques(vars[i], values[i]) > 0 )
24076  {
24077  /* greedily fill up the clique */
24078  for( j = i+1; j < nvars; ++j )
24079  {
24080  /* if variable is not active (multi-aggregated or fixed), it cannot be in any clique */
24081  if( cliquepartition[j] == -1 && SCIPvarIsActive(vars[j]) )
24082  {
24083  int k;
24084 
24085  /* check if every variable in the current clique can be extended by tmpvars[j] */
24086  for( k = ncliquevars - 1; k >= 0; --k )
24087  {
24088  if( !SCIPvarsHaveCommonClique(vars[j], values[j], cliquevars[k], cliquevalues[k], TRUE) )
24089  break;
24090  }
24091 
24092  if( k == -1 )
24093  {
24094  /* put the variable into the same clique */
24095  cliquepartition[j] = cliquepartition[i];
24096  cliquevars[ncliquevars] = vars[j];
24097  cliquevalues[ncliquevars] = values[j];
24098  ++ncliquevars;
24099  }
24100  }
24101  }
24102  }
24103 
24104  /* this clique is finished */
24105  ++(*ncliques);
24106  }
24107  assert(cliquepartition[i] >= 0 && cliquepartition[i] < i+1);
24108 
24109  /* break if we reached the maximal number of comparisons */
24110  if( i * nvars > maxncliquevarscomp )
24111  break;
24112  }
24113  /* if we had to many variables fill up the cliquepartition and put each variable in a separate clique */
24114  for( ; i < nvars; ++i )
24115  {
24116  if( cliquepartition[i] == -1 )
24117  {
24118  cliquepartition[i] = *ncliques;
24119  ++(*ncliques);
24120  }
24121  }
24122 
24123  SCIPsetFreeBufferArray(scip->set, &cliquevalues);
24124  SCIPsetFreeBufferArray(scip->set, &cliquevars);
24125 
24126  return SCIP_OKAY;
24127 }
24128 
24129 /** calculates a partition of the given set of binary variables into cliques; takes into account independent clique components
24130  *
24131  * The algorithm performs the following steps:
24132  * - recomputes connected components of the clique table, if necessary
24133  * - computes a clique partition for every connected component greedily.
24134  * - relabels the resulting clique partition such that it satisfies the description below
24135  *
24136  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24137  * were assigned to the same clique;
24138  * the first variable is always assigned to clique 0, and a variable can only be assigned to clique i if at least one of
24139  * the preceding variables was assigned to clique i-1;
24140  * for each clique at most 1 variables can be set to TRUE in a feasible solution;
24141  *
24142  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24143  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24144  *
24145  * @pre This method can be called if @p scip is in one of the following stages:
24146  * - \ref SCIP_STAGE_INITPRESOLVE
24147  * - \ref SCIP_STAGE_PRESOLVING
24148  * - \ref SCIP_STAGE_EXITPRESOLVE
24149  * - \ref SCIP_STAGE_PRESOLVED
24150  * - \ref SCIP_STAGE_SOLVING
24151  */
24153  SCIP*const scip, /**< SCIP data structure */
24154  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24155  int const nvars, /**< number of variables in the clique */
24156  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24157  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24158  )
24159 {
24160  SCIP_VAR** tmpvars;
24161 
24162  SCIP_VAR** sortedtmpvars;
24163  SCIP_Bool* tmpvalues;
24164  SCIP_Bool* sortedtmpvalues;
24165  int* componentlabels;
24166  int* sortedindices;
24167  int* componentstartposs;
24168  int i;
24169  int c;
24170 
24171  int ncomponents;
24172 
24173  assert(scip != NULL);
24174  assert(nvars == 0 || vars != NULL);
24175  assert(nvars == 0 || cliquepartition != NULL);
24176  assert(ncliques != NULL);
24177 
24178  SCIP_CALL( checkStage(scip, "SCIPcalcCliquePartition", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24179 
24180  if( nvars == 0 )
24181  {
24182  *ncliques = 0;
24183  return SCIP_OKAY;
24184  }
24185 
24186  /* early abort if neither cliques nor implications are present */
24187  if( SCIPgetNCliques(scip) == 0 && SCIPgetNImplications(scip) == 0 )
24188  {
24189  for( i = nvars - 1; i >= 0; --i )
24190  cliquepartition[i] = i;
24191 
24192  *ncliques = nvars;
24193 
24194  return SCIP_OKAY;
24195  }
24196 
24197 
24198  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &tmpvalues, nvars) );
24199  SCIP_CALL( SCIPsetDuplicateBufferArray(scip->set, &tmpvars, vars, nvars) );
24200  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &componentlabels, nvars) );
24201  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedindices, nvars) );
24202 
24203  /* initialize the tmpvalues array */
24204  for( i = nvars - 1; i >= 0; --i )
24205  {
24206  tmpvalues[i] = TRUE;
24207  cliquepartition[i] = -1;
24208  }
24209 
24210  /* get corresponding active problem variables */
24211  SCIP_CALL( SCIPvarsGetProbvarBinary(&tmpvars, &tmpvalues, nvars) );
24212 
24213  ncomponents = -1;
24214 
24215  /* update clique components if necessary */
24217  {
24218  SCIP_VAR** allvars;
24219  int nallbinvars;
24220  int nallintvars;
24221  int nallimplvars;
24222 
24223  SCIP_CALL( SCIPgetVarsData(scip, &allvars, NULL, &nallbinvars, &nallintvars, &nallimplvars, NULL) );
24224 
24225  SCIP_CALL( SCIPcliquetableComputeCliqueComponents(scip->cliquetable, scip->set, allvars, nallbinvars, nallintvars, nallimplvars) );
24226  }
24227 
24229 
24230  /* store the global clique component labels */
24231  for( i = 0; i < nvars; ++i )
24232  {
24233  if( SCIPvarIsActive(tmpvars[i]) )
24234  componentlabels[i] = SCIPvarGetCliqueComponentIdx(tmpvars[i]);
24235  else
24236  componentlabels[i] = -1;
24237  }
24238 
24239  /* relabel component labels order consistent as prerequisite for a stable sort */
24240  SCIP_CALL( relabelOrderConsistent(scip, componentlabels, nvars, &ncomponents) );
24241  assert(ncomponents >= 1);
24242  assert(ncomponents <= nvars);
24243 
24244  /* allocate storage array for the starting positions of the components */
24245  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &componentstartposs, ncomponents + 1) );
24246 
24247  /* stable sort the variables w.r.t. the component labels so that we can restrict the quadratic algorithm to the components */
24248  if( ncomponents > 1 )
24249  {
24250  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedtmpvars, nvars) );
24251  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &sortedtmpvalues, nvars) );
24252  SCIP_CALL( labelSortStable(scip, tmpvars, componentlabels, sortedtmpvars, sortedindices, componentstartposs, nvars, ncomponents) );
24253 
24254  /* reassign the tmpvalues with respect to the sorting */
24255  for( i = 0; i < nvars; ++i )
24256  {
24257  assert(tmpvars[sortedindices[i]] == sortedtmpvars[i]);
24258  sortedtmpvalues[i] = tmpvalues[sortedindices[i]];
24259  }
24260  }
24261  else
24262  {
24263  /* if we have only one large connected component, skip the stable sorting and prepare the data differently */
24264  sortedtmpvars = tmpvars;
24265  sortedtmpvalues = tmpvalues;
24266  componentstartposs[0] = 0;
24267  componentstartposs[1] = nvars;
24268 
24269  /* sorted indices are the identity */
24270  for( i = 0; i < nvars; ++i )
24271  sortedindices[i] = i;
24272  }
24273 
24274  *ncliques = 0;
24275  /* calculate a greedy clique partition for each connected component */
24276  for( c = 0; c < ncomponents; ++c )
24277  {
24278  int* localcliquepartition;
24279  int nlocalcliques;
24280  int ncomponentvars;
24281  int l;
24282 
24283  /* extract the number of variables in this connected component */
24284  ncomponentvars = componentstartposs[c + 1] - componentstartposs[c];
24285  nlocalcliques = 0;
24286 
24287  /* allocate necessary memory to hold the intermediate component clique partition */
24288  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &localcliquepartition, ncomponentvars) );
24289 
24290  /* call greedy clique algorithm for all component variables */
24291  SCIP_CALL( calcCliquePartitionGreedy(scip, &(sortedtmpvars[componentstartposs[c]]), &(sortedtmpvalues[componentstartposs[c]]),
24292  ncomponentvars, localcliquepartition, &nlocalcliques) );
24293 
24294  assert(nlocalcliques >= 1);
24295  assert(nlocalcliques <= ncomponentvars);
24296 
24297  /* store the obtained clique partition with an offset of ncliques for the original variables */
24298  for( l = componentstartposs[c]; l < componentstartposs[c + 1]; ++l )
24299  {
24300  int origvaridx = sortedindices[l];
24301  assert(cliquepartition[origvaridx] == -1);
24302  assert(localcliquepartition[l - componentstartposs[c]] <= l - componentstartposs[c]);
24303  cliquepartition[origvaridx] = localcliquepartition[l - componentstartposs[c]] + (*ncliques);
24304  }
24305  *ncliques += nlocalcliques;
24306 
24307  /* free the local clique partition */
24308  SCIPsetFreeBufferArray(scip->set, &localcliquepartition);
24309  }
24310 
24311  /* except in the two trivial cases, we have to ensure the order consistency of the partition indices */
24312  if( ncomponents > 1 && ncomponents < nvars )
24313  {
24314  int partitionsize;
24315  SCIP_CALL( relabelOrderConsistent(scip, cliquepartition, nvars, &partitionsize) );
24316 
24317  assert(partitionsize == *ncliques);
24318  }
24319 
24320  if( ncomponents > 1 )
24321  {
24322  SCIPsetFreeBufferArray(scip->set, &sortedtmpvalues);
24323  SCIPsetFreeBufferArray(scip->set, &sortedtmpvars);
24324  }
24325 
24326  /* use the greedy algorithm as a whole to verify the result on small number of variables */
24327 #ifdef SCIP_DISABLED_CODE
24328  {
24329  int* debugcliquepartition;
24330  int ndebugcliques;
24331 
24332  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &debugcliquepartition, nvars) );
24333 
24334  /* call greedy clique algorithm for all component variables */
24335  SCIP_CALL( calcCliquePartitionGreedy(scip, tmpvars, tmpvalues, nvars, debugcliquepartition, &ndebugcliques) );
24336 
24337  /* loop and compare the traditional greedy clique with */
24338  for( i = 0; i < nvars; ++i )
24339  assert(i * nvars > MAXNCLIQUEVARSCOMP || cliquepartition[i] == debugcliquepartition[i]);
24340 
24341  SCIPsetFreeBufferArray(scip->set, &debugcliquepartition);
24342  }
24343 #endif
24344 
24345  /* free temporary memory */
24346  SCIPsetFreeBufferArray(scip->set, &componentstartposs);
24347  SCIPsetFreeBufferArray(scip->set, &sortedindices);
24348  SCIPsetFreeBufferArray(scip->set, &componentlabels);
24349  SCIPsetFreeBufferArray(scip->set, &tmpvars);
24350  SCIPsetFreeBufferArray(scip->set, &tmpvalues);
24351 
24352  return SCIP_OKAY;
24353 }
24354 
24355 /** calculates a partition of the given set of binary variables into negated cliques;
24356  * afterwards the output array contains one value for each variable, such that two variables got the same value iff they
24357  * were assigned to the same negated clique;
24358  * the first variable is always assigned to clique 0 and a variable can only be assigned to clique i if at least one of
24359  * the preceding variables was assigned to clique i-1;
24360  * for each clique with n_c variables at least n_c-1 variables can be set to TRUE in a feasible solution;
24361  *
24362  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24363  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24364  *
24365  * @pre This method can be called if @p scip is in one of the following stages:
24366  * - \ref SCIP_STAGE_INITPRESOLVE
24367  * - \ref SCIP_STAGE_PRESOLVING
24368  * - \ref SCIP_STAGE_EXITPRESOLVE
24369  * - \ref SCIP_STAGE_PRESOLVED
24370  * - \ref SCIP_STAGE_SOLVING
24371  */
24373  SCIP*const scip, /**< SCIP data structure */
24374  SCIP_VAR**const vars, /**< binary variables in the clique from which at most one can be set to 1 */
24375  int const nvars, /**< number of variables in the clique */
24376  int*const cliquepartition, /**< array of length nvars to store the clique partition */
24377  int*const ncliques /**< pointer to store the number of cliques actually contained in the partition */
24378  )
24379 {
24380  SCIP_VAR** negvars;
24381  int v;
24382 
24383  assert(scip != NULL);
24384  assert(cliquepartition != NULL || nvars == 0);
24385  assert(ncliques != NULL);
24386 
24387  if( nvars == 0 )
24388  {
24389  *ncliques = 0;
24390  return SCIP_OKAY;
24391  }
24392  assert(vars != NULL);
24393 
24394  /* allocate temporary memory */
24395  SCIP_CALL( SCIPsetAllocBufferArray(scip->set, &negvars, nvars) );
24396 
24397  /* get all negated variables */
24398  for( v = nvars - 1; v >= 0; --v )
24399  {
24400  SCIP_CALL( SCIPgetNegatedVar(scip, vars[v], &(negvars[v])) );
24401  }
24402 
24403  /* calculate cliques on negated variables, which are "negated" cliques on normal variables array */
24404  SCIP_CALL( SCIPcalcCliquePartition( scip, negvars, nvars, cliquepartition, ncliques) );
24405 
24406  /* free temporary memory */
24407  SCIPsetFreeBufferArray(scip->set, &negvars);
24408 
24409  return SCIP_OKAY;
24410 }
24411 
24412 
24413 /** force SCIP to clean up all cliques; cliques do not get automatically cleaned up after presolving. Use
24414  * this method to prevent inactive variables in cliques when retrieved via SCIPgetCliques()
24415  *
24416  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
24417  *
24418  * @pre This method can be called if @p scip is in one of the following stages:
24419  * - \ref SCIP_STAGE_TRANSFORMED
24420  * - \ref SCIP_STAGE_INITPRESOLVE
24421  * - \ref SCIP_STAGE_PRESOLVING
24422  * - \ref SCIP_STAGE_EXITPRESOLVE
24423  * - \ref SCIP_STAGE_PRESOLVED
24424  * - \ref SCIP_STAGE_INITSOLVE
24425  * - \ref SCIP_STAGE_SOLVING
24426  * - \ref SCIP_STAGE_SOLVED
24427  * - \ref SCIP_STAGE_EXITSOLVE
24428  */
24430  SCIP* scip, /**< SCIP data structure */
24431  SCIP_Bool* infeasible /**< pointer to store if cleanup detected infeasibility */
24432  )
24433 {
24434  int nlocalbdchgs;
24435  SCIP_Bool globalinfeasibility;
24436 
24437  SCIP_CALL_ABORT( checkStage(scip, "SCIPcleanupCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24438 
24439  globalinfeasibility = FALSE;
24440  nlocalbdchgs = 0;
24441  SCIP_CALL( SCIPcliquetableCleanup(scip->cliquetable, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
24442  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, &nlocalbdchgs,
24443  &globalinfeasibility) );
24444 
24445  if( infeasible != NULL )
24446  *infeasible = globalinfeasibility;
24447 
24448  if( globalinfeasibility )
24450 
24451  return SCIP_OKAY;
24452 }
24453 
24454 /** gets the number of cliques in the clique table
24455  *
24456  * @return number of cliques in the clique table
24457  *
24458  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24459  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24460  *
24461  * @pre This method can be called if @p scip is in one of the following stages:
24462  * - \ref SCIP_STAGE_TRANSFORMED
24463  * - \ref SCIP_STAGE_INITPRESOLVE
24464  * - \ref SCIP_STAGE_PRESOLVING
24465  * - \ref SCIP_STAGE_EXITPRESOLVE
24466  * - \ref SCIP_STAGE_PRESOLVED
24467  * - \ref SCIP_STAGE_INITSOLVE
24468  * - \ref SCIP_STAGE_SOLVING
24469  * - \ref SCIP_STAGE_SOLVED
24470  * - \ref SCIP_STAGE_EXITSOLVE
24471  */
24473  SCIP* scip /**< SCIP data structure */
24474  )
24475 {
24476  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24477 
24479 }
24480 
24481 /** gets the array of cliques in the clique table
24482  *
24483  * @return array of cliques in the clique table
24484  *
24485  * @note cliques do not get automatically cleaned up after presolving. Use SCIPcleanupCliques()
24486  * to prevent inactive variables in cliques when retrieved via SCIPgetCliques(). This might reduce the number of cliques
24487  *
24488  * @pre This method can be called if @p scip is in one of the following stages:
24489  * - \ref SCIP_STAGE_TRANSFORMED
24490  * - \ref SCIP_STAGE_INITPRESOLVE
24491  * - \ref SCIP_STAGE_PRESOLVING
24492  * - \ref SCIP_STAGE_EXITPRESOLVE
24493  * - \ref SCIP_STAGE_PRESOLVED
24494  * - \ref SCIP_STAGE_INITSOLVE
24495  * - \ref SCIP_STAGE_SOLVING
24496  * - \ref SCIP_STAGE_SOLVED
24497  * - \ref SCIP_STAGE_EXITSOLVE
24498  */
24500  SCIP* scip /**< SCIP data structure */
24501  )
24502 {
24503  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCliques", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24504 
24505  return SCIPcliquetableGetCliques(scip->cliquetable);
24506 }
24507 
24508 /** returns whether there is a clique that contains both given variable/value pairs;
24509  * the variables must be active binary variables;
24510  * if regardimplics is FALSE, only the cliques in the clique table are looked at;
24511  * if regardimplics is TRUE, both the cliques and the implications of the implication graph are regarded
24512  *
24513  * @return TRUE, if there is a clique that contains both variable/clique pairs; FALSE, otherwise
24514  *
24515  * @pre This method can be called if @p scip is in one of the following stages:
24516  * - \ref SCIP_STAGE_TRANSFORMED
24517  * - \ref SCIP_STAGE_INITPRESOLVE
24518  * - \ref SCIP_STAGE_PRESOLVING
24519  * - \ref SCIP_STAGE_EXITPRESOLVE
24520  * - \ref SCIP_STAGE_PRESOLVED
24521  * - \ref SCIP_STAGE_INITSOLVE
24522  * - \ref SCIP_STAGE_SOLVING
24523  * - \ref SCIP_STAGE_SOLVED
24524  * - \ref SCIP_STAGE_EXITSOLVE
24525  *
24526  * @note a variable with it's negated variable are NOT! in a clique
24527  * @note a variable with itself are in a clique
24528  */
24530  SCIP* scip, /**< SCIP data structure */
24531  SCIP_VAR* var1, /**< first variable */
24532  SCIP_Bool value1, /**< value of first variable */
24533  SCIP_VAR* var2, /**< second variable */
24534  SCIP_Bool value2, /**< value of second variable */
24535  SCIP_Bool regardimplics /**< should the implication graph also be searched for a clique? */
24536  )
24537 {
24538  assert(scip != NULL);
24539  assert(var1 != NULL);
24540  assert(var2 != NULL);
24541  assert(SCIPvarIsActive(var1));
24542  assert(SCIPvarIsActive(var2));
24543  assert(SCIPvarIsBinary(var1));
24544  assert(SCIPvarIsBinary(var2));
24545 
24546  SCIP_CALL_ABORT( checkStage(scip, "SCIPhaveVarsCommonClique", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24547 
24548  /* if both variables together have more cliques then actual cliques exist, then they have a common clique (in debug
24549  * mode we check this for correctness), otherwise we need to call the pairwise comparison method for these variables
24550  */
24551 #ifndef NDEBUG
24552  assert((SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)) ? SCIPvarsHaveCommonClique(var1, value1, var2, value2, FALSE) : TRUE);
24553 #endif
24554 
24555  return (SCIPvarGetNCliques(var1, value1) + SCIPvarGetNCliques(var2, value2) > SCIPcliquetableGetNCliques(scip->cliquetable)
24556  || SCIPvarsHaveCommonClique(var1, value1, var2, value2, regardimplics));
24557 }
24558 
24559 
24560 /** writes the clique graph to a gml file
24561  *
24562  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24563  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24564  *
24565  * @pre This method can be called if @p scip is in one of the following stages:
24566  * - \ref SCIP_STAGE_TRANSFORMED
24567  * - \ref SCIP_STAGE_INITPRESOLVE
24568  * - \ref SCIP_STAGE_PRESOLVING
24569  * - \ref SCIP_STAGE_EXITPRESOLVE
24570  * - \ref SCIP_STAGE_PRESOLVED
24571  * - \ref SCIP_STAGE_INITSOLVE
24572  * - \ref SCIP_STAGE_SOLVING
24573  * - \ref SCIP_STAGE_SOLVED
24574  * - \ref SCIP_STAGE_EXITSOLVE
24575  *
24576  * @note there can be duplicated arcs in the output file
24577  *
24578  * If @p writenodeweights is true, only nodes corresponding to variables that have a fractional value and only edges
24579  * between such nodes are written.
24580  */
24582  SCIP* scip, /**< SCIP data structure */
24583  const char* fname, /**< name of file */
24584  SCIP_Bool writenodeweights /**< should we write weights of nodes? */
24585  )
24586 {
24587  FILE* gmlfile;
24588  SCIP_HASHMAP* nodehashmap;
24589  SCIP_CLIQUE** cliques;
24590  SCIP_VAR** clqvars;
24591  SCIP_VAR** allvars;
24592  SCIP_Bool* clqvalues;
24593  char nodename[SCIP_MAXSTRLEN];
24594  int nallvars;
24595  int nbinvars;
24596  int nintvars;
24597  int nimplvars;
24598  int ncliques;
24599  int c;
24600  int v1;
24601  int v2;
24602  int id1;
24603  int id2;
24604 
24605  assert(scip != NULL);
24606  assert(fname != NULL);
24607 
24608  SCIP_CALL_ABORT( checkStage(scip, "SCIPwriteCliqueGraph", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24609 
24610  /* get all active variables */
24611  SCIP_CALL( SCIPgetVarsData(scip, &allvars, &nallvars, &nbinvars, &nintvars, &nimplvars, NULL) );
24612 
24613  /* no possible variables for cliques exist */
24614  if( nbinvars + nimplvars == 0 )
24615  return SCIP_OKAY;
24616 
24617  ncliques = SCIPgetNCliques(scip);
24618 
24619  /* no cliques and do not wont to check for binary implications */
24620  if( ncliques == 0 )
24621  return SCIP_OKAY;
24622 
24623  /* open gml file */
24624  gmlfile = fopen(fname, "w");
24625 
24626  if( gmlfile == NULL )
24627  {
24628  SCIPerrorMessage("cannot open graph file <%s>\n", fname);
24629  SCIPABORT();
24630  return SCIP_INVALIDDATA; /*lint !e527*/
24631  }
24632 
24633  /* create the hash map */
24634  SCIP_CALL( SCIPhashmapCreate(&nodehashmap, SCIPblkmem(scip), nbinvars+nimplvars) );
24635 
24636  /* write starting of gml file */
24637  SCIPgmlWriteOpening(gmlfile, TRUE);
24638 
24639  cliques = SCIPgetCliques(scip);
24640 
24641  /* write nodes and arcs for all cliques */
24642  for( c = ncliques - 1; c >= 0; --c )
24643  {
24644  clqvalues = SCIPcliqueGetValues(cliques[c]);
24645  clqvars = SCIPcliqueGetVars(cliques[c]);
24646 
24647  for( v1 = SCIPcliqueGetNVars(cliques[c]) - 1; v1 >= 0; --v1 )
24648  {
24649  id1 = clqvalues[v1] ? SCIPvarGetProbindex(clqvars[v1]) : (nallvars + SCIPvarGetProbindex(clqvars[v1]));
24650 
24651  /* if corresponding node was not added yet, add it */
24652  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id1) )
24653  {
24654  assert(id1 >= 0);
24655  SCIP_CALL_FINALLY( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id1, (void*)(size_t) 1), fclose(gmlfile) );
24656 
24657  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id1 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v1]));
24658 
24659  /* write new gml node for new variable */
24660  if ( writenodeweights )
24661  {
24662  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v1])) )
24663  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v1]));
24664  }
24665  else
24666  {
24667  SCIPgmlWriteNode(gmlfile, (unsigned int)id1, nodename, NULL, NULL, NULL);
24668  }
24669  }
24670 
24671  for( v2 = SCIPcliqueGetNVars(cliques[c]) - 1; v2 >= 0; --v2 )
24672  {
24673  if( v1 == v2 )
24674  continue;
24675 
24676  id2 = clqvalues[v2] ? SCIPvarGetProbindex(clqvars[v2]) : (nallvars + SCIPvarGetProbindex(clqvars[v2]));
24677 
24678  /* if corresponding node was not added yet, add it */
24679  if( !SCIPhashmapExists(nodehashmap, (void*)(size_t)id2) )
24680  {
24681  assert(id2 >= 0);
24682  SCIP_CALL_FINALLY( SCIPhashmapInsert(nodehashmap, (void*)(size_t)id2, (void*)(size_t) 1), fclose(gmlfile) );
24683 
24684  (void) SCIPsnprintf(nodename, SCIP_MAXSTRLEN, "%s%s", (id2 >= nallvars ? "~" : ""), SCIPvarGetName(clqvars[v2]));
24685 
24686  /* write new gml node for new variable */
24687  if ( writenodeweights )
24688  {
24689  if ( ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
24690  SCIPgmlWriteNodeWeight(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL, SCIPgetSolVal(scip, NULL, clqvars[v2]));
24691  }
24692  else
24693  {
24694  SCIPgmlWriteNode(gmlfile, (unsigned int)id2, nodename, NULL, NULL, NULL);
24695  }
24696  }
24697 
24698  /* write gml arc between resultant and operand */
24699  if ( ! writenodeweights || ! SCIPisFeasIntegral(scip, SCIPgetSolVal(scip, NULL, clqvars[v2])) )
24700  SCIPgmlWriteArc(gmlfile, (unsigned int)id1, (unsigned int)id2, NULL, NULL);
24701  }
24702  }
24703  }
24704 
24705  /* free the hash map */
24706  SCIPhashmapFree(&nodehashmap);
24707 
24708  SCIPgmlWriteClosing(gmlfile);
24709  fclose(gmlfile);
24710 
24711  return SCIP_OKAY;
24712 }
24713 
24714 /** Removes (irrelevant) variable from all its global structures, i.e. cliques, implications and variable bounds.
24715  * This is an advanced method which should be used with care.
24716  *
24717  * @return SCIP_OKAY if everything worked, otherwise a suitable error code is passed
24718  *
24719  * @pre This method can be called if @p scip is in one of the following stages:
24720  * - \ref SCIP_STAGE_TRANSFORMED
24721  * - \ref SCIP_STAGE_INITPRESOLVE
24722  * - \ref SCIP_STAGE_PRESOLVING
24723  * - \ref SCIP_STAGE_EXITPRESOLVE
24724  * - \ref SCIP_STAGE_PRESOLVED
24725  * - \ref SCIP_STAGE_INITSOLVE
24726  * - \ref SCIP_STAGE_SOLVING
24727  * - \ref SCIP_STAGE_SOLVED
24728  * - \ref SCIP_STAGE_EXITSOLVE
24729  */
24731  SCIP* scip, /**< SCIP data structure */
24732  SCIP_VAR* var /**< variable to remove from global structures */
24733  )
24734 {
24735  assert(scip != NULL);
24736 
24737  SCIP_CALL_ABORT( checkStage(scip, "SCIPremoveVarFromGlobalStructures", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
24738 
24739  /* mark the variable as deletable from global structures - This is necessary for the delayed clean up of cliques */
24741 
24742  /* remove variable from all its cliques, implications, and variable bounds */
24744 
24745  return SCIP_OKAY;
24746 }
24747 
24748 /** sets the branch factor of the variable; this value can be used in the branching methods to scale the score
24749  * values of the variables; higher factor leads to a higher probability that this variable is chosen for branching
24750  *
24751  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24752  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24753  *
24754  * @pre This method can be called if @p scip is in one of the following stages:
24755  * - \ref SCIP_STAGE_PROBLEM
24756  * - \ref SCIP_STAGE_TRANSFORMING
24757  * - \ref SCIP_STAGE_TRANSFORMED
24758  * - \ref SCIP_STAGE_INITPRESOLVE
24759  * - \ref SCIP_STAGE_PRESOLVING
24760  * - \ref SCIP_STAGE_EXITPRESOLVE
24761  * - \ref SCIP_STAGE_PRESOLVED
24762  * - \ref SCIP_STAGE_SOLVING
24763  */
24765  SCIP* scip, /**< SCIP data structure */
24766  SCIP_VAR* var, /**< problem variable */
24767  SCIP_Real branchfactor /**< factor to weigh variable's branching score with */
24768  )
24769 {
24770  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24771 
24772  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, branchfactor) );
24773 
24774  return SCIP_OKAY;
24775 }
24776 
24777 /** scales the branch factor of the variable with the given value
24778  *
24779  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24780  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24781  *
24782  * @pre This method can be called if @p scip is in one of the following stages:
24783  * - \ref SCIP_STAGE_PROBLEM
24784  * - \ref SCIP_STAGE_TRANSFORMING
24785  * - \ref SCIP_STAGE_TRANSFORMED
24786  * - \ref SCIP_STAGE_INITPRESOLVE
24787  * - \ref SCIP_STAGE_PRESOLVING
24788  * - \ref SCIP_STAGE_EXITPRESOLVE
24789  * - \ref SCIP_STAGE_PRESOLVED
24790  * - \ref SCIP_STAGE_SOLVING
24791  */
24793  SCIP* scip, /**< SCIP data structure */
24794  SCIP_VAR* var, /**< problem variable */
24795  SCIP_Real scale /**< factor to scale variable's branching factor with */
24796  )
24797 {
24798  SCIP_CALL( checkStage(scip, "SCIPscaleVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24799 
24800  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, scale * SCIPvarGetBranchFactor(var)) );
24801 
24802  return SCIP_OKAY;
24803 }
24804 
24805 /** adds the given value to the branch factor of the variable
24806  *
24807  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24808  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24809  *
24810  * @pre This method can be called if @p scip is in one of the following stages:
24811  * - \ref SCIP_STAGE_PROBLEM
24812  * - \ref SCIP_STAGE_TRANSFORMING
24813  * - \ref SCIP_STAGE_TRANSFORMED
24814  * - \ref SCIP_STAGE_INITPRESOLVE
24815  * - \ref SCIP_STAGE_PRESOLVING
24816  * - \ref SCIP_STAGE_EXITPRESOLVE
24817  * - \ref SCIP_STAGE_PRESOLVED
24818  * - \ref SCIP_STAGE_SOLVING
24819  */
24821  SCIP* scip, /**< SCIP data structure */
24822  SCIP_VAR* var, /**< problem variable */
24823  SCIP_Real addfactor /**< value to add to the branch factor of the variable */
24824  )
24825 {
24826  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchFactor", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24827 
24828  SCIP_CALL( SCIPvarChgBranchFactor(var, scip->set, addfactor + SCIPvarGetBranchFactor(var)) );
24829 
24830  return SCIP_OKAY;
24831 }
24832 
24833 /** sets the branch priority of the variable; variables with higher branch priority are always preferred to variables
24834  * with lower priority in selection of branching variable
24835  *
24836  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24837  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24838  *
24839  * @pre This method can be called if @p scip is in one of the following stages:
24840  * - \ref SCIP_STAGE_PROBLEM
24841  * - \ref SCIP_STAGE_TRANSFORMING
24842  * - \ref SCIP_STAGE_TRANSFORMED
24843  * - \ref SCIP_STAGE_INITPRESOLVE
24844  * - \ref SCIP_STAGE_PRESOLVING
24845  * - \ref SCIP_STAGE_EXITPRESOLVE
24846  * - \ref SCIP_STAGE_PRESOLVED
24847  * - \ref SCIP_STAGE_SOLVING
24848  *
24849  * @note the default branching priority is 0
24850  */
24852  SCIP* scip, /**< SCIP data structure */
24853  SCIP_VAR* var, /**< problem variable */
24854  int branchpriority /**< branch priority of the variable */
24855  )
24856 {
24857  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24858 
24859  assert( var->scip == scip );
24860 
24861  if( SCIPisTransformed(scip) )
24862  {
24863  assert(scip->branchcand != NULL);
24864 
24865  /* inform the pseudo branch candidates that the branch priority changes and change the branch priority */
24866  SCIP_CALL( SCIPbranchcandUpdateVarBranchPriority(scip->branchcand, scip->set, var, branchpriority) );
24867  }
24868  else
24869  {
24870  /* change the branching priority of the variable */
24871  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
24872  }
24873 
24874  return SCIP_OKAY;
24875 }
24876 
24877 /** changes the branch priority of the variable to the given value, if it is larger than the current priority
24878  *
24879  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24880  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24881  *
24882  * @pre This method can be called if @p scip is in one of the following stages:
24883  * - \ref SCIP_STAGE_PROBLEM
24884  * - \ref SCIP_STAGE_TRANSFORMING
24885  * - \ref SCIP_STAGE_TRANSFORMED
24886  * - \ref SCIP_STAGE_INITPRESOLVE
24887  * - \ref SCIP_STAGE_PRESOLVING
24888  * - \ref SCIP_STAGE_EXITPRESOLVE
24889  * - \ref SCIP_STAGE_PRESOLVED
24890  * - \ref SCIP_STAGE_SOLVING
24891  */
24893  SCIP* scip, /**< SCIP data structure */
24894  SCIP_VAR* var, /**< problem variable */
24895  int branchpriority /**< new branch priority of the variable, if it is larger than current priority */
24896  )
24897 {
24898  SCIP_CALL( checkStage(scip, "SCIPupdateVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24899 
24900  assert( var->scip == scip );
24901 
24902  if( branchpriority > SCIPvarGetBranchPriority(var) )
24903  {
24904  SCIP_CALL( SCIPvarChgBranchPriority(var, branchpriority) );
24905  }
24906 
24907  return SCIP_OKAY;
24908 }
24909 
24910 /** adds the given value to the branch priority of the variable
24911  *
24912  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24913  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24914  *
24915  * @pre This method can be called if @p scip is in one of the following stages:
24916  * - \ref SCIP_STAGE_PROBLEM
24917  * - \ref SCIP_STAGE_TRANSFORMING
24918  * - \ref SCIP_STAGE_TRANSFORMED
24919  * - \ref SCIP_STAGE_INITPRESOLVE
24920  * - \ref SCIP_STAGE_PRESOLVING
24921  * - \ref SCIP_STAGE_EXITPRESOLVE
24922  * - \ref SCIP_STAGE_PRESOLVED
24923  * - \ref SCIP_STAGE_SOLVING
24924  */
24926  SCIP* scip, /**< SCIP data structure */
24927  SCIP_VAR* var, /**< problem variable */
24928  int addpriority /**< value to add to the branch priority of the variable */
24929  )
24930 {
24931  SCIP_CALL( checkStage(scip, "SCIPaddVarBranchPriority", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24932 
24933  assert( var->scip == scip );
24934 
24935  SCIP_CALL( SCIPvarChgBranchPriority(var, addpriority + SCIPvarGetBranchPriority(var)) );
24936 
24937  return SCIP_OKAY;
24938 }
24939 
24940 /** sets the branch direction of the variable (-1: prefer downwards branch, 0: automatic selection, +1: prefer upwards
24941  * branch)
24942  *
24943  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
24944  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
24945  *
24946  * @pre This method can be called if @p scip is in one of the following stages:
24947  * - \ref SCIP_STAGE_PROBLEM
24948  * - \ref SCIP_STAGE_TRANSFORMING
24949  * - \ref SCIP_STAGE_TRANSFORMED
24950  * - \ref SCIP_STAGE_INITPRESOLVE
24951  * - \ref SCIP_STAGE_PRESOLVING
24952  * - \ref SCIP_STAGE_EXITPRESOLVE
24953  * - \ref SCIP_STAGE_PRESOLVED
24954  * - \ref SCIP_STAGE_SOLVING
24955  */
24957  SCIP* scip, /**< SCIP data structure */
24958  SCIP_VAR* var, /**< problem variable */
24959  SCIP_BRANCHDIR branchdirection /**< preferred branch direction of the variable (downwards, upwards, auto) */
24960  )
24961 {
24962  SCIP_CALL( checkStage(scip, "SCIPchgVarBranchDirection", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
24963 
24964  assert( var->scip == scip );
24965 
24966  SCIP_CALL( SCIPvarChgBranchDirection(var, branchdirection) );
24967 
24968  return SCIP_OKAY;
24969 }
24970 
24971 /** tightens the variable bounds due a new variable type */
24972 static
24974  SCIP* scip, /**< SCIP data structure */
24975  SCIP_VAR* var, /**< variable to change the bound for */
24976  SCIP_VARTYPE vartype, /**< new type of variable */
24977  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
24978  * integrality condition of the new variable type) */
24979  )
24980 {
24981  assert(scip != NULL);
24983  assert(scip->set->stage == SCIP_STAGE_PROBLEM || SCIPvarIsTransformed(var));
24984  assert(var->scip == scip);
24985 
24986  *infeasible = FALSE;
24987 
24988  /* adjusts bounds if the variable type changed form continuous to non-continuous (integral) */
24990  {
24991  SCIP_Bool tightened;
24992 
24993  /* we adjust variable bounds to integers first, since otherwise a later bound tightening with a fractional old
24994  * bound may give an assert because SCIP expects non-continuous variables to have non-fractional bounds
24995  *
24996  * we adjust bounds with a fractionality within [eps,feastol] only if the resulting bound change is a bound
24997  * tightening, because relaxing bounds may not be allowed
24998  */
24999  if( !SCIPisFeasIntegral(scip, SCIPvarGetLbGlobal(var)) ||
25001  )
25002  {
25003  SCIP_CALL( SCIPtightenVarLbGlobal(scip, var, SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var)), TRUE, infeasible, &tightened) );
25004  if( *infeasible )
25005  return SCIP_OKAY;
25006 
25007  /* 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
25008  * 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
25009  */
25010  assert(tightened || SCIPisFeasLE(scip, SCIPvarGetUbGlobal(var), SCIPfeasCeil(scip, SCIPvarGetLbGlobal(var))));
25011  }
25012  if( !SCIPisFeasIntegral(scip, SCIPvarGetUbGlobal(var)) ||
25014  )
25015  {
25016  SCIP_CALL( SCIPtightenVarUbGlobal(scip, var, SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var)), TRUE, infeasible, &tightened) );
25017  if( *infeasible )
25018  return SCIP_OKAY;
25019 
25020  assert(tightened || SCIPisFeasGE(scip, SCIPvarGetLbGlobal(var), SCIPfeasFloor(scip, SCIPvarGetUbGlobal(var))));
25021  }
25022  }
25023 
25024  return SCIP_OKAY;
25025 }
25026 
25027 /** changes type of variable in the problem;
25028  *
25029  * @warning This type change might change the variable array returned from SCIPgetVars() and SCIPgetVarsData();
25030  *
25031  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25032  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25033  *
25034  * @pre This method can be called if @p scip is in one of the following stages:
25035  * - \ref SCIP_STAGE_PROBLEM
25036  * - \ref SCIP_STAGE_TRANSFORMING
25037  * - \ref SCIP_STAGE_PRESOLVING
25038  *
25039  * @note If SCIP is already beyond the SCIP_STAGE_PROBLEM and a original variable is passed, the variable type of the
25040  * corresponding transformed variable is changed; the type of the original variable does not change
25041  *
25042  * @note If the type changes from a continuous variable to a non-continuous variable the bounds of the variable get
25043  * adjusted w.r.t. to integrality information
25044  */
25046  SCIP* scip, /**< SCIP data structure */
25047  SCIP_VAR* var, /**< variable to change the bound for */
25048  SCIP_VARTYPE vartype, /**< new type of variable */
25049  SCIP_Bool* infeasible /**< pointer to store whether an infeasibility was detected (, due to
25050  * integrality condition of the new variable type) */
25051  )
25052 {
25053  SCIP_CALL( checkStage(scip, "SCIPchgVarType", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25054 
25055  assert(var != NULL);
25056  assert(var->scip == scip);
25057 
25058  if( SCIPvarIsNegated(var) )
25059  {
25060  SCIPdebugMsg(scip, "upgrading type of negated variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
25061  var = SCIPvarGetNegationVar(var);
25062  }
25063 #ifndef NDEBUG
25064  else
25065  {
25066  if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
25067  {
25068  SCIPdebugMsg(scip, "upgrading type of variable <%s> from %d to %d\n", SCIPvarGetName(var), SCIPvarGetType(var), vartype);
25069  }
25070  }
25071 #endif
25072 
25073  /* change variable type */
25074  switch( scip->set->stage )
25075  {
25076  case SCIP_STAGE_PROBLEM:
25077  assert(!SCIPvarIsTransformed(var));
25078 
25079  /* first adjust the variable due to new integrality information */
25080  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
25081 
25082  /* second change variable type */
25083  if( SCIPvarGetProbindex(var) >= 0 )
25084  {
25085  SCIP_CALL( SCIPprobChgVarType(scip->origprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
25086  }
25087  else
25088  {
25089  SCIP_CALL( SCIPvarChgType(var, vartype) );
25090  }
25091  break;
25092 
25093  case SCIP_STAGE_PRESOLVING:
25094  if( !SCIPvarIsTransformed(var) )
25095  {
25096  SCIP_VAR* transvar;
25097 
25098  SCIP_CALL( SCIPgetTransformedVar(scip, var, &transvar) );
25099  assert(transvar != NULL);
25100 
25101  /* recall method with transformed variable */
25102  SCIP_CALL( SCIPchgVarType(scip, transvar, vartype, infeasible) );
25103  return SCIP_OKAY;
25104  }
25105 
25106  /* first adjust the variable due to new integrality information */
25107  SCIP_CALL( tightenBounds(scip, var, vartype, infeasible) );
25108 
25109  /* second change variable type */
25110  if( SCIPvarGetProbindex(var) >= 0 )
25111  {
25112  SCIP_CALL( SCIPprobChgVarType(scip->transprob, scip->mem->probmem, scip->set, scip->branchcand, scip->cliquetable, var, vartype) );
25113  }
25114  else
25115  {
25116  SCIP_CALL( SCIPvarChgType(var, vartype) );
25117  }
25118  break;
25119 
25120  default:
25121  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
25122  return SCIP_INVALIDCALL;
25123  } /*lint !e788*/
25124 
25125  return SCIP_OKAY;
25126 }
25127 
25128 /** in problem creation and solving stage, both bounds of the variable are set to the given value;
25129  * in presolving stage, the variable is converted into a fixed variable, and bounds are changed respectively;
25130  * conversion into a fixed variable changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
25131  * and also renders arrays returned from the SCIPvarGetImpl...() methods invalid
25132  *
25133  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25134  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25135  *
25136  * @pre This method can be called if @p scip is in one of the following stages:
25137  * - \ref SCIP_STAGE_PROBLEM
25138  * - \ref SCIP_STAGE_PRESOLVING
25139  * - \ref SCIP_STAGE_SOLVING
25140  */
25142  SCIP* scip, /**< SCIP data structure */
25143  SCIP_VAR* var, /**< variable to fix */
25144  SCIP_Real fixedval, /**< value to fix variable to */
25145  SCIP_Bool* infeasible, /**< pointer to store whether the fixing is infeasible */
25146  SCIP_Bool* fixed /**< pointer to store whether the fixing was performed (variable was unfixed) */
25147  )
25148 {
25149  assert(var != NULL);
25150  assert(infeasible != NULL);
25151  assert(fixed != NULL);
25152 
25153  SCIP_CALL( checkStage(scip, "SCIPfixVar", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
25154 
25155  *infeasible = FALSE;
25156  *fixed = FALSE;
25157 
25158  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds */
25159  if( scip->set->stage != SCIP_STAGE_PROBLEM )
25160  {
25161  if( (SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS && !SCIPsetIsFeasIntegral(scip->set, fixedval))
25162  || SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetLbLocal(var))
25163  || SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
25164  {
25165  *infeasible = TRUE;
25166  return SCIP_OKAY;
25167  }
25168  else if( SCIPvarGetStatus(var) == SCIP_VARSTATUS_FIXED )
25169  {
25170  *infeasible = !SCIPsetIsFeasEQ(scip->set, fixedval, SCIPvarGetLbLocal(var));
25171  return SCIP_OKAY;
25172  }
25173  }
25174  else
25175  assert(SCIPvarGetStatus(var) == SCIP_VARSTATUS_ORIGINAL);
25176 
25177  switch( scip->set->stage )
25178  {
25179  case SCIP_STAGE_PROBLEM:
25180  /* in the problem creation stage, modify the bounds as requested, independently from the current bounds;
25181  * we have to make sure, that the order of the bound changes does not intermediately produce an invalid
25182  * interval lb > ub
25183  */
25184  if( fixedval <= SCIPvarGetLbLocal(var) )
25185  {
25186  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25187  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25188  *fixed = TRUE;
25189  }
25190  else
25191  {
25192  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25193  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25194  *fixed = TRUE;
25195  }
25196  return SCIP_OKAY;
25197 
25198  case SCIP_STAGE_PRESOLVING:
25199  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
25200  {
25201  SCIP_CALL( SCIPvarFix(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25202  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25203  fixedval, infeasible, fixed) );
25204  return SCIP_OKAY;
25205  }
25206  /*lint -fallthrough*/
25207  case SCIP_STAGE_SOLVING:
25208  if( SCIPsetIsFeasGT(scip->set, fixedval, SCIPvarGetLbLocal(var)) )
25209  {
25210  SCIP_CALL( SCIPchgVarLb(scip, var, fixedval) );
25211  *fixed = TRUE;
25212  }
25213  if( SCIPsetIsFeasLT(scip->set, fixedval, SCIPvarGetUbLocal(var)) )
25214  {
25215  SCIP_CALL( SCIPchgVarUb(scip, var, fixedval) );
25216  *fixed = TRUE;
25217  }
25218  return SCIP_OKAY;
25219 
25220  default:
25221  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
25222  return SCIP_INVALIDCALL;
25223  } /*lint !e788*/
25224 }
25225 
25226 /** From a given equality a*x + b*y == c, aggregates one of the variables and removes it from the set of
25227  * active problem variables. This changes the vars array returned from SCIPgetVars() and SCIPgetVarsData(),
25228  * and also renders the arrays returned from the SCIPvarGetImpl...() methods for the two variables invalid.
25229  * In the first step, the equality is transformed into an equality with active problem variables
25230  * a'*x' + b'*y' == c'. If x' == y', this leads to the detection of redundancy if a' == -b' and c' == 0,
25231  * of infeasibility, if a' == -b' and c' != 0, or to a variable fixing x' == c'/(a'+b') (and possible
25232  * infeasibility) otherwise.
25233  * In the second step, the variable to be aggregated is chosen among x' and y', prefering a less strict variable
25234  * type as aggregation variable (i.e. continuous variables are preferred over implicit integers, implicit integers
25235  * over integers, and integers over binaries). If none of the variables is continuous, it is tried to find an integer
25236  * aggregation (i.e. integral coefficients a'' and b'', such that a''*x' + b''*y' == c''). This can lead to
25237  * the detection of infeasibility (e.g. if c'' is fractional), or to a rejection of the aggregation (denoted by
25238  * aggregated == FALSE), if the resulting integer coefficients are too large and thus numerically instable.
25239  *
25240  * The output flags have the following meaning:
25241  * - infeasible: the problem is infeasible
25242  * - redundant: the equality can be deleted from the constraint set
25243  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
25244  *
25245  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25246  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25247  *
25248  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
25249  */
25251  SCIP* scip, /**< SCIP data structure */
25252  SCIP_VAR* varx, /**< variable x in equality a*x + b*y == c */
25253  SCIP_VAR* vary, /**< variable y in equality a*x + b*y == c */
25254  SCIP_Real scalarx, /**< multiplier a in equality a*x + b*y == c */
25255  SCIP_Real scalary, /**< multiplier b in equality a*x + b*y == c */
25256  SCIP_Real rhs, /**< right hand side c in equality a*x + b*y == c */
25257  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
25258  SCIP_Bool* redundant, /**< pointer to store whether the equality is (now) redundant */
25259  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
25260  )
25261 {
25262  SCIP_Real constantx;
25263  SCIP_Real constanty;
25264 
25265  assert(infeasible != NULL);
25266  assert(redundant != NULL);
25267  assert(aggregated != NULL);
25268 
25269  SCIP_CALL( checkStage(scip, "SCIPaggregateVars", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25270 
25271  *infeasible = FALSE;
25272  *redundant = FALSE;
25273  *aggregated = FALSE;
25274 
25275  if( SCIPtreeProbing(scip->tree) )
25276  {
25277  SCIPerrorMessage("cannot aggregate variables during probing\n");
25278  return SCIP_INVALIDCALL;
25279  }
25280  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
25281 
25282  /* do not perform aggregation if it is globally deactivated */
25283  if( scip->set->presol_donotaggr )
25284  return SCIP_OKAY;
25285 
25286  /* get the corresponding equality in active problem variable space:
25287  * transform both expressions "a*x + 0" and "b*y + 0" into problem variable space
25288  */
25289  constantx = 0.0;
25290  constanty = 0.0;
25291  SCIP_CALL( SCIPvarGetProbvarSum(&varx, scip->set, &scalarx, &constantx) );
25292  SCIP_CALL( SCIPvarGetProbvarSum(&vary, scip->set, &scalary, &constanty) );
25293 
25294  /* we cannot aggregate multi-aggregated variables */
25296  return SCIP_OKAY;
25297 
25298  /* move the constant to the right hand side to acquire the form "a'*x' + b'*y' == c'" */
25299  rhs -= (constantx + constanty);
25300 
25301  /* if a scalar is zero, treat the variable as fixed-to-zero variable */
25302  if( SCIPsetIsZero(scip->set, scalarx) )
25303  varx = NULL;
25304  if( SCIPsetIsZero(scip->set, scalary) )
25305  vary = NULL;
25306 
25307  /* capture the special cases that less than two variables are left, due to resolutions to a fixed variable or
25308  * to the same active variable
25309  */
25310  if( varx == NULL && vary == NULL )
25311  {
25312  /* both variables were resolved to fixed variables */
25313  *infeasible = !SCIPsetIsZero(scip->set, rhs);
25314  *redundant = TRUE;
25315  }
25316  else if( varx == NULL )
25317  {
25318  assert(SCIPsetIsZero(scip->set, scalarx));
25319  assert(!SCIPsetIsZero(scip->set, scalary));
25320 
25321  /* variable x was resolved to fixed variable: variable y can be fixed to c'/b' */
25322  SCIP_CALL( SCIPvarFix(vary, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25323  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25324  rhs/scalary, infeasible, aggregated) );
25325  *redundant = TRUE;
25326  }
25327  else if( vary == NULL )
25328  {
25329  assert(SCIPsetIsZero(scip->set, scalary));
25330  assert(!SCIPsetIsZero(scip->set, scalarx));
25331 
25332  /* variable y was resolved to fixed variable: variable x can be fixed to c'/a' */
25333  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25334  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25335  rhs/scalarx, infeasible, aggregated) );
25336  *redundant = TRUE;
25337  }
25338  else if( varx == vary )
25339  {
25340  /* both variables were resolved to the same active problem variable: this variable can be fixed */
25341  scalarx += scalary;
25342  if( SCIPsetIsZero(scip->set, scalarx) )
25343  {
25344  /* left hand side of equality is zero: equality is potentially infeasible */
25345  *infeasible = !SCIPsetIsZero(scip->set, rhs);
25346  }
25347  else
25348  {
25349  /* sum of scalars is not zero: fix variable x' == y' to c'/(a'+b') */
25350  SCIP_CALL( SCIPvarFix(varx, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25351  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
25352  rhs/scalarx, infeasible, aggregated) );
25353  }
25354  *redundant = TRUE;
25355  }
25356  else
25357  {
25358  /* both variables are different active problem variables, and both scalars are non-zero: try to aggregate them */
25359  SCIP_CALL( SCIPvarTryAggregateVars(scip->set, scip->mem->probmem, scip->stat, scip->transprob, scip->origprob,
25360  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
25361  scip->eventqueue, varx, vary, scalarx, scalary, rhs, infeasible, aggregated) );
25362  *redundant = *aggregated;
25363  }
25364 
25365  return SCIP_OKAY;
25366 }
25367 
25368 /** converts variable into multi-aggregated variable; this changes the variable array returned from
25369  * SCIPgetVars() and SCIPgetVarsData();
25370  *
25371  * @warning The integrality condition is not checked anymore on the multi-aggregated variable. You must not
25372  * multi-aggregate an integer variable without being sure, that integrality on the aggregation variables
25373  * implies integrality on the aggregated variable.
25374  *
25375  * The output flags have the following meaning:
25376  * - infeasible: the problem is infeasible
25377  * - aggregated: the aggregation was successfully performed (the variables were not aggregated before)
25378  *
25379  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25380  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25381  *
25382  * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_PRESOLVING
25383  */
25385  SCIP* scip, /**< SCIP data structure */
25386  SCIP_VAR* var, /**< variable x to aggregate */
25387  int naggvars, /**< number n of variables in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25388  SCIP_VAR** aggvars, /**< variables y_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25389  SCIP_Real* scalars, /**< multipliers a_i in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25390  SCIP_Real constant, /**< constant shift c in aggregation x = a_1*y_1 + ... + a_n*y_n + c */
25391  SCIP_Bool* infeasible, /**< pointer to store whether the aggregation is infeasible */
25392  SCIP_Bool* aggregated /**< pointer to store whether the aggregation was successful */
25393  )
25394 {
25395  SCIP_CALL( checkStage(scip, "SCIPmultiaggregateVar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
25396 
25397  assert(var->scip == scip);
25398 
25399  if( SCIPtreeProbing(scip->tree) )
25400  {
25401  SCIPerrorMessage("cannot multi-aggregate variables during probing\n");
25402  return SCIP_INVALIDCALL;
25403  }
25404  assert(SCIPtreeGetCurrentDepth(scip->tree) == 0);
25405 
25406  SCIP_CALL( SCIPvarMultiaggregate(var, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
25407  scip->primal, scip->tree, scip->reopt, scip->lp, scip->cliquetable, scip->branchcand, scip->eventfilter,
25408  scip->eventqueue, naggvars, aggvars, scalars, constant, infeasible, aggregated) );
25409 
25410  return SCIP_OKAY;
25411 }
25412 
25413 /** returns whether aggregation of variables is not allowed */
25415  SCIP* scip /**< SCIP data structure */
25416  )
25417 {
25418  assert(scip != NULL);
25419 
25420  return scip->set->presol_donotaggr;
25421 }
25422 
25423 /** returns whether multi-aggregation is disabled */
25425  SCIP* scip /**< SCIP data structure */
25426  )
25427 {
25428  assert(scip != NULL);
25429 
25430  return scip->set->presol_donotmultaggr;
25431 }
25432 
25433 /** returns whether variable is not allowed to be multi-aggregated */
25435  SCIP* scip, /**< SCIP data structure */
25436  SCIP_VAR* var /**< variable x to aggregate */
25437  )
25438 {
25439  assert(scip != NULL);
25440  assert(var != NULL);
25441  assert(var->scip == scip);
25442 
25443  return scip->set->presol_donotmultaggr || SCIPvarDoNotMultaggr(var);
25444 }
25445 
25446 /** returns whether dual reductions propagation methods and presolvers is allowed */
25448  SCIP* scip /**< SCIP data structure */
25449  )
25450 {
25451  assert(scip != NULL);
25452 
25453  return !scip->set->reopt_enable && scip->set->misc_allowdualreds;
25454 }
25455 
25456 /** returns whether propagation w.r.t. current objective is allowed */
25458  SCIP* scip /**< SCIP data structure */
25459  )
25460 {
25461  assert(scip != NULL);
25462 
25463  return !scip->set->reopt_enable && scip->set->misc_allowobjprop;
25464 }
25465 
25466 /** modifies an initial seed value with the global shift of random seeds */
25468  SCIP* scip, /**< SCIP data structure */
25469  int initialseedvalue /**< initial seed value to be modified */
25470  )
25471 {
25472  assert(scip != NULL);
25473 
25474  return (unsigned int)SCIPsetInitializeRandomSeed(scip->set, initialseedvalue);
25475 }
25476 
25477 /** marks the variable that it must not be multi-aggregated
25478  *
25479  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25480  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25481  *
25482  * @pre This method can be called if @p scip is in one of the following stages:
25483  * - \ref SCIP_STAGE_INIT
25484  * - \ref SCIP_STAGE_PROBLEM
25485  * - \ref SCIP_STAGE_TRANSFORMING
25486  * - \ref SCIP_STAGE_TRANSFORMED
25487  * - \ref SCIP_STAGE_INITPRESOLVE
25488  * - \ref SCIP_STAGE_PRESOLVING
25489  * - \ref SCIP_STAGE_EXITPRESOLVE
25490  *
25491  * @note There exists no "unmark" method since it has to be ensured that if a plugin requires that a variable is not
25492  * multi-aggregated that this is will be the case.
25493  */
25495  SCIP* scip, /**< SCIP data structure */
25496  SCIP_VAR* var /**< variable to delete */
25497  )
25498 {
25499  assert(scip != NULL);
25500  assert(var != NULL);
25501  assert(var->scip == scip);
25502 
25503  SCIP_CALL( checkStage(scip, "SCIPmarkDoNotMultaggrVar", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE) );
25504 
25506 
25507  return SCIP_OKAY;
25508 }
25509 
25510 /** enables the collection of statistics for a variable
25511  *
25512  * @pre This method can be called if @p scip is in one of the following stages:
25513  * - \ref SCIP_STAGE_PROBLEM
25514  * - \ref SCIP_STAGE_INITPRESOLVE
25515  * - \ref SCIP_STAGE_PRESOLVING
25516  * - \ref SCIP_STAGE_EXITPRESOLVE
25517  * - \ref SCIP_STAGE_SOLVING
25518  * - \ref SCIP_STAGE_SOLVED
25519  */
25521  SCIP* scip /**< SCIP data structure */
25522  )
25523 {
25524  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25525 
25527 }
25528 
25529 /** disables the collection of any statistic for a variable
25530  *
25531  * @pre This method can be called if @p scip is in one of the following stages:
25532  * - \ref SCIP_STAGE_PROBLEM
25533  * - \ref SCIP_STAGE_INITPRESOLVE
25534  * - \ref SCIP_STAGE_PRESOLVING
25535  * - \ref SCIP_STAGE_EXITPRESOLVE
25536  * - \ref SCIP_STAGE_SOLVING
25537  * - \ref SCIP_STAGE_SOLVED
25538  */
25540  SCIP* scip /**< SCIP data structure */
25541  )
25542 {
25543  SCIP_CALL_ABORT( checkStage(scip, "SCIPdisableVarHistory", FALSE, TRUE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25544 
25546 }
25547 
25548 /** updates the pseudo costs of the given variable and the global pseudo costs after a change of "solvaldelta" in the
25549  * variable's solution value and resulting change of "objdelta" in the in the LP's objective value;
25550  * the update is ignored, if the objective value difference is infinite
25551  *
25552  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
25553  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
25554  *
25555  * @pre This method can be called if @p scip is in one of the following stages:
25556  * - \ref SCIP_STAGE_SOLVING
25557  * - \ref SCIP_STAGE_SOLVED
25558  */
25560  SCIP* scip, /**< SCIP data structure */
25561  SCIP_VAR* var, /**< problem variable */
25562  SCIP_Real solvaldelta, /**< difference of variable's new LP value - old LP value */
25563  SCIP_Real objdelta, /**< difference of new LP's objective value - old LP's objective value */
25564  SCIP_Real weight /**< weight in (0,1] of this update in pseudo cost sum */
25565  )
25566 {
25567  SCIP_CALL( checkStage(scip, "SCIPupdateVarPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25568 
25569  if( !SCIPsetIsInfinity(scip->set, 2*objdelta) ) /* differences infinity - eps should also be treated as infinity */
25570  {
25571  if( scip->set->branch_divingpscost || (!scip->lp->diving && !SCIPtreeProbing(scip->tree)) )
25572  {
25573  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, solvaldelta, objdelta, weight) );
25574  }
25575  }
25576 
25577  return SCIP_OKAY;
25578 }
25579 
25580 /** gets the variable's pseudo cost value for the given change of the variable's LP value
25581  *
25582  * @return the variable's pseudo cost value for the given change of the variable's LP value
25583  *
25584  * @pre This method can be called if @p scip is in one of the following stages:
25585  * - \ref SCIP_STAGE_INITPRESOLVE
25586  * - \ref SCIP_STAGE_PRESOLVING
25587  * - \ref SCIP_STAGE_EXITPRESOLVE
25588  * - \ref SCIP_STAGE_PRESOLVED
25589  * - \ref SCIP_STAGE_INITSOLVE
25590  * - \ref SCIP_STAGE_SOLVING
25591  * - \ref SCIP_STAGE_SOLVED
25592  */
25594  SCIP* scip, /**< SCIP data structure */
25595  SCIP_VAR* var, /**< problem variable */
25596  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
25597  )
25598 {
25599  assert( var->scip == scip );
25600 
25601  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVal", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25602 
25603  return SCIPvarGetPseudocost(var, scip->stat, solvaldelta);
25604 }
25605 
25606 /** gets the variable's pseudo cost value for the given change of the variable's LP value,
25607  * only using the pseudo cost information of the current run
25608  *
25609  * @return the variable's pseudo cost value for the given change of the variable's LP value,
25610  * only using the pseudo cost information of the current run
25611  *
25612  * @pre This method can be called if @p scip is in one of the following stages:
25613  * - \ref SCIP_STAGE_INITPRESOLVE
25614  * - \ref SCIP_STAGE_PRESOLVING
25615  * - \ref SCIP_STAGE_EXITPRESOLVE
25616  * - \ref SCIP_STAGE_PRESOLVED
25617  * - \ref SCIP_STAGE_INITSOLVE
25618  * - \ref SCIP_STAGE_SOLVING
25619  * - \ref SCIP_STAGE_SOLVED
25620  */
25622  SCIP* scip, /**< SCIP data structure */
25623  SCIP_VAR* var, /**< problem variable */
25624  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
25625  )
25626 {
25627  assert( var->scip == scip );
25628 
25629  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostValCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25630 
25631  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, solvaldelta);
25632 }
25633 
25634 /** gets the variable's pseudo cost value for the given direction
25635  *
25636  * @return the variable's pseudo cost value for the given direction
25637  *
25638  * @pre This method can be called if @p scip is in one of the following stages:
25639  * - \ref SCIP_STAGE_INITPRESOLVE
25640  * - \ref SCIP_STAGE_PRESOLVING
25641  * - \ref SCIP_STAGE_EXITPRESOLVE
25642  * - \ref SCIP_STAGE_PRESOLVED
25643  * - \ref SCIP_STAGE_INITSOLVE
25644  * - \ref SCIP_STAGE_SOLVING
25645  * - \ref SCIP_STAGE_SOLVED
25646  */
25648  SCIP* scip, /**< SCIP data structure */
25649  SCIP_VAR* var, /**< problem variable */
25650  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
25651  )
25652 {
25653  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocost", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25654  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
25655  assert(var->scip == scip);
25656 
25657  return SCIPvarGetPseudocost(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
25658 }
25659 
25660 /** gets the variable's pseudo cost value for the given direction,
25661  * only using the pseudo cost information of the current run
25662  *
25663  * @return the variable's pseudo cost value for the given direction,
25664  * only using the pseudo cost information of the current run
25665  *
25666  * @pre This method can be called if @p scip is in one of the following stages:
25667  * - \ref SCIP_STAGE_INITPRESOLVE
25668  * - \ref SCIP_STAGE_PRESOLVING
25669  * - \ref SCIP_STAGE_EXITPRESOLVE
25670  * - \ref SCIP_STAGE_PRESOLVED
25671  * - \ref SCIP_STAGE_INITSOLVE
25672  * - \ref SCIP_STAGE_SOLVING
25673  * - \ref SCIP_STAGE_SOLVED
25674  */
25676  SCIP* scip, /**< SCIP data structure */
25677  SCIP_VAR* var, /**< problem variable */
25678  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
25679  )
25680 {
25681  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25682  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
25683  assert(var->scip == scip);
25684 
25685  return SCIPvarGetPseudocostCurrentRun(var, scip->stat, dir == SCIP_BRANCHDIR_DOWNWARDS ? -1.0 : 1.0);
25686 }
25687 
25688 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction
25689  *
25690  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction
25691  *
25692  * @pre This method can be called if @p scip is in one of the following stages:
25693  * - \ref SCIP_STAGE_INITPRESOLVE
25694  * - \ref SCIP_STAGE_PRESOLVING
25695  * - \ref SCIP_STAGE_EXITPRESOLVE
25696  * - \ref SCIP_STAGE_PRESOLVED
25697  * - \ref SCIP_STAGE_INITSOLVE
25698  * - \ref SCIP_STAGE_SOLVING
25699  * - \ref SCIP_STAGE_SOLVED
25700  */
25702  SCIP* scip, /**< SCIP data structure */
25703  SCIP_VAR* var, /**< problem variable */
25704  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
25705  )
25706 {
25707  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCount", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25708  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
25709  assert(var->scip == scip);
25710 
25711  return SCIPvarGetPseudocostCount(var, dir);
25712 }
25713 
25714 /** gets the variable's (possible fractional) number of pseudo cost updates for the given direction,
25715  * only using the pseudo cost information of the current run
25716  *
25717  * @return the variable's (possible fractional) number of pseudo cost updates for the given direction,
25718  * only using the pseudo cost information of the current run
25719  *
25720  * @pre This method can be called if @p scip is in one of the following stages:
25721  * - \ref SCIP_STAGE_INITPRESOLVE
25722  * - \ref SCIP_STAGE_PRESOLVING
25723  * - \ref SCIP_STAGE_EXITPRESOLVE
25724  * - \ref SCIP_STAGE_PRESOLVED
25725  * - \ref SCIP_STAGE_INITSOLVE
25726  * - \ref SCIP_STAGE_SOLVING
25727  * - \ref SCIP_STAGE_SOLVED
25728  */
25730  SCIP* scip, /**< SCIP data structure */
25731  SCIP_VAR* var, /**< problem variable */
25732  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
25733  )
25734 {
25735  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25736  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
25737  assert(var->scip == scip);
25738 
25739  return SCIPvarGetPseudocostCountCurrentRun(var, dir);
25740 }
25741 
25742 /** get pseudo cost variance of the variable, either for entire solve or only for current branch and bound run
25743  *
25744  * @return returns the (corrected) variance of pseudo code information collected so far.
25745  *
25746  * @pre This method can be called if @p scip is in one of the following stages:
25747  * - \ref SCIP_STAGE_INITPRESOLVE
25748  * - \ref SCIP_STAGE_PRESOLVING
25749  * - \ref SCIP_STAGE_EXITPRESOLVE
25750  * - \ref SCIP_STAGE_PRESOLVED
25751  * - \ref SCIP_STAGE_INITSOLVE
25752  * - \ref SCIP_STAGE_SOLVING
25753  * - \ref SCIP_STAGE_SOLVED
25754  */
25756  SCIP* scip, /**< SCIP data structure */
25757  SCIP_VAR* var, /**< problem variable */
25758  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
25759  SCIP_Bool onlycurrentrun /**< only for pseudo costs of current branch and bound run */
25760  )
25761 {
25762  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostVariance", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25763  assert(dir == SCIP_BRANCHDIR_DOWNWARDS || dir == SCIP_BRANCHDIR_UPWARDS);
25764  assert(var->scip == scip);
25765 
25766  return SCIPvarGetPseudocostVariance(var, dir, onlycurrentrun);
25767 }
25768 
25769 /** calculates a confidence bound for this variable under the assumption of normally distributed pseudo costs
25770  *
25771  * The confidence bound \f$ \theta \geq 0\f$ denotes the interval borders \f$ [X - \theta, \ X + \theta]\f$, which contains
25772  * the true pseudo costs of the variable, i.e., the expected value of the normal distribution, with a probability
25773  * of 2 * clevel - 1.
25774  *
25775  * @return value of confidence bound for this variable
25776  */
25778  SCIP* scip, /**< SCIP data structure */
25779  SCIP_VAR* var, /**< variable in question */
25780  SCIP_BRANCHDIR dir, /**< the branching direction for the confidence bound */
25781  SCIP_Bool onlycurrentrun, /**< should only the current run be taken into account */
25782  SCIP_CONFIDENCELEVEL clevel /**< confidence level for the interval */
25783  )
25784 {
25785  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalculatePscostConfidenceBound", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25786 
25787  return SCIPvarCalcPscostConfidenceBound(var, scip->set, dir, onlycurrentrun, clevel);
25788 }
25789 
25790 /** check if variable pseudo-costs have a significant difference in location. The significance depends on
25791  * the choice of \p clevel and on the kind of tested hypothesis. The one-sided hypothesis, which
25792  * should be rejected, is that fracy * mu_y >= fracx * mu_x, where mu_y and mu_x denote the
25793  * unknown location means of the underlying pseudo-cost distributions of x and y.
25794  *
25795  * This method is applied best if variable x has a better pseudo-cost score than y. The method hypothesizes that y were actually
25796  * better than x (despite the current information), meaning that y can be expected to yield branching
25797  * decisions as least as good as x in the long run. If the method returns TRUE, the current history information is
25798  * sufficient to safely rely on the alternative hypothesis that x yields indeed a better branching score (on average)
25799  * than y.
25800  *
25801  * @note The order of x and y matters for the one-sided hypothesis
25802  *
25803  * @note set \p onesided to FALSE if you are not sure which variable is better. The hypothesis tested then reads
25804  * fracy * mu_y == fracx * mu_x vs the alternative hypothesis fracy * mu_y != fracx * mu_x.
25805  *
25806  * @return TRUE if the hypothesis can be safely rejected at the given confidence level
25807  */
25809  SCIP* scip, /**< SCIP data structure */
25810  SCIP_VAR* varx, /**< variable x */
25811  SCIP_Real fracx, /**< the fractionality of variable x */
25812  SCIP_VAR* vary, /**< variable y */
25813  SCIP_Real fracy, /**< the fractionality of variable y */
25814  SCIP_BRANCHDIR dir, /**< branching direction */
25815  SCIP_CONFIDENCELEVEL clevel, /**< confidence level for rejecting hypothesis */
25816  SCIP_Bool onesided /**< should a one-sided hypothesis y >= x be tested? */
25817  )
25818 {
25819  SCIP_CALL_ABORT( checkStage(scip, "SCIPsignificantVarPscostDifference", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25820 
25821  return SCIPvarSignificantPscostDifference(scip->set, scip->stat, varx, fracx, vary, fracy, dir, clevel, onesided);
25822 }
25823 
25824 /** tests at a given confidence level whether the variable pseudo-costs only have a small probability to
25825  * exceed a \p threshold. This is useful to determine if past observations provide enough evidence
25826  * to skip an expensive strong-branching step if there is already a candidate that has been proven to yield an improvement
25827  * of at least \p threshold.
25828  *
25829  * @note use \p clevel to adjust the level of confidence. For SCIP_CONFIDENCELEVEL_MIN, the method returns TRUE if
25830  * the estimated probability to exceed \p threshold is less than 25 %.
25831  *
25832  * @see SCIP_Confidencelevel for a list of available levels. The used probability limits refer to the one-sided levels
25833  * of confidence.
25834  *
25835  * @return TRUE if the variable pseudo-cost probabilistic model is likely to be smaller than \p threshold
25836  * at the given confidence level \p clevel.
25837  */
25839  SCIP* scip, /**< SCIP data structure */
25840  SCIP_VAR* var, /**< variable x */
25841  SCIP_Real frac, /**< the fractionality of variable x */
25842  SCIP_Real threshold, /**< the threshold to test against */
25843  SCIP_BRANCHDIR dir, /**< branching direction */
25844  SCIP_CONFIDENCELEVEL clevel /**< confidence level for rejecting hypothesis */
25845  )
25846 {
25847  SCIP_CALL_ABORT( checkStage(scip, "SCIPpscostThresholdProbabilityTest", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25848 
25849  return SCIPvarPscostThresholdProbabilityTest(scip->set, scip->stat, var, frac, threshold, dir, clevel);
25850 }
25851 
25852 /** check if the current pseudo cost relative error in a direction violates the given threshold. The Relative
25853  * Error is calculated at a specific confidence level
25854  *
25855  * @return TRUE if relative error in variable pseudo costs is smaller than \p threshold
25856  */
25858  SCIP* scip, /**< SCIP data structure */
25859  SCIP_VAR* var, /**< variable in question */
25860  SCIP_Real threshold, /**< threshold for relative errors to be considered reliable (enough) */
25861  SCIP_CONFIDENCELEVEL clevel /**< a given confidence level */
25862  )
25863 {
25864  SCIP_CALL_ABORT( checkStage(scip, "SCIPisVarPscostRelerrorReliable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25865 
25866  return SCIPvarIsPscostRelerrorReliable(var, scip->set, scip->stat, threshold, clevel);
25867 }
25868 
25869 /** gets the variable's pseudo cost score value for the given LP solution value
25870  *
25871  * @return the variable's pseudo cost score value for the given LP solution value
25872  *
25873  * @pre This method can be called if @p scip is in one of the following stages:
25874  * - \ref SCIP_STAGE_INITPRESOLVE
25875  * - \ref SCIP_STAGE_PRESOLVING
25876  * - \ref SCIP_STAGE_EXITPRESOLVE
25877  * - \ref SCIP_STAGE_PRESOLVED
25878  * - \ref SCIP_STAGE_INITSOLVE
25879  * - \ref SCIP_STAGE_SOLVING
25880  * - \ref SCIP_STAGE_SOLVED
25881  */
25883  SCIP* scip, /**< SCIP data structure */
25884  SCIP_VAR* var, /**< problem variable */
25885  SCIP_Real solval /**< variable's LP solution value */
25886  )
25887 {
25888  SCIP_Real downsol;
25889  SCIP_Real upsol;
25890  SCIP_Real pscostdown;
25891  SCIP_Real pscostup;
25892 
25893  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25894 
25895  assert( var->scip == scip );
25896 
25897  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
25898  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
25899  pscostdown = SCIPvarGetPseudocost(var, scip->stat, downsol-solval);
25900  pscostup = SCIPvarGetPseudocost(var, scip->stat, upsol-solval);
25901 
25902  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
25903 }
25904 
25905 /** gets the variable's pseudo cost score value for the given LP solution value,
25906  * only using the pseudo cost information of the current run
25907  *
25908  * @return the variable's pseudo cost score value for the given LP solution value,
25909  * only using the pseudo cost information of the current run
25910  *
25911  * @pre This method can be called if @p scip is in one of the following stages:
25912  * - \ref SCIP_STAGE_INITPRESOLVE
25913  * - \ref SCIP_STAGE_PRESOLVING
25914  * - \ref SCIP_STAGE_EXITPRESOLVE
25915  * - \ref SCIP_STAGE_PRESOLVED
25916  * - \ref SCIP_STAGE_INITSOLVE
25917  * - \ref SCIP_STAGE_SOLVING
25918  * - \ref SCIP_STAGE_SOLVED
25919  */
25921  SCIP* scip, /**< SCIP data structure */
25922  SCIP_VAR* var, /**< problem variable */
25923  SCIP_Real solval /**< variable's LP solution value */
25924  )
25925 {
25926  SCIP_Real downsol;
25927  SCIP_Real upsol;
25928  SCIP_Real pscostdown;
25929  SCIP_Real pscostup;
25930 
25931  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25932 
25933  assert( var->scip == scip );
25934 
25935  downsol = SCIPsetFeasCeil(scip->set, solval-1.0);
25936  upsol = SCIPsetFeasFloor(scip->set, solval+1.0);
25937  pscostdown = SCIPvarGetPseudocostCurrentRun(var, scip->stat, downsol-solval);
25938  pscostup = SCIPvarGetPseudocostCurrentRun(var, scip->stat, upsol-solval);
25939 
25940  return SCIPbranchGetScore(scip->set, var, pscostdown, pscostup);
25941 }
25942 
25943 /** returns the variable's VSIDS value
25944  *
25945  * @return the variable's VSIDS value
25946  *
25947  * @pre This method can be called if @p scip is in one of the following stages:
25948  * - \ref SCIP_STAGE_INITPRESOLVE
25949  * - \ref SCIP_STAGE_PRESOLVING
25950  * - \ref SCIP_STAGE_EXITPRESOLVE
25951  * - \ref SCIP_STAGE_PRESOLVED
25952  * - \ref SCIP_STAGE_INITSOLVE
25953  * - \ref SCIP_STAGE_SOLVING
25954  * - \ref SCIP_STAGE_SOLVED
25955  */
25957  SCIP* scip, /**< SCIP data structure */
25958  SCIP_VAR* var, /**< problem variable */
25959  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
25960  )
25961 {
25962  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDS", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25963 
25964  assert( var->scip == scip );
25965 
25966  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
25967  {
25968  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
25969  return SCIP_INVALID;
25970  }
25971 
25972  return SCIPvarGetVSIDS(var, scip->stat, dir);
25973 }
25974 
25975 /** returns the variable's VSIDS value only using conflicts of the current run
25976  *
25977  * @return the variable's VSIDS value only using conflicts of the current run
25978  *
25979  * @pre This method can be called if @p scip is in one of the following stages:
25980  * - \ref SCIP_STAGE_INITPRESOLVE
25981  * - \ref SCIP_STAGE_PRESOLVING
25982  * - \ref SCIP_STAGE_EXITPRESOLVE
25983  * - \ref SCIP_STAGE_PRESOLVED
25984  * - \ref SCIP_STAGE_INITSOLVE
25985  * - \ref SCIP_STAGE_SOLVING
25986  * - \ref SCIP_STAGE_SOLVED
25987  */
25989  SCIP* scip, /**< SCIP data structure */
25990  SCIP_VAR* var, /**< problem variable */
25991  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
25992  )
25993 {
25994  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarVSIDSCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
25995 
25996  assert( var->scip == scip );
25997 
25998  if( dir != SCIP_BRANCHDIR_DOWNWARDS && dir != SCIP_BRANCHDIR_UPWARDS )
25999  {
26000  SCIPerrorMessage("invalid branching direction %d when asking for VSIDS value\n", dir);
26001  return SCIP_INVALID;
26002  }
26003 
26004  return SCIPvarGetVSIDSCurrentRun(var, scip->stat, dir);
26005 }
26006 
26007 /** returns the variable's conflict score value
26008  *
26009  * @return the variable's conflict score value
26010  *
26011  * @pre This method can be called if @p scip is in one of the following stages:
26012  * - \ref SCIP_STAGE_INITPRESOLVE
26013  * - \ref SCIP_STAGE_PRESOLVING
26014  * - \ref SCIP_STAGE_EXITPRESOLVE
26015  * - \ref SCIP_STAGE_PRESOLVED
26016  * - \ref SCIP_STAGE_INITSOLVE
26017  * - \ref SCIP_STAGE_SOLVING
26018  * - \ref SCIP_STAGE_SOLVED
26019  */
26021  SCIP* scip, /**< SCIP data structure */
26022  SCIP_VAR* var /**< problem variable */
26023  )
26024 {
26025  SCIP_Real downscore;
26026  SCIP_Real upscore;
26027 
26028  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26029 
26030  assert( var->scip == scip );
26031 
26032  downscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26033  upscore = SCIPvarGetVSIDS(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26034 
26035  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26036 }
26037 
26038 /** returns the variable's conflict score value only using conflicts of the current run
26039  *
26040  * @return the variable's conflict score value only using conflicts of the current run
26041  *
26042  * @pre This method can be called if @p scip is in one of the following stages:
26043  * - \ref SCIP_STAGE_INITPRESOLVE
26044  * - \ref SCIP_STAGE_PRESOLVING
26045  * - \ref SCIP_STAGE_EXITPRESOLVE
26046  * - \ref SCIP_STAGE_PRESOLVED
26047  * - \ref SCIP_STAGE_INITSOLVE
26048  * - \ref SCIP_STAGE_SOLVING
26049  * - \ref SCIP_STAGE_SOLVED
26050  */
26052  SCIP* scip, /**< SCIP data structure */
26053  SCIP_VAR* var /**< problem variable */
26054  )
26055 {
26056  SCIP_Real downscore;
26057  SCIP_Real upscore;
26058 
26059  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26060 
26061  assert( var->scip == scip );
26062 
26063  downscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26064  upscore = SCIPvarGetVSIDSCurrentRun(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26065 
26066  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26067 }
26068 
26069 /** returns the variable's conflict length score
26070  *
26071  * @return the variable's conflict length score
26072  *
26073  * @pre This method can be called if @p scip is in one of the following stages:
26074  * - \ref SCIP_STAGE_INITPRESOLVE
26075  * - \ref SCIP_STAGE_PRESOLVING
26076  * - \ref SCIP_STAGE_EXITPRESOLVE
26077  * - \ref SCIP_STAGE_PRESOLVED
26078  * - \ref SCIP_STAGE_INITSOLVE
26079  * - \ref SCIP_STAGE_SOLVING
26080  * - \ref SCIP_STAGE_SOLVED
26081  */
26083  SCIP* scip, /**< SCIP data structure */
26084  SCIP_VAR* var /**< problem variable */
26085  )
26086 {
26087  SCIP_Real downscore;
26088  SCIP_Real upscore;
26089 
26090  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26091 
26092  assert( var->scip == scip );
26093 
26096 
26097  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26098 }
26099 
26100 /** returns the variable's conflict length score only using conflicts of the current run
26101  *
26102  * @return the variable's conflict length score only using conflicts of the current run
26103  *
26104  * @pre This method can be called if @p scip is in one of the following stages:
26105  * - \ref SCIP_STAGE_INITPRESOLVE
26106  * - \ref SCIP_STAGE_PRESOLVING
26107  * - \ref SCIP_STAGE_EXITPRESOLVE
26108  * - \ref SCIP_STAGE_PRESOLVED
26109  * - \ref SCIP_STAGE_INITSOLVE
26110  * - \ref SCIP_STAGE_SOLVING
26111  * - \ref SCIP_STAGE_SOLVED
26112  */
26114  SCIP* scip, /**< SCIP data structure */
26115  SCIP_VAR* var /**< problem variable */
26116  )
26117 {
26118  SCIP_Real downscore;
26119  SCIP_Real upscore;
26120 
26121  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26122 
26123  assert( var->scip == scip );
26124 
26127 
26128  return SCIPbranchGetScore(scip->set, var, downscore, upscore);
26129 }
26130 
26131 /** returns the variable's average conflict length
26132  *
26133  * @return the variable's average conflict length
26134  *
26135  * @pre This method can be called if @p scip is in one of the following stages:
26136  * - \ref SCIP_STAGE_INITPRESOLVE
26137  * - \ref SCIP_STAGE_PRESOLVING
26138  * - \ref SCIP_STAGE_EXITPRESOLVE
26139  * - \ref SCIP_STAGE_PRESOLVED
26140  * - \ref SCIP_STAGE_INITSOLVE
26141  * - \ref SCIP_STAGE_SOLVING
26142  * - \ref SCIP_STAGE_SOLVED
26143  */
26145  SCIP* scip, /**< SCIP data structure */
26146  SCIP_VAR* var, /**< problem variable */
26147  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26148  )
26149 {
26150  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlength", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26151 
26152  assert( var->scip == scip );
26153 
26154  return SCIPvarGetAvgConflictlength(var, dir);
26155 }
26156 
26157 /** returns the variable's average conflict length only using conflicts of the current run
26158  *
26159  * @return the variable's average conflict length only using conflicts of the current run
26160  *
26161  * @pre This method can be called if @p scip is in one of the following stages:
26162  * - \ref SCIP_STAGE_INITPRESOLVE
26163  * - \ref SCIP_STAGE_PRESOLVING
26164  * - \ref SCIP_STAGE_EXITPRESOLVE
26165  * - \ref SCIP_STAGE_PRESOLVED
26166  * - \ref SCIP_STAGE_INITSOLVE
26167  * - \ref SCIP_STAGE_SOLVING
26168  * - \ref SCIP_STAGE_SOLVED
26169  */
26171  SCIP* scip, /**< SCIP data structure */
26172  SCIP_VAR* var, /**< problem variable */
26173  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26174  )
26175 {
26176  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgConflictlengthCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26177 
26178  assert( var->scip == scip );
26179 
26180  return SCIPvarGetAvgConflictlengthCurrentRun(var, dir);
26181 }
26182 
26183 /** returns the average number of inferences found after branching on the variable in given direction;
26184  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
26185  * over all variables for branching in the given direction is returned
26186  *
26187  * @return the average number of inferences found after branching on the variable in given direction
26188  *
26189  * @pre This method can be called if @p scip is in one of the following stages:
26190  * - \ref SCIP_STAGE_INITPRESOLVE
26191  * - \ref SCIP_STAGE_PRESOLVING
26192  * - \ref SCIP_STAGE_EXITPRESOLVE
26193  * - \ref SCIP_STAGE_PRESOLVED
26194  * - \ref SCIP_STAGE_INITSOLVE
26195  * - \ref SCIP_STAGE_SOLVING
26196  * - \ref SCIP_STAGE_SOLVED
26197  */
26199  SCIP* scip, /**< SCIP data structure */
26200  SCIP_VAR* var, /**< problem variable */
26201  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26202  )
26203 {
26204  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferences", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26205 
26206  assert( var->scip == scip );
26207 
26208  return SCIPvarGetAvgInferences(var, scip->stat, dir);
26209 }
26210 
26211 /** returns the average number of inferences found after branching on the variable in given direction in the current run;
26212  * if branching on the variable in the given direction was yet evaluated, the average number of inferences
26213  * over all variables for branching in the given direction is returned
26214  *
26215  * @return the average number of inferences found after branching on the variable in given direction in the current run
26216  *
26217  * @pre This method can be called if @p scip is in one of the following stages:
26218  * - \ref SCIP_STAGE_INITPRESOLVE
26219  * - \ref SCIP_STAGE_PRESOLVING
26220  * - \ref SCIP_STAGE_EXITPRESOLVE
26221  * - \ref SCIP_STAGE_PRESOLVED
26222  * - \ref SCIP_STAGE_INITSOLVE
26223  * - \ref SCIP_STAGE_SOLVING
26224  * - \ref SCIP_STAGE_SOLVED
26225  */
26227  SCIP* scip, /**< SCIP data structure */
26228  SCIP_VAR* var, /**< problem variable */
26229  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26230  )
26231 {
26232  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26233 
26234  assert( var->scip == scip );
26235 
26236  return SCIPvarGetAvgInferencesCurrentRun(var, scip->stat, dir);
26237 }
26238 
26239 /** returns the variable's average inference score value
26240  *
26241  * @return the variable's average inference score value
26242  *
26243  * @pre This method can be called if @p scip is in one of the following stages:
26244  * - \ref SCIP_STAGE_INITPRESOLVE
26245  * - \ref SCIP_STAGE_PRESOLVING
26246  * - \ref SCIP_STAGE_EXITPRESOLVE
26247  * - \ref SCIP_STAGE_PRESOLVED
26248  * - \ref SCIP_STAGE_INITSOLVE
26249  * - \ref SCIP_STAGE_SOLVING
26250  * - \ref SCIP_STAGE_SOLVED
26251  */
26253  SCIP* scip, /**< SCIP data structure */
26254  SCIP_VAR* var /**< problem variable */
26255  )
26256 {
26257  SCIP_Real inferdown;
26258  SCIP_Real inferup;
26259 
26260  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26261 
26262  assert( var->scip == scip );
26263 
26264  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26265  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26266 
26267  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
26268 }
26269 
26270 /** returns the variable's average inference score value only using inferences of the current run
26271  *
26272  * @return the variable's average inference score value only using inferences of the current run
26273  *
26274  * @pre This method can be called if @p scip is in one of the following stages:
26275  * - \ref SCIP_STAGE_INITPRESOLVE
26276  * - \ref SCIP_STAGE_PRESOLVING
26277  * - \ref SCIP_STAGE_EXITPRESOLVE
26278  * - \ref SCIP_STAGE_PRESOLVED
26279  * - \ref SCIP_STAGE_INITSOLVE
26280  * - \ref SCIP_STAGE_SOLVING
26281  * - \ref SCIP_STAGE_SOLVED
26282  */
26284  SCIP* scip, /**< SCIP data structure */
26285  SCIP_VAR* var /**< problem variable */
26286  )
26287 {
26288  SCIP_Real inferdown;
26289  SCIP_Real inferup;
26290 
26291  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26292 
26293  assert( var->scip == scip );
26294 
26297 
26298  return SCIPbranchGetScore(scip->set, var, inferdown, inferup);
26299 }
26300 
26301 /** initializes the upwards and downwards pseudocosts, conflict scores, conflict lengths, inference scores, cutoff scores
26302  * of a variable to the given values
26303  *
26304  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26305  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26306  *
26307  * @pre This method can be called if @p scip is in one of the following stages:
26308  * - \ref SCIP_STAGE_TRANSFORMED
26309  * - \ref SCIP_STAGE_INITPRESOLVE
26310  * - \ref SCIP_STAGE_PRESOLVING
26311  * - \ref SCIP_STAGE_EXITPRESOLVE
26312  * - \ref SCIP_STAGE_PRESOLVED
26313  * - \ref SCIP_STAGE_INITSOLVE
26314  * - \ref SCIP_STAGE_SOLVING
26315  */
26317  SCIP* scip, /**< SCIP data structure */
26318  SCIP_VAR* var, /**< variable which should be initialized */
26319  SCIP_Real downpscost, /**< value to which pseudocosts for downwards branching should be initialized */
26320  SCIP_Real uppscost, /**< value to which pseudocosts for upwards branching should be initialized */
26321  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
26322  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
26323  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
26324  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
26325  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
26326  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
26327  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
26328  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
26329  )
26330 {
26331  SCIP_CALL( checkStage(scip, "SCIPinitVarBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26332 
26333  assert(downpscost >= 0.0 && uppscost >= 0.0);
26334  assert(downvsids >= 0.0 && upvsids >= 0.0);
26335  assert(downconflen >= 0.0 && upconflen >= 0.0);
26336  assert(downinfer >= 0.0 && upinfer >= 0.0);
26337  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
26338 
26339  if( !SCIPisFeasZero(scip, downpscost) || !SCIPisFeasZero(scip, downvsids)
26340  || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
26341  {
26343  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, -1.0, downpscost, 1.0) );
26345  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, SCIP_UNKNOWN, downvsids) );
26347  }
26348 
26349  if( !SCIPisFeasZero(scip, downconflen) )
26350  {
26352  }
26353 
26354  if( !SCIPisFeasZero(scip, uppscost) || !SCIPisFeasZero(scip, upvsids)
26355  || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
26356  {
26358  SCIP_CALL( SCIPvarUpdatePseudocost(var, scip->set, scip->stat, 1.0, uppscost, 1.0) );
26360  SCIP_CALL( SCIPvarIncVSIDS(var, NULL, scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, SCIP_UNKNOWN, upvsids) );
26362  }
26363 
26364  if( !SCIPisFeasZero(scip, upconflen) )
26365  {
26367  }
26368 
26369  return SCIP_OKAY;
26370 }
26371 
26372 /** initializes the upwards and downwards conflict scores, conflict lengths, inference scores, cutoff scores of a
26373  * variable w.r.t. a value by the given values (SCIP_VALUEHISTORY)
26374  *
26375  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26376  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26377  *
26378  * @pre This method can be called if @p scip is in one of the following stages:
26379  * - \ref SCIP_STAGE_TRANSFORMED
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  */
26388  SCIP* scip, /**< SCIP data structure */
26389  SCIP_VAR* var, /**< variable which should be initialized */
26390  SCIP_Real value, /**< domain value, or SCIP_UNKNOWN */
26391  SCIP_Real downvsids, /**< value to which VSIDS score for downwards branching should be initialized */
26392  SCIP_Real upvsids, /**< value to which VSIDS score for upwards branching should be initialized */
26393  SCIP_Real downconflen, /**< value to which conflict length score for downwards branching should be initialized */
26394  SCIP_Real upconflen, /**< value to which conflict length score for upwards branching should be initialized */
26395  SCIP_Real downinfer, /**< value to which inference counter for downwards branching should be initialized */
26396  SCIP_Real upinfer, /**< value to which inference counter for upwards branching should be initialized */
26397  SCIP_Real downcutoff, /**< value to which cutoff counter for downwards branching should be initialized */
26398  SCIP_Real upcutoff /**< value to which cutoff counter for upwards branching should be initialized */
26399  )
26400 {
26401  SCIP_CALL( checkStage(scip, "SCIPinitVarValueBranchStats", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26402 
26403  assert(downvsids >= 0.0 && upvsids >= 0.0);
26404  assert(downconflen >= 0.0 && upconflen >= 0.0);
26405  assert(downinfer >= 0.0 && upinfer >= 0.0);
26406  assert(downcutoff >= 0.0 && upcutoff >= 0.0);
26407 
26408  if( !SCIPisFeasZero(scip, downvsids) || !SCIPisFeasZero(scip, downinfer) || !SCIPisFeasZero(scip, downcutoff) )
26409  {
26410  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, 1) );
26411  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downinfer) );
26412  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downvsids) );
26413  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downcutoff) );
26414  }
26415 
26416  if( !SCIPisFeasZero(scip, downconflen) )
26417  {
26418  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_DOWNWARDS, value, downconflen) );
26419  }
26420 
26421  if( !SCIPisFeasZero(scip, upvsids) || !SCIPisFeasZero(scip, upinfer) || !SCIPisFeasZero(scip, upcutoff) )
26422  {
26423  SCIP_CALL( SCIPvarIncNBranchings(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, 1) );
26424  SCIP_CALL( SCIPvarIncInferenceSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upinfer) );
26425  SCIP_CALL( SCIPvarIncVSIDS(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upvsids) );
26426  SCIP_CALL( SCIPvarIncCutoffSum(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upcutoff) );
26427  }
26428 
26429  if( !SCIPisFeasZero(scip, upconflen) )
26430  {
26431  SCIP_CALL( SCIPvarIncNActiveConflicts(var, SCIPblkmem(scip), scip->set, scip->stat, SCIP_BRANCHDIR_UPWARDS, value, upconflen) );
26432  }
26433 
26434  return SCIP_OKAY;
26435 }
26436 
26437 /** returns the average number of cutoffs found after branching on the variable in given direction;
26438  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
26439  * over all variables for branching in the given direction is returned
26440  *
26441  * @return the average number of cutoffs found after branching on the variable in given direction
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  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26456  )
26457 {
26458  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffs", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26459 
26460  assert( var->scip == scip );
26461 
26462  return SCIPvarGetAvgCutoffs(var, scip->stat, dir);
26463 }
26464 
26465 /** returns the average number of cutoffs found after branching on the variable in given direction in the current run;
26466  * if branching on the variable in the given direction was yet evaluated, the average number of cutoffs
26467  * over all variables for branching in the given direction is returned
26468  *
26469  * @return the average number of cutoffs found after branching on the variable in given direction in the current run
26470  *
26471  * @pre This method can be called if @p scip is in one of the following stages:
26472  * - \ref SCIP_STAGE_INITPRESOLVE
26473  * - \ref SCIP_STAGE_PRESOLVING
26474  * - \ref SCIP_STAGE_EXITPRESOLVE
26475  * - \ref SCIP_STAGE_PRESOLVED
26476  * - \ref SCIP_STAGE_INITSOLVE
26477  * - \ref SCIP_STAGE_SOLVING
26478  * - \ref SCIP_STAGE_SOLVED
26479  */
26481  SCIP* scip, /**< SCIP data structure */
26482  SCIP_VAR* var, /**< problem variable */
26483  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
26484  )
26485 {
26486  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26487 
26488  assert( var->scip == scip );
26489 
26490  return SCIPvarGetAvgCutoffsCurrentRun(var, scip->stat, dir);
26491 }
26492 
26493 /** returns the variable's average cutoff score value
26494  *
26495  * @return the variable's average cutoff score value
26496  *
26497  * @pre This method can be called if @p scip is in one of the following stages:
26498  * - \ref SCIP_STAGE_INITPRESOLVE
26499  * - \ref SCIP_STAGE_PRESOLVING
26500  * - \ref SCIP_STAGE_EXITPRESOLVE
26501  * - \ref SCIP_STAGE_PRESOLVED
26502  * - \ref SCIP_STAGE_INITSOLVE
26503  * - \ref SCIP_STAGE_SOLVING
26504  * - \ref SCIP_STAGE_SOLVED
26505  */
26507  SCIP* scip, /**< SCIP data structure */
26508  SCIP_VAR* var /**< problem variable */
26509  )
26510 {
26511  SCIP_Real cutoffdown;
26512  SCIP_Real cutoffup;
26513 
26514  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26515 
26516  assert( var->scip == scip );
26517 
26518  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26519  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26520 
26521  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
26522 }
26523 
26524 /** returns the variable's average cutoff score value, only using cutoffs of the current run
26525  *
26526  * @return the variable's average cutoff score value, only using cutoffs of the current run
26527  *
26528  * @pre This method can be called if @p scip is in one of the following stages:
26529  * - \ref SCIP_STAGE_INITPRESOLVE
26530  * - \ref SCIP_STAGE_PRESOLVING
26531  * - \ref SCIP_STAGE_EXITPRESOLVE
26532  * - \ref SCIP_STAGE_PRESOLVED
26533  * - \ref SCIP_STAGE_INITSOLVE
26534  * - \ref SCIP_STAGE_SOLVING
26535  * - \ref SCIP_STAGE_SOLVED
26536  */
26538  SCIP* scip, /**< SCIP data structure */
26539  SCIP_VAR* var /**< problem variable */
26540  )
26541 {
26542  SCIP_Real cutoffdown;
26543  SCIP_Real cutoffup;
26544 
26545  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26546 
26547  assert( var->scip == scip );
26548 
26551 
26552  return SCIPbranchGetScore(scip->set, var, cutoffdown, cutoffup);
26553 }
26554 
26555 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
26556  * factor
26557  *
26558  * @return the variable's average inference/cutoff score value
26559  *
26560  * @pre This method can be called if @p scip is in one of the following stages:
26561  * - \ref SCIP_STAGE_INITPRESOLVE
26562  * - \ref SCIP_STAGE_PRESOLVING
26563  * - \ref SCIP_STAGE_EXITPRESOLVE
26564  * - \ref SCIP_STAGE_PRESOLVED
26565  * - \ref SCIP_STAGE_INITSOLVE
26566  * - \ref SCIP_STAGE_SOLVING
26567  * - \ref SCIP_STAGE_SOLVED
26568  */
26570  SCIP* scip, /**< SCIP data structure */
26571  SCIP_VAR* var, /**< problem variable */
26572  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
26573  )
26574 {
26575  SCIP_Real avginferdown;
26576  SCIP_Real avginferup;
26577  SCIP_Real avginfer;
26578  SCIP_Real inferdown;
26579  SCIP_Real inferup;
26580  SCIP_Real cutoffdown;
26581  SCIP_Real cutoffup;
26582 
26583  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScore", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26584 
26585  assert( var->scip == scip );
26586 
26589  avginfer = (avginferdown + avginferup)/2.0;
26590  inferdown = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26591  inferup = SCIPvarGetAvgInferences(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26592  cutoffdown = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_DOWNWARDS);
26593  cutoffup = SCIPvarGetAvgCutoffs(var, scip->stat, SCIP_BRANCHDIR_UPWARDS);
26594 
26595  return SCIPbranchGetScore(scip->set, var,
26596  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
26597 }
26598 
26599 /** returns the variable's average inference/cutoff score value, weighting the cutoffs of the variable with the given
26600  * factor, only using inferences and cutoffs of the current run
26601  *
26602  * @return the variable's average inference/cutoff score value, only using inferences and cutoffs of the current run
26603  *
26604  * @pre This method can be called if @p scip is in one of the following stages:
26605  * - \ref SCIP_STAGE_INITPRESOLVE
26606  * - \ref SCIP_STAGE_PRESOLVING
26607  * - \ref SCIP_STAGE_EXITPRESOLVE
26608  * - \ref SCIP_STAGE_PRESOLVED
26609  * - \ref SCIP_STAGE_INITSOLVE
26610  * - \ref SCIP_STAGE_SOLVING
26611  * - \ref SCIP_STAGE_SOLVED
26612  */
26614  SCIP* scip, /**< SCIP data structure */
26615  SCIP_VAR* var, /**< problem variable */
26616  SCIP_Real cutoffweight /**< factor to weigh average number of cutoffs in branching score */
26617  )
26618 {
26619  SCIP_Real avginferdown;
26620  SCIP_Real avginferup;
26621  SCIP_Real avginfer;
26622  SCIP_Real inferdown;
26623  SCIP_Real inferup;
26624  SCIP_Real cutoffdown;
26625  SCIP_Real cutoffup;
26626 
26627  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarAvgInferenceCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
26628 
26629  assert( var->scip == scip );
26630 
26633  avginfer = (avginferdown + avginferup)/2.0;
26638 
26639  return SCIPbranchGetScore(scip->set, var,
26640  inferdown + cutoffweight * avginfer * cutoffdown, inferup + cutoffweight * avginfer * cutoffup);
26641 }
26642 
26643 /** outputs variable information to file stream via the message system
26644  *
26645  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26646  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26647  *
26648  * @pre This method can be called if @p scip is in one of the following stages:
26649  * - \ref SCIP_STAGE_PROBLEM
26650  * - \ref SCIP_STAGE_TRANSFORMING
26651  * - \ref SCIP_STAGE_TRANSFORMED
26652  * - \ref SCIP_STAGE_INITPRESOLVE
26653  * - \ref SCIP_STAGE_PRESOLVING
26654  * - \ref SCIP_STAGE_EXITPRESOLVE
26655  * - \ref SCIP_STAGE_PRESOLVED
26656  * - \ref SCIP_STAGE_INITSOLVE
26657  * - \ref SCIP_STAGE_SOLVING
26658  * - \ref SCIP_STAGE_SOLVED
26659  * - \ref SCIP_STAGE_EXITSOLVE
26660  * - \ref SCIP_STAGE_FREETRANS
26661  *
26662  * @note If the message handler is set to a NULL pointer nothing will be printed
26663  */
26665  SCIP* scip, /**< SCIP data structure */
26666  SCIP_VAR* var, /**< problem variable */
26667  FILE* file /**< output file (or NULL for standard output) */
26668  )
26669 {
26670  SCIP_CALL( checkStage(scip, "SCIPprintVar", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
26671 
26672  SCIP_CALL( SCIPvarPrint(var, scip->set, scip->messagehdlr, file) );
26673 
26674  return SCIP_OKAY;
26675 }
26676 
26677 /*
26678  * conflict analysis methods
26679  */
26680 
26681 /** return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
26682  * conflict analysis since it will not be applied
26683  *
26684  * @return return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
26685  * conflict analysis since it will not be applied
26686  *
26687  * @pre This method can be called if SCIP is in one of the following stages:
26688  * - \ref SCIP_STAGE_INITPRESOLVE
26689  * - \ref SCIP_STAGE_PRESOLVING
26690  * - \ref SCIP_STAGE_EXITPRESOLVE
26691  * - \ref SCIP_STAGE_SOLVING
26692  *
26693  * @note SCIP stage does not get changed
26694  */
26696  SCIP* scip /**< SCIP data structure */
26697  )
26698 {
26699  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictAnalysisApplicable", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26700 
26701  return (SCIPgetDepth(scip) > 0 && SCIPconflictApplicable(scip->set));
26702 }
26703 
26704 /** initializes the conflict analysis by clearing the conflict candidate queue; this method must be called before you
26705  * enter the conflict variables by calling SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
26706  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
26707  *
26708  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26709  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26710  *
26711  * @pre This method can be called if SCIP is in one of the following stages:
26712  * - \ref SCIP_STAGE_PRESOLVING
26713  * - \ref SCIP_STAGE_SOLVING
26714  *
26715  * @note SCIP stage does not get changed
26716  */
26718  SCIP* scip, /**< SCIP data structure */
26719  SCIP_CONFTYPE conftype, /**< type of conflict */
26720  SCIP_Bool iscutoffinvolved /**< is the current cutoff bound involved? */
26721  )
26722 {
26723  SCIP_CALL( checkStage(scip, "SCIPinitConflictAnalysis", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26724 
26725  SCIP_CALL( SCIPconflictInit(scip->conflict, scip->set, scip->stat, scip->transprob, conftype, iscutoffinvolved) );
26726 
26727  return SCIP_OKAY;
26728 }
26729 
26730 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
26731  * this method should be called in one of the following two cases:
26732  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictLb() should be called for each lower bound
26733  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
26734  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictLb() should be called
26735  * for each lower bound, whose current assignment led to the deduction of the given conflict bound.
26736  *
26737  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26738  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26739  *
26740  * @pre This method can be called if SCIP is in one of the following stages:
26741  * - \ref SCIP_STAGE_PRESOLVING
26742  * - \ref SCIP_STAGE_SOLVING
26743  *
26744  * @note SCIP stage does not get changed
26745  */
26747  SCIP* scip, /**< SCIP data structure */
26748  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
26749  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
26750  * conflicting bound was valid, NULL for current local bound */
26751  )
26752 {
26753  SCIP_CALL( checkStage(scip, "SCIPaddConflictLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26754 
26755  assert( var->scip == scip );
26756 
26757  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx) );
26758 
26759  return SCIP_OKAY;
26760 }
26761 
26762 /** adds lower bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
26763  * with the additional information of a relaxed lower bound; this relaxed lower bound is the one which would be enough
26764  * to explain a certain bound change;
26765  * this method should be called in one of the following two cases:
26766  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedLb() should be called for each (relaxed) lower bound
26767  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
26768  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelexedLb() should be called
26769  * for each (relaxed) lower bound, whose current assignment led to the deduction of the given conflict bound.
26770  *
26771  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26772  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26773  *
26774  * @pre This method can be called if SCIP is in one of the following stages:
26775  * - \ref SCIP_STAGE_PRESOLVING
26776  * - \ref SCIP_STAGE_SOLVING
26777  *
26778  * @note SCIP stage does not get changed
26779  */
26781  SCIP* scip, /**< SCIP data structure */
26782  SCIP_VAR* var, /**< variable whose lower bound should be added to conflict candidate queue */
26783  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
26784  * conflicting bound was valid, NULL for current local bound */
26785  SCIP_Real relaxedlb /**< the relaxed lower bound */
26786  )
26787 {
26788  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26789 
26790  assert( var->scip == scip );
26791 
26792  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, bdchgidx, relaxedlb) );
26793 
26794  return SCIP_OKAY;
26795 }
26796 
26797 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage;
26798  * this method should be called in one of the following two cases:
26799  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictUb() should be called for each upper bound that
26800  * led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
26801  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictUb() should be called for
26802  * each upper bound, whose current assignment led to the deduction of the given conflict bound.
26803  *
26804  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26805  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26806  *
26807  * @pre This method can be called if SCIP is in one of the following stages:
26808  * - \ref SCIP_STAGE_PRESOLVING
26809  * - \ref SCIP_STAGE_SOLVING
26810  *
26811  * @note SCIP stage does not get changed
26812  */
26814  SCIP* scip, /**< SCIP data structure */
26815  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
26816  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
26817  * conflicting bound was valid, NULL for current local bound */
26818  )
26819 {
26820  SCIP_CALL( checkStage(scip, "SCIPaddConflictUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26821 
26822  assert( var->scip == scip );
26823 
26824  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx) );
26825 
26826  return SCIP_OKAY;
26827 }
26828 
26829 /** adds upper bound of variable at the time of the given bound change index to the conflict analysis' candidate storage
26830  * with the additional information of a relaxed upper bound; this relaxed upper bound is the one which would be enough
26831  * to explain a certain bound change;
26832  * this method should be called in one of the following two cases:
26833  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedUb() should be called for each (relaxed) upper
26834  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
26835  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedUb() should be
26836  * called for each (relaxed) upper bound, whose current assignment led to the deduction of the given conflict
26837  * bound.
26838  *
26839  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26840  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26841  *
26842  * @pre This method can be called if SCIP is in one of the following stages:
26843  * - \ref SCIP_STAGE_PRESOLVING
26844  * - \ref SCIP_STAGE_SOLVING
26845  *
26846  * @note SCIP stage does not get changed
26847  */
26849  SCIP* scip, /**< SCIP data structure */
26850  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
26851  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
26852  * conflicting bound was valid, NULL for current local bound */
26853  SCIP_Real relaxedub /**< the relaxed upper bound */
26854  )
26855 {
26856  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26857 
26858  assert( var->scip == scip );
26859 
26860  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, bdchgidx, relaxedub) );
26861 
26862  return SCIP_OKAY;
26863 }
26864 
26865 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis' candidate
26866  * storage; this method should be called in one of the following two cases:
26867  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBd() should be called for each bound
26868  * that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
26869  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBd() should be called
26870  * for each bound, whose current assignment led to the deduction of the given conflict bound.
26871  *
26872  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26873  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26874  *
26875  * @pre This method can be called if SCIP is in one of the following stages:
26876  * - \ref SCIP_STAGE_PRESOLVING
26877  * - \ref SCIP_STAGE_SOLVING
26878  *
26879  * @note SCIP stage does not get changed
26880  */
26882  SCIP* scip, /**< SCIP data structure */
26883  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
26884  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
26885  SCIP_BDCHGIDX* bdchgidx /**< bound change index representing time on path to current node, when the
26886  * conflicting bound was valid, NULL for current local bound */
26887  )
26888 {
26889  SCIP_CALL( checkStage(scip, "SCIPaddConflictBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26890 
26891  assert( var->scip == scip );
26892 
26893  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx) );
26894 
26895  return SCIP_OKAY;
26896 }
26897 
26898 /** adds lower or upper bound of variable at the time of the given bound change index to the conflict analysis'
26899  * candidate storage; with the additional information of a relaxed upper bound; this relaxed upper bound is the one
26900  * which would be enough to explain a certain bound change;
26901  * this method should be called in one of the following two cases:
26902  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictRelaxedBd() should be called for each (relaxed)
26903  * bound that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
26904  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictRelaxedBd() should be
26905  * called for each (relaxed) bound, whose current assignment led to the deduction of the given conflict bound.
26906  *
26907  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26908  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26909  *
26910  * @pre This method can be called if SCIP is in one of the following stages:
26911  * - \ref SCIP_STAGE_PRESOLVING
26912  * - \ref SCIP_STAGE_SOLVING
26913  *
26914  * @note SCIP stage does not get changed
26915  */
26917  SCIP* scip, /**< SCIP data structure */
26918  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
26919  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
26920  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
26921  * conflicting bound was valid, NULL for current local bound */
26922  SCIP_Real relaxedbd /**< the relaxed bound */
26923  )
26924 {
26925  SCIP_CALL( checkStage(scip, "SCIPaddConflictRelaxedBd", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26926 
26927  assert( var->scip == scip );
26928 
26929  SCIP_CALL( SCIPconflictAddRelaxedBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, boundtype, bdchgidx, relaxedbd) );
26930 
26931  return SCIP_OKAY;
26932 }
26933 
26934 /** adds changed bound of fixed binary variable to the conflict analysis' candidate storage;
26935  * this method should be called in one of the following two cases:
26936  * 1. Before calling the SCIPanalyzeConflict() method, SCIPaddConflictBinvar() should be called for each fixed binary
26937  * variable that led to the conflict (e.g. the infeasibility of globally or locally valid constraint).
26938  * 2. In the propagation conflict resolving method of a constraint handler, SCIPaddConflictBinvar() should be called
26939  * for each binary variable, whose current fixing led to the deduction of the given conflict bound.
26940  *
26941  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26942  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26943  *
26944  * @pre This method can be called if SCIP is in one of the following stages:
26945  * - \ref SCIP_STAGE_PRESOLVING
26946  * - \ref SCIP_STAGE_SOLVING
26947  *
26948  * @note SCIP stage does not get changed
26949  */
26951  SCIP* scip, /**< SCIP data structure */
26952  SCIP_VAR* var /**< binary variable whose changed bound should be added to conflict queue */
26953  )
26954 {
26955  SCIP_CALL( checkStage(scip, "SCIPaddConflictBinvar", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26956 
26957  assert(var->scip == scip);
26958  assert(SCIPvarIsBinary(var));
26959 
26960  if( SCIPvarGetLbLocal(var) > 0.5 )
26961  {
26962  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_LOWER, NULL) );
26963  }
26964  else if( SCIPvarGetUbLocal(var) < 0.5 )
26965  {
26966  SCIP_CALL( SCIPconflictAddBound(scip->conflict, scip->mem->probmem, scip->set, scip->stat, var, SCIP_BOUNDTYPE_UPPER, NULL) );
26967  }
26968 
26969  return SCIP_OKAY;
26970 }
26971 
26972 /** checks if the given variable is already part of the current conflict set or queued for resolving with the same or
26973  * even stronger bound
26974  *
26975  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
26976  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
26977  *
26978  * @pre This method can be called if SCIP is in one of the following stages:
26979  * - \ref SCIP_STAGE_PRESOLVING
26980  * - \ref SCIP_STAGE_SOLVING
26981  *
26982  * @note SCIP stage does not get changed
26983  */
26985  SCIP* scip, /**< SCIP data structure */
26986  SCIP_VAR* var, /**< variable whose upper bound should be added to conflict candidate queue */
26987  SCIP_BOUNDTYPE boundtype, /**< the type of the conflicting bound (lower or upper bound) */
26988  SCIP_BDCHGIDX* bdchgidx, /**< bound change index representing time on path to current node, when the
26989  * conflicting bound was valid, NULL for current local bound */
26990  SCIP_Bool* used /**< pointer to store if the variable is already used */
26991  )
26992 {
26993  SCIP_CALL_ABORT( checkStage(scip, "SCIPisConflictVarUsed", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
26994 
26995  assert( var->scip == scip );
26996 
26997  return SCIPconflictIsVarUsed(scip->conflict, var, scip->set, boundtype, bdchgidx, used);
26998 }
26999 
27000 /** returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
27001  * bound
27002  *
27003  * @return returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
27004  * bound
27005  *
27006  * @pre This method can be called if SCIP is in one of the following stages:
27007  * - \ref SCIP_STAGE_PRESOLVING
27008  * - \ref SCIP_STAGE_SOLVING
27009  *
27010  * @note SCIP stage does not get changed
27011  */
27013  SCIP* scip, /**< SCIP data structure */
27014  SCIP_VAR* var /**< problem variable */
27015  )
27016 {
27017  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarLb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27018 
27019  assert( var->scip == scip );
27020 
27021  return SCIPconflictGetVarLb(scip->conflict, var);
27022 }
27023 
27024 /** returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
27025  * upper bound
27026  *
27027  * @return returns the conflict upper bound if the variable is present in the current conflict set; otherwise minus global
27028  * upper bound
27029  *
27030  * @pre This method can be called if SCIP is in one of the following stages:
27031  * - \ref SCIP_STAGE_PRESOLVING
27032  * - \ref SCIP_STAGE_SOLVING
27033  *
27034  * @note SCIP stage does not get changed
27035  */
27037  SCIP* scip, /**< SCIP data structure */
27038  SCIP_VAR* var /**< problem variable */
27039  )
27040 {
27041  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetConflictVarUb", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27042 
27043  assert( var->scip == scip );
27044 
27045  return SCIPconflictGetVarUb(scip->conflict, var);
27046 }
27047 
27048 /** analyzes conflict bounds that were added after a call to SCIPinitConflictAnalysis() with calls to
27049  * SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(),
27050  * SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar(); on success, calls the conflict
27051  * handlers to create a conflict constraint out of the resulting conflict set; the given valid depth must be a depth
27052  * level, at which the conflict set defined by calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
27053  * SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar() is
27054  * valid for the whole subtree; if the conflict was found by a violated constraint, use SCIPanalyzeConflictCons()
27055  * instead of SCIPanalyzeConflict() to make sure, that the correct valid depth is used
27056  *
27057  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27058  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27059  *
27060  * @pre This method can be called if SCIP is in one of the following stages:
27061  * - \ref SCIP_STAGE_PRESOLVING
27062  * - \ref SCIP_STAGE_SOLVING
27063  *
27064  * @note SCIP stage does not get changed
27065  */
27067  SCIP* scip, /**< SCIP data structure */
27068  int validdepth, /**< minimal depth level at which the initial conflict set is valid */
27069  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
27070  )
27071 {
27072  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflict", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27073 
27074  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27075  scip->transprob, scip->tree, validdepth, success) );
27076 
27077  return SCIP_OKAY;
27078 }
27079 
27080 /** analyzes conflict bounds that were added with calls to SCIPaddConflictLb(), SCIPaddConflictUb(),
27081  * SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or
27082  * SCIPaddConflictBinvar(); on success, calls the conflict handlers to create a conflict constraint out of the
27083  * resulting conflict set; the given constraint must be the constraint that detected the conflict, i.e. the constraint
27084  * that is infeasible in the local bounds of the initial conflict set (defined by calls to SCIPaddConflictLb(),
27085  * SCIPaddConflictUb(), SCIPaddConflictBd(), SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(),
27086  * SCIPaddConflictRelaxedBd(), and SCIPaddConflictBinvar())
27087  *
27088  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27089  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27090  *
27091  * @pre This method can be called if SCIP is in one of the following stages:
27092  * - \ref SCIP_STAGE_PRESOLVING
27093  * - \ref SCIP_STAGE_SOLVING
27094  *
27095  * @note SCIP stage does not get changed
27096  */
27098  SCIP* scip, /**< SCIP data structure */
27099  SCIP_CONS* cons, /**< constraint that detected the conflict */
27100  SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
27101  )
27102 {
27103  SCIP_CALL( checkStage(scip, "SCIPanalyzeConflictCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27104 
27105  if( SCIPconsIsGlobal(cons) )
27106  {
27107  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27108  scip->transprob, scip->tree, 0, success) );
27109  }
27110  else if( SCIPconsIsActive(cons) )
27111  {
27112  SCIP_CALL( SCIPconflictAnalyze(scip->conflict, scip->mem->probmem, scip->set, scip->stat,
27113  scip->transprob, scip->tree, SCIPconsGetValidDepth(cons), success) );
27114  }
27115 
27116  return SCIP_OKAY;
27117 }
27118 
27119 /*
27120  * constraint methods
27121  */
27122 
27123 /** creates and captures a constraint of the given constraint handler
27124  *
27125  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
27126  * be declared feasible even if it violates this particular constraint. This constellation should only be
27127  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
27128  * to the variable's local bounds.
27129  *
27130  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27131  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27132  *
27133  * @pre This method can be called if @p scip is in one of the following stages:
27134  * - \ref SCIP_STAGE_PROBLEM
27135  * - \ref SCIP_STAGE_TRANSFORMING
27136  * - \ref SCIP_STAGE_INITPRESOLVE
27137  * - \ref SCIP_STAGE_PRESOLVING
27138  * - \ref SCIP_STAGE_EXITPRESOLVE
27139  * - \ref SCIP_STAGE_PRESOLVED
27140  * - \ref SCIP_STAGE_INITSOLVE
27141  * - \ref SCIP_STAGE_SOLVING
27142  * - \ref SCIP_STAGE_EXITSOLVE
27143  *
27144  * @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
27145  */
27147  SCIP* scip, /**< SCIP data structure */
27148  SCIP_CONS** cons, /**< pointer to constraint */
27149  const char* name, /**< name of constraint */
27150  SCIP_CONSHDLR* conshdlr, /**< constraint handler for this constraint */
27151  SCIP_CONSDATA* consdata, /**< data for this specific constraint */
27152  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
27153  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
27154  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
27155  * Usually set to TRUE. */
27156  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
27157  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27158  SCIP_Bool check, /**< should the constraint be checked for feasibility?
27159  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27160  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
27161  * Usually set to TRUE. */
27162  SCIP_Bool local, /**< is constraint only valid locally?
27163  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
27164  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
27165  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
27166  * adds coefficients to this constraint. */
27167  SCIP_Bool dynamic, /**< is constraint subject to aging?
27168  * Usually set to FALSE. Set to TRUE for own cuts which
27169  * are separated as constraints. */
27170  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
27171  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
27172  SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
27173  * if it may be moved to a more global node?
27174  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
27175  )
27176 {
27177  assert(cons != NULL);
27178  assert(name != NULL);
27179  assert(conshdlr != NULL);
27180 
27181  SCIP_CALL( checkStage(scip, "SCIPcreateCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27182 
27183  switch( scip->set->stage )
27184  {
27185  case SCIP_STAGE_PROBLEM:
27186  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
27187  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, TRUE, TRUE) );
27188  return SCIP_OKAY;
27189 
27193  case SCIP_STAGE_PRESOLVING:
27195  case SCIP_STAGE_PRESOLVED:
27196  case SCIP_STAGE_INITSOLVE:
27197  case SCIP_STAGE_SOLVING:
27198  case SCIP_STAGE_EXITSOLVE:
27199  SCIP_CALL( SCIPconsCreate(cons, scip->mem->probmem, scip->set, name, conshdlr, consdata,
27200  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, FALSE, TRUE) );
27201  return SCIP_OKAY;
27202 
27203  default:
27204  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
27205  return SCIP_INVALIDCALL;
27206  } /*lint !e788*/
27207 }
27208 
27209 /** parses constraint information (in cip format) out of a string; if the parsing process was successful a constraint is
27210  * creates and captures;
27211  *
27212  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27213  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27214  *
27215  * @pre This method can be called if @p scip is in one of the following stages:
27216  * - \ref SCIP_STAGE_PROBLEM
27217  * - \ref SCIP_STAGE_TRANSFORMING
27218  * - \ref SCIP_STAGE_INITPRESOLVE
27219  * - \ref SCIP_STAGE_PRESOLVING
27220  * - \ref SCIP_STAGE_EXITPRESOLVE
27221  * - \ref SCIP_STAGE_PRESOLVED
27222  * - \ref SCIP_STAGE_SOLVING
27223  * - \ref SCIP_STAGE_EXITSOLVE
27224  *
27225  * @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution may
27226  * be declared feasible even if it violates this particular constraint. This constellation should only be
27227  * used, if no LP or pseudo solution can violate the constraint -- e.g. if a local constraint is redundant due
27228  * to the variable's local bounds.
27229  */
27231  SCIP* scip, /**< SCIP data structure */
27232  SCIP_CONS** cons, /**< pointer to store constraint */
27233  const char* str, /**< string to parse for constraint */
27234  SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
27235  * Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
27236  SCIP_Bool separate, /**< should the constraint be separated during LP processing?
27237  * Usually set to TRUE. */
27238  SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
27239  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27240  SCIP_Bool check, /**< should the constraint be checked for feasibility?
27241  * TRUE for model constraints, FALSE for additional, redundant constraints. */
27242  SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
27243  * Usually set to TRUE. */
27244  SCIP_Bool local, /**< is constraint only valid locally?
27245  * Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
27246  SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
27247  * Usually set to FALSE. In column generation applications, set to TRUE if pricing
27248  * adds coefficients to this constraint. */
27249  SCIP_Bool dynamic, /**< is constraint subject to aging?
27250  * Usually set to FALSE. Set to TRUE for own cuts which
27251  * are separated as constraints. */
27252  SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
27253  * Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
27254  SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
27255  * if it may be moved to a more global node?
27256  * Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
27257  SCIP_Bool* success /**< pointer to store if the paring process was successful */
27258  )
27259 {
27260  assert(cons != NULL);
27261 
27262  SCIP_CALL( checkStage(scip, "SCIPparseCons", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27263 
27264  SCIP_CALL( SCIPconsParse(cons, scip->set, scip->messagehdlr, str,
27265  initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
27266 
27267 
27268  return SCIP_OKAY;
27269 }
27270 
27271 /** increases usage counter of constraint
27272  *
27273  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27274  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27275  *
27276  * @pre This method can be called if @p scip is in one of the following stages:
27277  * - \ref SCIP_STAGE_PROBLEM
27278  * - \ref SCIP_STAGE_TRANSFORMING
27279  * - \ref SCIP_STAGE_TRANSFORMED
27280  * - \ref SCIP_STAGE_INITPRESOLVE
27281  * - \ref SCIP_STAGE_PRESOLVING
27282  * - \ref SCIP_STAGE_EXITPRESOLVE
27283  * - \ref SCIP_STAGE_PRESOLVED
27284  * - \ref SCIP_STAGE_INITSOLVE
27285  * - \ref SCIP_STAGE_SOLVING
27286  * - \ref SCIP_STAGE_SOLVED
27287  */
27289  SCIP* scip, /**< SCIP data structure */
27290  SCIP_CONS* cons /**< constraint to capture */
27291  )
27292 {
27293  SCIP_CALL( checkStage(scip, "SCIPcaptureCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27294 
27295  assert( cons->scip == scip );
27296 
27297  SCIPconsCapture(cons);
27298 
27299  return SCIP_OKAY;
27300 }
27301 
27302 /** decreases usage counter of constraint, if the usage pointer reaches zero the constraint gets freed
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 @p scip is in one of the following stages:
27308  * - \ref SCIP_STAGE_PROBLEM
27309  * - \ref SCIP_STAGE_TRANSFORMING
27310  * - \ref SCIP_STAGE_TRANSFORMED
27311  * - \ref SCIP_STAGE_INITPRESOLVE
27312  * - \ref SCIP_STAGE_PRESOLVING
27313  * - \ref SCIP_STAGE_EXITPRESOLVE
27314  * - \ref SCIP_STAGE_PRESOLVED
27315  * - \ref SCIP_STAGE_INITSOLVE
27316  * - \ref SCIP_STAGE_SOLVING
27317  * - \ref SCIP_STAGE_SOLVED
27318  * - \ref SCIP_STAGE_EXITSOLVE
27319  * - \ref SCIP_STAGE_FREETRANS
27320  *
27321  * @note the pointer of the constraint will be NULLed
27322  */
27324  SCIP* scip, /**< SCIP data structure */
27325  SCIP_CONS** cons /**< pointer to constraint */
27326  )
27327 {
27328  assert(cons != NULL);
27329  assert(*cons != NULL);
27330 
27331  SCIP_CALL( checkStage(scip, "SCIPreleaseCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
27332 
27333  switch( scip->set->stage )
27334  {
27335  case SCIP_STAGE_PROBLEM:
27336  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
27337  return SCIP_OKAY;
27338 
27342  case SCIP_STAGE_PRESOLVING:
27344  case SCIP_STAGE_PRESOLVED:
27345  case SCIP_STAGE_INITSOLVE:
27346  case SCIP_STAGE_SOLVING:
27347  case SCIP_STAGE_SOLVED:
27348  case SCIP_STAGE_EXITSOLVE:
27349  case SCIP_STAGE_FREETRANS:
27350  if( SCIPconsIsOriginal(*cons) && (*cons)->nuses == 1 )
27351  {
27352  SCIPerrorMessage("cannot release last use of original constraint while the transformed problem exists\n");
27353  return SCIP_INVALIDCALL;
27354  }
27355  SCIP_CALL( SCIPconsRelease(cons, scip->mem->probmem, scip->set) );
27356  return SCIP_OKAY;
27357 
27358  default:
27359  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
27360  return SCIP_INVALIDCALL;
27361  } /*lint !e788*/
27362 }
27363 
27364 /** change constraint name
27365  *
27366  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27367  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27368  *
27369  * @pre This method can be called if @p scip is in one of the following stages:
27370  * - \ref SCIP_STAGE_PROBLEM
27371  *
27372  * @note to get the current name of a constraint, use SCIPconsGetName() from pub_cons.h
27373  */
27375  SCIP* scip, /**< SCIP data structure */
27376  SCIP_CONS* cons, /**< constraint */
27377  const char* name /**< new name of constraint */
27378  )
27379 {
27380  SCIP_CALL( checkStage(scip, "SCIPchgConsName", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE , FALSE, FALSE, FALSE) );
27381 
27382  assert( cons->scip == scip );
27383 
27384  if( SCIPgetStage(scip) != SCIP_STAGE_PROBLEM )
27385  {
27386  SCIPerrorMessage("constraint names can only be changed in problem creation stage\n");
27387  SCIPABORT();
27388  return SCIP_INVALIDCALL; /*lint !e527*/
27389  }
27390 
27391  /* remove constraint's name from the namespace if the constraint was already added */
27392  if( SCIPconsIsAdded(cons) )
27393  {
27394  SCIP_CALL( SCIPprobRemoveConsName(scip->origprob, cons) );
27395  }
27396 
27397  /* change constraint name */
27398  SCIP_CALL( SCIPconsChgName(cons, SCIPblkmem(scip), name) );
27399 
27400  /* add constraint's name to the namespace if the constraint was already added */
27401  if( SCIPconsIsAdded(cons) )
27402  {
27403  SCIP_CALL( SCIPprobAddConsName(scip->origprob, cons) );
27404  }
27405 
27406  return SCIP_OKAY;
27407 }
27408 
27409 /** sets the initial flag of the given constraint
27410  *
27411  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27412  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27413  *
27414  * @pre This method can be called if @p scip is in one of the following stages:
27415  * - \ref SCIP_STAGE_PROBLEM
27416  * - \ref SCIP_STAGE_TRANSFORMING
27417  * - \ref SCIP_STAGE_PRESOLVING
27418  * - \ref SCIP_STAGE_PRESOLVED
27419  * - \ref SCIP_STAGE_SOLVING
27420  */
27422  SCIP* scip, /**< SCIP data structure */
27423  SCIP_CONS* cons, /**< constraint */
27424  SCIP_Bool initial /**< new value */
27425  )
27426 {
27427  SCIP_CALL( checkStage(scip, "SCIPsetConsInitial", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27428 
27429  SCIP_CALL( SCIPconsSetInitial(cons, scip->set, scip->stat, initial) );
27430 
27431  return SCIP_OKAY;
27432 }
27433 
27434 /** sets the separate flag of the given constraint
27435  *
27436  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27437  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27438  *
27439  * @pre This method can be called if @p scip is in one of the following stages:
27440  * - \ref SCIP_STAGE_PROBLEM
27441  * - \ref SCIP_STAGE_TRANSFORMING
27442  * - \ref SCIP_STAGE_PRESOLVING
27443  * - \ref SCIP_STAGE_PRESOLVED
27444  * - \ref SCIP_STAGE_SOLVING
27445  */
27447  SCIP* scip, /**< SCIP data structure */
27448  SCIP_CONS* cons, /**< constraint */
27449  SCIP_Bool separate /**< new value */
27450  )
27451 {
27452  SCIP_CALL( checkStage(scip, "SCIPsetConsSeparated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27453 
27454  SCIP_CALL( SCIPconsSetSeparated(cons, scip->set, separate) );
27455 
27456  return SCIP_OKAY;
27457 }
27458 
27459 /** sets the enforce flag of the given constraint
27460  *
27461  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27462  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27463  *
27464  * @pre This method can be called if @p scip is in one of the following stages:
27465  * - \ref SCIP_STAGE_PROBLEM
27466  * - \ref SCIP_STAGE_TRANSFORMING
27467  * - \ref SCIP_STAGE_PRESOLVING
27468  * - \ref SCIP_STAGE_PRESOLVED
27469  * - \ref SCIP_STAGE_SOLVING
27470  */
27472  SCIP* scip, /**< SCIP data structure */
27473  SCIP_CONS* cons, /**< constraint */
27474  SCIP_Bool enforce /**< new value */
27475  )
27476 {
27477  SCIP_CALL( checkStage(scip, "SCIPsetConsEnforced", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27478 
27479  SCIP_CALL( SCIPconsSetEnforced(cons, scip->set, enforce) );
27480 
27481  return SCIP_OKAY;
27482 }
27483 
27484 /** sets the check flag of the given constraint
27485  *
27486  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27487  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27488  *
27489  * @pre This method can be called if @p scip is in one of the following stages:
27490  * - \ref SCIP_STAGE_PROBLEM
27491  * - \ref SCIP_STAGE_TRANSFORMING
27492  * - \ref SCIP_STAGE_PRESOLVING
27493  * - \ref SCIP_STAGE_PRESOLVED
27494  * - \ref SCIP_STAGE_SOLVING
27495  */
27497  SCIP* scip, /**< SCIP data structure */
27498  SCIP_CONS* cons, /**< constraint */
27499  SCIP_Bool check /**< new value */
27500  )
27501 {
27502  SCIP_CALL( checkStage(scip, "SCIPsetConsChecked", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27503 
27504  SCIP_CALL( SCIPconsSetChecked(cons, scip->set, check) );
27505 
27506  return SCIP_OKAY;
27507 }
27508 
27509 /** sets the propagate flag of the given constraint
27510  *
27511  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27512  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27513  *
27514  * @pre This method can be called if @p scip is in one of the following stages:
27515  * - \ref SCIP_STAGE_PROBLEM
27516  * - \ref SCIP_STAGE_TRANSFORMING
27517  * - \ref SCIP_STAGE_PRESOLVING
27518  * - \ref SCIP_STAGE_PRESOLVED
27519  * - \ref SCIP_STAGE_SOLVING
27520  */
27522  SCIP* scip, /**< SCIP data structure */
27523  SCIP_CONS* cons, /**< constraint */
27524  SCIP_Bool propagate /**< new value */
27525  )
27526 {
27527  SCIP_CALL( checkStage(scip, "SCIPsetConsPropagated", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27528 
27529  SCIP_CALL( SCIPconsSetPropagated(cons, scip->set, propagate) );
27530 
27531  return SCIP_OKAY;
27532 }
27533 
27534 /** sets the local flag of the given constraint
27535  *
27536  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27537  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27538  *
27539  * @pre This method can be called if @p scip is in one of the following stages:
27540  * - \ref SCIP_STAGE_PROBLEM
27541  * - \ref SCIP_STAGE_TRANSFORMING
27542  * - \ref SCIP_STAGE_INITPRESOLVE
27543  * - \ref SCIP_STAGE_PRESOLVING
27544  * - \ref SCIP_STAGE_PRESOLVED
27545  * - \ref SCIP_STAGE_INITSOLVE
27546  * - \ref SCIP_STAGE_SOLVING
27547  */
27549  SCIP* scip, /**< SCIP data structure */
27550  SCIP_CONS* cons, /**< constraint */
27551  SCIP_Bool local /**< new value */
27552  )
27553 {
27554  SCIP_CALL( checkStage(scip, "SCIPsetConsLocal", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27555 
27556  SCIPconsSetLocal(cons, local);
27557 
27558  return SCIP_OKAY;
27559 }
27560 
27561 /** sets the modifiable flag of the given constraint
27562  *
27563  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27564  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27565  *
27566  * @pre This method can be called if @p scip is in one of the following stages:
27567  * - \ref SCIP_STAGE_PROBLEM
27568  * - \ref SCIP_STAGE_TRANSFORMING
27569  * - \ref SCIP_STAGE_PRESOLVING
27570  * - \ref SCIP_STAGE_PRESOLVED
27571  * - \ref SCIP_STAGE_SOLVING
27572  * - \ref SCIP_STAGE_EXITSOLVE
27573  */
27575  SCIP* scip, /**< SCIP data structure */
27576  SCIP_CONS* cons, /**< constraint */
27577  SCIP_Bool modifiable /**< new value */
27578  )
27579 {
27580  SCIP_CALL( checkStage(scip, "SCIPsetConsModifiable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE) );
27581 
27582  SCIPconsSetModifiable(cons, modifiable);
27583 
27584  return SCIP_OKAY;
27585 }
27586 
27587 /** sets the dynamic flag of the given constraint
27588  *
27589  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27590  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27591  *
27592  * @pre This method can be called if @p scip is in one of the following stages:
27593  * - \ref SCIP_STAGE_PROBLEM
27594  * - \ref SCIP_STAGE_TRANSFORMING
27595  * - \ref SCIP_STAGE_PRESOLVING
27596  * - \ref SCIP_STAGE_PRESOLVED
27597  * - \ref SCIP_STAGE_SOLVING
27598  */
27600  SCIP* scip, /**< SCIP data structure */
27601  SCIP_CONS* cons, /**< constraint */
27602  SCIP_Bool dynamic /**< new value */
27603  )
27604 {
27605  SCIP_CALL( checkStage(scip, "SCIPsetConsDynamic", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27606 
27607  SCIPconsSetDynamic(cons, dynamic);
27608 
27609  return SCIP_OKAY;
27610 }
27611 
27612 /** sets the removable flag of the given constraint
27613  *
27614  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27615  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27616  *
27617  * @pre This method can be called if @p scip is in one of the following stages:
27618  * - \ref SCIP_STAGE_PROBLEM
27619  * - \ref SCIP_STAGE_TRANSFORMING
27620  * - \ref SCIP_STAGE_PRESOLVING
27621  * - \ref SCIP_STAGE_PRESOLVED
27622  * - \ref SCIP_STAGE_SOLVING
27623  */
27625  SCIP* scip, /**< SCIP data structure */
27626  SCIP_CONS* cons, /**< constraint */
27627  SCIP_Bool removable /**< new value */
27628  )
27629 {
27630  SCIP_CALL( checkStage(scip, "SCIPsetConsRemovable", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27631 
27632  SCIPconsSetRemovable(cons, removable);
27633 
27634  return SCIP_OKAY;
27635 }
27636 
27637 /** sets the stickingatnode flag of the given constraint
27638  *
27639  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27640  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27641  *
27642  * @pre This method can be called if @p scip is in one of the following stages:
27643  * - \ref SCIP_STAGE_PROBLEM
27644  * - \ref SCIP_STAGE_TRANSFORMING
27645  * - \ref SCIP_STAGE_PRESOLVING
27646  * - \ref SCIP_STAGE_PRESOLVED
27647  * - \ref SCIP_STAGE_SOLVING
27648  */
27650  SCIP* scip, /**< SCIP data structure */
27651  SCIP_CONS* cons, /**< constraint */
27652  SCIP_Bool stickingatnode /**< new value */
27653  )
27654 {
27655  SCIP_CALL( checkStage(scip, "SCIPsetConsStickingAtNode", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27656 
27657  SCIPconsSetStickingAtNode(cons, stickingatnode);
27658 
27659  return SCIP_OKAY;
27660 }
27661 
27662 /** updates the flags of the first constraint according to the ones of the second constraint
27663  *
27664  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27665  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27666  *
27667  * @pre This method can be called if @p scip is in one of the following stages:
27668  * - \ref SCIP_STAGE_PROBLEM
27669  * - \ref SCIP_STAGE_TRANSFORMING
27670  * - \ref SCIP_STAGE_PRESOLVING
27671  * - \ref SCIP_STAGE_PRESOLVED
27672  * - \ref SCIP_STAGE_SOLVING
27673  */
27675  SCIP* scip, /**< SCIP data structure */
27676  SCIP_CONS* cons0, /**< constraint that should stay */
27677  SCIP_CONS* cons1 /**< constraint that should be deleted */
27678  )
27679 {
27680  SCIP_CALL( checkStage(scip, "SCIPupdateConsFlags", FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27681 
27682  if( SCIPconsIsInitial(cons1) )
27683  {
27684  SCIP_CALL( SCIPsetConsInitial(scip, cons0, TRUE) );
27685  }
27686  if( SCIPconsIsSeparated(cons1) )
27687  {
27688  SCIP_CALL( SCIPsetConsSeparated(scip, cons0, TRUE) );
27689  }
27690  if( SCIPconsIsEnforced(cons1) )
27691  {
27692  SCIP_CALL( SCIPsetConsEnforced(scip, cons0, TRUE) );
27693  }
27694  if( SCIPconsIsChecked(cons1) )
27695  {
27696  SCIP_CALL( SCIPsetConsChecked(scip, cons0, TRUE) );
27697  }
27698  if( SCIPconsIsPropagated(cons1) )
27699  {
27700  SCIP_CALL( SCIPsetConsPropagated(scip, cons0, TRUE) );
27701  }
27702  if( !SCIPconsIsDynamic(cons1) )
27703  {
27704  SCIP_CALL( SCIPsetConsDynamic(scip, cons0, FALSE) );
27705  }
27706  if( !SCIPconsIsRemovable(cons1) )
27707  {
27708  SCIP_CALL( SCIPsetConsRemovable(scip, cons0, FALSE) );
27709  }
27710  if( SCIPconsIsStickingAtNode(cons1) )
27711  {
27712  SCIP_CALL( SCIPsetConsStickingAtNode(scip, cons0, TRUE) );
27713  }
27714 
27715  return SCIP_OKAY;
27716 }
27717 
27718 /** gets and captures transformed constraint of a given constraint; if the constraint is not yet transformed,
27719  * a new transformed constraint for this constraint is created
27720  *
27721  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27722  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27723  *
27724  * @pre This method can be called if @p scip is in one of the following stages:
27725  * - \ref SCIP_STAGE_TRANSFORMING
27726  * - \ref SCIP_STAGE_TRANSFORMED
27727  * - \ref SCIP_STAGE_INITPRESOLVE
27728  * - \ref SCIP_STAGE_PRESOLVING
27729  * - \ref SCIP_STAGE_EXITPRESOLVE
27730  * - \ref SCIP_STAGE_PRESOLVED
27731  * - \ref SCIP_STAGE_INITSOLVE
27732  * - \ref SCIP_STAGE_SOLVING
27733  */
27735  SCIP* scip, /**< SCIP data structure */
27736  SCIP_CONS* cons, /**< constraint to get/create transformed constraint for */
27737  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
27738  )
27739 {
27740  assert(transcons != NULL);
27741  assert(cons->scip == scip);
27742 
27743  SCIP_CALL( checkStage(scip, "SCIPtransformCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27744 
27745  if( SCIPconsIsTransformed(cons) )
27746  {
27747  *transcons = cons;
27748  SCIPconsCapture(*transcons);
27749  }
27750  else
27751  {
27752  SCIP_CALL( SCIPconsTransform(cons, scip->mem->probmem, scip->set, transcons) );
27753  }
27754 
27755  return SCIP_OKAY;
27756 }
27757 
27758 /** gets and captures transformed constraints for an array of constraints;
27759  * if a constraint in the array is not yet transformed, a new transformed constraint for this constraint is created;
27760  * it is possible to call this method with conss == transconss
27761  *
27762  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27763  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27764  *
27765  * @pre This method can be called if @p scip is in one of the following stages:
27766  * - \ref SCIP_STAGE_TRANSFORMING
27767  * - \ref SCIP_STAGE_TRANSFORMED
27768  * - \ref SCIP_STAGE_INITPRESOLVE
27769  * - \ref SCIP_STAGE_PRESOLVING
27770  * - \ref SCIP_STAGE_EXITPRESOLVE
27771  * - \ref SCIP_STAGE_PRESOLVED
27772  * - \ref SCIP_STAGE_INITSOLVE
27773  * - \ref SCIP_STAGE_SOLVING
27774  */
27776  SCIP* scip, /**< SCIP data structure */
27777  int nconss, /**< number of constraints to get/create transformed constraints for */
27778  SCIP_CONS** conss, /**< array with constraints to get/create transformed constraints for */
27779  SCIP_CONS** transconss /**< array to store the transformed constraints */
27780  )
27781 {
27782  int c;
27783 
27784  assert(nconss == 0 || conss != NULL);
27785  assert(nconss == 0 || transconss != NULL);
27786 
27787  SCIP_CALL( checkStage(scip, "SCIPtransformConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
27788 
27789  for( c = 0; c < nconss; ++c )
27790  {
27791  if( SCIPconsIsTransformed(conss[c]) )
27792  {
27793  transconss[c] = conss[c];
27794  SCIPconsCapture(transconss[c]);
27795  }
27796  else
27797  {
27798  SCIP_CALL( SCIPconsTransform(conss[c], scip->mem->probmem, scip->set, &transconss[c]) );
27799  }
27800  }
27801 
27802  return SCIP_OKAY;
27803 }
27804 
27805 /** gets corresponding transformed constraint of a given constraint;
27806  * returns NULL as transcons, if transformed constraint is not yet existing
27807  *
27808  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27809  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27810  *
27811  * @pre This method can be called if @p scip is in one of the following stages:
27812  * - \ref SCIP_STAGE_TRANSFORMING
27813  * - \ref SCIP_STAGE_TRANSFORMED
27814  * - \ref SCIP_STAGE_INITPRESOLVE
27815  * - \ref SCIP_STAGE_PRESOLVING
27816  * - \ref SCIP_STAGE_EXITPRESOLVE
27817  * - \ref SCIP_STAGE_PRESOLVED
27818  * - \ref SCIP_STAGE_INITSOLVE
27819  * - \ref SCIP_STAGE_SOLVING
27820  * - \ref SCIP_STAGE_SOLVED
27821  * - \ref SCIP_STAGE_EXITSOLVE
27822  * - \ref SCIP_STAGE_FREETRANS
27823  */
27825  SCIP* scip, /**< SCIP data structure */
27826  SCIP_CONS* cons, /**< constraint to get the transformed constraint for */
27827  SCIP_CONS** transcons /**< pointer to store the transformed constraint */
27828  )
27829 {
27830  assert(transcons != NULL);
27831  assert(cons->scip == scip);
27832 
27833  SCIP_CALL( checkStage(scip, "SCIPgetTransformedCons", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
27834 
27835  if( SCIPconsIsTransformed(cons) )
27836  *transcons = cons;
27837  else
27838  *transcons = SCIPconsGetTransformed(cons);
27839 
27840  return SCIP_OKAY;
27841 }
27842 
27843 /** gets corresponding transformed constraints for an array of constraints;
27844  * stores NULL in a transconss slot, if the transformed constraint is not yet existing;
27845  * it is possible to call this method with conss == transconss, but remember that constraints that are not
27846  * yet transformed will be replaced with NULL
27847  *
27848  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27849  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27850  *
27851  * @pre This method can be called if @p scip is in one of the following stages:
27852  * - \ref SCIP_STAGE_TRANSFORMING
27853  * - \ref SCIP_STAGE_TRANSFORMED
27854  * - \ref SCIP_STAGE_INITPRESOLVE
27855  * - \ref SCIP_STAGE_PRESOLVING
27856  * - \ref SCIP_STAGE_EXITPRESOLVE
27857  * - \ref SCIP_STAGE_PRESOLVED
27858  * - \ref SCIP_STAGE_INITSOLVE
27859  * - \ref SCIP_STAGE_SOLVING
27860  * - \ref SCIP_STAGE_SOLVED
27861  * - \ref SCIP_STAGE_EXITSOLVE
27862  * - \ref SCIP_STAGE_FREETRANS
27863  */
27865  SCIP* scip, /**< SCIP data structure */
27866  int nconss, /**< number of constraints to get the transformed constraints for */
27867  SCIP_CONS** conss, /**< constraints to get the transformed constraints for */
27868  SCIP_CONS** transconss /**< array to store the transformed constraints */
27869  )
27870 {
27871  int c;
27872 
27873  assert(nconss == 0 || conss != NULL);
27874  assert(nconss == 0 || transconss != NULL);
27875 
27876  SCIP_CALL( checkStage(scip, "SCIPgetTransformedConss", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
27877 
27878  for( c = 0; c < nconss; ++c )
27879  {
27880  if( SCIPconsIsTransformed(conss[c]) )
27881  transconss[c] = conss[c];
27882  else
27883  transconss[c] = SCIPconsGetTransformed(conss[c]);
27884  }
27885 
27886  return SCIP_OKAY;
27887 }
27888 
27889 /** adds given value to age of constraint, but age can never become negative;
27890  * should be called
27891  * - in constraint separation, if no cut was found for this constraint,
27892  * - in constraint enforcing, if constraint was feasible, and
27893  * - in constraint propagation, if no domain reduction was deduced;
27894  *
27895  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27896  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27897  *
27898  * @pre This method can be called if @p scip is in one of the following stages:
27899  * - \ref SCIP_STAGE_TRANSFORMED
27900  * - \ref SCIP_STAGE_PRESOLVING
27901  * - \ref SCIP_STAGE_PRESOLVED
27902  * - \ref SCIP_STAGE_SOLVING
27903  * - \ref SCIP_STAGE_SOLVED
27904  */
27906  SCIP* scip, /**< SCIP data structure */
27907  SCIP_CONS* cons, /**< constraint */
27908  SCIP_Real deltaage /**< value to add to the constraint's age */
27909  )
27910 {
27911  SCIP_CALL( checkStage(scip, "SCIPaddConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27912 
27913  SCIP_CALL( SCIPconsAddAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, deltaage, scip->reopt) );
27914 
27915  return SCIP_OKAY;
27916 }
27917 
27918 /** increases age of constraint by 1.0;
27919  * should be called
27920  * - in constraint separation, if no cut was found for this constraint,
27921  * - in constraint enforcing, if constraint was feasible, and
27922  * - in constraint propagation, if no domain reduction was deduced;
27923  *
27924  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27925  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27926  *
27927  * @pre This method can be called if @p scip is in one of the following stages:
27928  * - \ref SCIP_STAGE_TRANSFORMED
27929  * - \ref SCIP_STAGE_PRESOLVING
27930  * - \ref SCIP_STAGE_PRESOLVED
27931  * - \ref SCIP_STAGE_SOLVING
27932  * - \ref SCIP_STAGE_SOLVED
27933  */
27935  SCIP* scip, /**< SCIP data structure */
27936  SCIP_CONS* cons /**< constraint */
27937  )
27938 {
27939  SCIP_CALL( checkStage(scip, "SCIPincConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27940 
27941  SCIP_CALL( SCIPconsIncAge(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
27942 
27943  return SCIP_OKAY;
27944 }
27945 
27946 /** resets age of constraint to zero;
27947  * should be called
27948  * - in constraint separation, if a cut was found for this constraint,
27949  * - in constraint enforcing, if the constraint was violated, and
27950  * - in constraint propagation, if a domain reduction was deduced;
27951  *
27952  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27953  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27954  *
27955  * @pre This method can be called if @p scip is in one of the following stages:
27956  * - \ref SCIP_STAGE_TRANSFORMED
27957  * - \ref SCIP_STAGE_PRESOLVING
27958  * - \ref SCIP_STAGE_PRESOLVED
27959  * - \ref SCIP_STAGE_SOLVING
27960  * - \ref SCIP_STAGE_SOLVED
27961  */
27963  SCIP* scip, /**< SCIP data structure */
27964  SCIP_CONS* cons /**< constraint */
27965  )
27966 {
27967  SCIP_CALL( checkStage(scip, "SCIPresetConsAge", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27968 
27969  SCIP_CALL( SCIPconsResetAge(cons, scip->set) );
27970 
27971  return SCIP_OKAY;
27972 }
27973 
27974 /** enables constraint's separation, propagation, and enforcing capabilities
27975  *
27976  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
27977  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
27978  *
27979  * @pre This method can be called if @p scip is in one of the following stages:
27980  * - \ref SCIP_STAGE_TRANSFORMED
27981  * - \ref SCIP_STAGE_PRESOLVING
27982  * - \ref SCIP_STAGE_PRESOLVED
27983  * - \ref SCIP_STAGE_INITSOLVE
27984  * - \ref SCIP_STAGE_SOLVING
27985  * - \ref SCIP_STAGE_SOLVED
27986  */
27988  SCIP* scip, /**< SCIP data structure */
27989  SCIP_CONS* cons /**< constraint */
27990  )
27991 {
27992  SCIP_CALL( checkStage(scip, "SCIPenableCons", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
27993 
27994  SCIP_CALL( SCIPconsEnable(cons, scip->set, scip->stat) );
27995 
27996  return SCIP_OKAY;
27997 }
27998 
27999 /** disables constraint's separation, propagation, and enforcing capabilities, s.t. the constraint is not propagated,
28000  * separated, and enforced anymore until it is enabled again with a call to SCIPenableCons();
28001  * in contrast to SCIPdelConsLocal() and SCIPdelConsNode(), the disabling is not associated to a node in the tree and
28002  * does not consume memory; therefore, the constraint is neither automatically enabled on leaving the node nor
28003  * automatically disabled again on entering the node again;
28004  * note that the constraints enforcing capabilities are necessary for the solution's feasibility, if the constraint
28005  * is a model constraint; that means, you must be sure that the constraint cannot be violated in the current subtree,
28006  * and you have to enable it again manually by calling SCIPenableCons(), if this subtree is left (e.g. by using
28007  * an appropriate event handler that watches the corresponding variables' domain changes)
28008  *
28009  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28010  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28011  *
28012  * @pre This method can be called if @p scip is in one of the following stages:
28013  * - \ref SCIP_STAGE_TRANSFORMED
28014  * - \ref SCIP_STAGE_INITPRESOLVE
28015  * - \ref SCIP_STAGE_PRESOLVING
28016  * - \ref SCIP_STAGE_PRESOLVED
28017  * - \ref SCIP_STAGE_INITSOLVE
28018  * - \ref SCIP_STAGE_SOLVING
28019  * - \ref SCIP_STAGE_SOLVED
28020  */
28022  SCIP* scip, /**< SCIP data structure */
28023  SCIP_CONS* cons /**< constraint */
28024  )
28025 {
28026  SCIP_CALL( checkStage(scip, "SCIPdisableCons", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28027 
28028  SCIP_CALL( SCIPconsDisable(cons, scip->set, scip->stat) );
28029 
28030  return SCIP_OKAY;
28031 }
28032 
28033 /** enables constraint's separation capabilities
28034  *
28035  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28036  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28037  *
28038  * @pre This method can be called if @p scip is in one of the following stages:
28039  * - \ref SCIP_STAGE_TRANSFORMED
28040  * - \ref SCIP_STAGE_PRESOLVING
28041  * - \ref SCIP_STAGE_PRESOLVED
28042  * - \ref SCIP_STAGE_INITSOLVE
28043  * - \ref SCIP_STAGE_SOLVING
28044  * - \ref SCIP_STAGE_SOLVED
28045  */
28047  SCIP* scip, /**< SCIP data structure */
28048  SCIP_CONS* cons /**< constraint */
28049  )
28050 {
28051  SCIP_CALL( checkStage(scip, "SCIPenableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28052 
28053  SCIP_CALL( SCIPconsEnableSeparation(cons, scip->set) );
28054 
28055  return SCIP_OKAY;
28056 }
28057 
28058 /** disables constraint's separation capabilities s.t. the constraint is not separated anymore until the separation
28059  * is enabled again with a call to SCIPenableConsSeparation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
28060  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
28061  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
28062  *
28063  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28064  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28065  *
28066  * @pre This method can be called if @p scip is in one of the following stages:
28067  * - \ref SCIP_STAGE_TRANSFORMED
28068  * - \ref SCIP_STAGE_PRESOLVING
28069  * - \ref SCIP_STAGE_PRESOLVED
28070  * - \ref SCIP_STAGE_INITSOLVE
28071  * - \ref SCIP_STAGE_SOLVING
28072  * - \ref SCIP_STAGE_SOLVED
28073  */
28075  SCIP* scip, /**< SCIP data structure */
28076  SCIP_CONS* cons /**< constraint */
28077  )
28078 {
28079  SCIP_CALL( checkStage(scip, "SCIPdisableConsSeparation", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28080 
28081  SCIP_CALL( SCIPconsDisableSeparation(cons, scip->set) );
28082 
28083  return SCIP_OKAY;
28084 }
28085 
28086 /** enables constraint's propagation capabilities
28087  *
28088  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28089  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28090  *
28091  * @pre This method can be called if @p scip is in one of the following stages:
28092  * - \ref SCIP_STAGE_TRANSFORMED
28093  * - \ref SCIP_STAGE_INITPRESOLVE
28094  * - \ref SCIP_STAGE_PRESOLVING
28095  * - \ref SCIP_STAGE_EXITPRESOLVE
28096  * - \ref SCIP_STAGE_PRESOLVED
28097  * - \ref SCIP_STAGE_INITSOLVE
28098  * - \ref SCIP_STAGE_SOLVING
28099  * - \ref SCIP_STAGE_SOLVED
28100  */
28102  SCIP* scip, /**< SCIP data structure */
28103  SCIP_CONS* cons /**< constraint */
28104  )
28105 {
28106  SCIP_CALL( checkStage(scip, "SCIPenableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28107 
28108  SCIP_CALL( SCIPconsEnablePropagation(cons, scip->set) );
28109 
28110  return SCIP_OKAY;
28111 }
28112 
28113 /** disables constraint's propagation capabilities s.t. the constraint is not propagated anymore until the propagation
28114  * is enabled again with a call to SCIPenableConsPropagation(); in contrast to SCIPdelConsLocal() and SCIPdelConsNode(),
28115  * the disabling is not associated to a node in the tree and does not consume memory; therefore, the constraint
28116  * is neither automatically enabled on leaving the node nor automatically disabled again on entering the node again
28117  *
28118  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28119  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28120  *
28121  * @pre This method can be called if @p scip is in one of the following stages:
28122  * - \ref SCIP_STAGE_TRANSFORMED
28123  * - \ref SCIP_STAGE_INITPRESOLVE
28124  * - \ref SCIP_STAGE_PRESOLVING
28125  * - \ref SCIP_STAGE_EXITPRESOLVE
28126  * - \ref SCIP_STAGE_PRESOLVED
28127  * - \ref SCIP_STAGE_INITSOLVE
28128  * - \ref SCIP_STAGE_SOLVING
28129  * - \ref SCIP_STAGE_SOLVED
28130  */
28132  SCIP* scip, /**< SCIP data structure */
28133  SCIP_CONS* cons /**< constraint */
28134  )
28135 {
28136  SCIP_CALL( checkStage(scip, "SCIPdisableConsPropagation", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28137 
28138  SCIP_CALL( SCIPconsDisablePropagation(cons, scip->set) );
28139 
28140  return SCIP_OKAY;
28141 }
28142 
28143 #undef SCIPmarkConsPropagate
28144 
28145 /** marks constraint to be propagated
28146  *
28147  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28148  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28149  *
28150  * @pre This method can be called if @p scip is in one of the following stages:
28151  * - \ref SCIP_STAGE_TRANSFORMING
28152  * - \ref SCIP_STAGE_TRANSFORMED
28153  * - \ref SCIP_STAGE_INITPRESOLVE
28154  * - \ref SCIP_STAGE_PRESOLVING
28155  * - \ref SCIP_STAGE_EXITPRESOLVE
28156  * - \ref SCIP_STAGE_PRESOLVED
28157  * - \ref SCIP_STAGE_INITSOLVE
28158  * - \ref SCIP_STAGE_SOLVING
28159  * - \ref SCIP_STAGE_SOLVED
28160  * - \ref SCIP_STAGE_EXITSOLVE
28161  *
28162  * @note if a constraint is marked to be propagated, the age of the constraint will be ignored for propagation
28163  */
28165  SCIP* scip, /**< SCIP data structure */
28166  SCIP_CONS* cons /**< constraint */
28167  )
28168 {
28169  SCIP_CALL( checkStage(scip, "SCIPmarkConsPropagate", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
28170 
28171  SCIP_CALL( SCIPconsMarkPropagate(cons, scip->set) );
28172 
28173  assert(!SCIPconsIsEnabled(cons) || SCIPconsIsMarkedPropagate(cons));
28174 
28175  return SCIP_OKAY;
28176 }
28177 
28178 /** unmarks the constraint to be propagated
28179  *
28180  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28181  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28182  *
28183  * @pre This method can be called if @p scip is in one of the following stages:
28184  * - \ref SCIP_STAGE_TRANSFORMED
28185  * - \ref SCIP_STAGE_PRESOLVING
28186  * - \ref SCIP_STAGE_EXITPRESOLVE
28187  * - \ref SCIP_STAGE_PRESOLVED
28188  * - \ref SCIP_STAGE_INITSOLVE
28189  * - \ref SCIP_STAGE_SOLVING
28190  * - \ref SCIP_STAGE_SOLVED
28191  */
28193  SCIP* scip, /**< SCIP data structure */
28194  SCIP_CONS* cons /**< constraint */
28195  )
28196 {
28197  SCIP_CALL( checkStage(scip, "SCIPunmarkConsPropagate", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28198 
28199  SCIP_CALL( SCIPconsUnmarkPropagate(cons, scip->set) );
28200 
28201  assert(!SCIPconsIsEnabled(cons) || !SCIPconsIsMarkedPropagate(cons));
28202 
28203  return SCIP_OKAY;
28204 }
28205 
28206 /** adds given values to lock status of the constraint and updates the rounding locks of the involved variables
28207  *
28208  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28209  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28210  *
28211  * @pre This method can be called if @p scip is in one of the following stages:
28212  * - \ref SCIP_STAGE_PROBLEM
28213  * - \ref SCIP_STAGE_TRANSFORMING
28214  * - \ref SCIP_STAGE_INITPRESOLVE
28215  * - \ref SCIP_STAGE_PRESOLVING
28216  * - \ref SCIP_STAGE_EXITPRESOLVE
28217  * - \ref SCIP_STAGE_INITSOLVE
28218  * - \ref SCIP_STAGE_SOLVING
28219  * - \ref SCIP_STAGE_EXITSOLVE
28220  * - \ref SCIP_STAGE_FREETRANS
28221  */
28223  SCIP* scip, /**< SCIP data structure */
28224  SCIP_CONS* cons, /**< constraint */
28225  int nlockspos, /**< increase in number of rounding locks for constraint */
28226  int nlocksneg /**< increase in number of rounding locks for constraint's negation */
28227  )
28228 {
28229  SCIP_CALL( checkStage(scip, "SCIPaddConsLocks", FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE) );
28230 
28231  SCIP_CALL( SCIPconsAddLocks(cons, scip->set, nlockspos, nlocksneg) );
28232 
28233  return SCIP_OKAY;
28234 }
28235 
28236 /** checks single constraint for feasibility of the given solution
28237  *
28238  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28239  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28240  *
28241  * @pre This method can be called if @p scip is in one of the following stages:
28242  * - \ref SCIP_STAGE_PROBLEM
28243  * - \ref SCIP_STAGE_TRANSFORMED
28244  * - \ref SCIP_STAGE_INITPRESOLVE
28245  * - \ref SCIP_STAGE_PRESOLVING
28246  * - \ref SCIP_STAGE_EXITPRESOLVE
28247  * - \ref SCIP_STAGE_PRESOLVED
28248  * - \ref SCIP_STAGE_INITSOLVE
28249  * - \ref SCIP_STAGE_SOLVING
28250  * - \ref SCIP_STAGE_SOLVED
28251  */
28253  SCIP* scip, /**< SCIP data structure */
28254  SCIP_CONS* cons, /**< constraint to check */
28255  SCIP_SOL* sol, /**< primal CIP solution */
28256  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
28257  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
28258  SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
28259  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28260  )
28261 {
28262  SCIP_CALL( checkStage(scip, "SCIPcheckCons", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
28263 
28264  SCIP_CALL( SCIPconsCheck(cons, scip->set, sol, checkintegrality, checklprows, printreason, result) );
28265 
28266  return SCIP_OKAY;
28267 }
28268 
28269 /** enforces single constraint for a given pseudo solution
28270  *
28271  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28272  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28273  *
28274  * @pre This method can be called if @p scip is in one of the following stages:
28275  * - \ref SCIP_STAGE_SOLVING
28276  *
28277  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28278  * added to SCIP beforehand.
28279  */
28281  SCIP* scip, /**< SCIP data structure */
28282  SCIP_CONS* cons, /**< constraint to enforce */
28283  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28284  SCIP_Bool objinfeasible, /**< is the solution infeasible anyway due to violating lower objective bound? */
28285  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28286  )
28287 {
28288  assert(scip != NULL);
28289  assert(cons != NULL);
28290  assert(!SCIPconsIsAdded(cons));
28291  assert(result != NULL);
28292 
28293  SCIP_CALL( checkStage(scip, "SCIPenfopsCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28294 
28295  SCIP_CALL( SCIPconsEnfops(cons, scip->set, solinfeasible, objinfeasible, result) );
28296 
28297  return SCIP_OKAY;
28298 }
28299 
28300 /** enforces single constraint for a given LP solution
28301  *
28302  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28303  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28304  *
28305  * @pre This method can be called if @p scip is in one of the following stages:
28306  * - \ref SCIP_STAGE_SOLVING
28307  *
28308  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28309  * added to SCIP beforehand.
28310  */
28312  SCIP* scip, /**< SCIP data structure */
28313  SCIP_CONS* cons, /**< constraint to enforce */
28314  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28315  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28316  )
28317 {
28318  assert(scip != NULL);
28319  assert(cons != NULL);
28320  assert(!SCIPconsIsAdded(cons));
28321  assert(result != NULL);
28322 
28323  SCIP_CALL( checkStage(scip, "SCIPenfolpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28324 
28325  SCIP_CALL( SCIPconsEnfolp(cons, scip->set, solinfeasible, result) );
28326 
28327  return SCIP_OKAY;
28328 }
28329 
28330 /** enforces single constraint for a given relaxation solution
28331  *
28332  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28333  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28334  *
28335  * @pre This method can be called if @p scip is in one of the following stages:
28336  * - \ref SCIP_STAGE_SOLVING
28337  *
28338  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28339  * added to SCIP beforehand.
28340  */
28342  SCIP* scip, /**< SCIP data structure */
28343  SCIP_CONS* cons, /**< constraint to enforce */
28344  SCIP_SOL* sol, /**< solution to enforce */
28345  SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
28346  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28347  )
28348 {
28349  assert(scip != NULL);
28350  assert(cons != NULL);
28351  assert(!SCIPconsIsAdded(cons));
28352  assert(sol != NULL);
28353  assert(result != NULL);
28354 
28355  SCIP_CALL( checkStage(scip, "SCIPenforelaxCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28356 
28357  SCIP_CALL( SCIPconsEnforelax(cons, scip->set, sol, solinfeasible, result) );
28358 
28359  return SCIP_OKAY;
28360 }
28361 
28362 /** calls LP initialization method for single constraint
28363  *
28364  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28365  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28366  *
28367  * @pre This method can be called if @p scip is in one of the following stages:
28368  * - \ref SCIP_STAGE_SOLVING
28369  *
28370  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28371  * added to SCIP beforehand.
28372  */
28374  SCIP* scip, /**< SCIP data structure */
28375  SCIP_CONS* cons, /**< constraint to initialize */
28376  SCIP_Bool* infeasible /**< pointer to store whether infeasibility was detected while building the LP */
28377  )
28378 {
28379  assert(scip != NULL);
28380  assert(cons != NULL);
28381  assert(!SCIPconsIsAdded(cons));
28382 
28383  SCIP_CALL( checkStage(scip, "SCIPinitlpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28384 
28385  SCIP_CALL( SCIPconsInitlp(cons, scip->set, infeasible) );
28386 
28387  return SCIP_OKAY;
28388 }
28389 
28390 /** calls separation method of single constraint for LP solution
28391  *
28392  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28393  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28394  *
28395  * @pre This method can be called if @p scip is in one of the following stages:
28396  * - \ref SCIP_STAGE_SOLVING
28397  *
28398  * @note This is an advanced method and should be used with caution.
28399  */
28401  SCIP* scip, /**< SCIP data structure */
28402  SCIP_CONS* cons, /**< constraint to separate */
28403  SCIP_RESULT* result /**< pointer to store the result of the separation call */
28404  )
28405 {
28406  assert(scip != NULL);
28407  assert(cons != NULL);
28408  assert(result != NULL);
28409 
28410  SCIP_CALL( checkStage(scip, "SCIPsepalpCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28411 
28412  SCIP_CALL( SCIPconsSepalp(cons, scip->set, result) );
28413 
28414  return SCIP_OKAY;
28415 }
28416 
28417 /** calls separation method of single constraint for given primal solution
28418  *
28419  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28420  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28421  *
28422  * @pre This method can be called if @p scip is in one of the following stages:
28423  * - \ref SCIP_STAGE_SOLVING
28424  *
28425  * @note This is an advanced method and should be used with caution.
28426  */
28428  SCIP* scip, /**< SCIP data structure */
28429  SCIP_CONS* cons, /**< constraint to separate */
28430  SCIP_SOL* sol, /**< primal solution that should be separated*/
28431  SCIP_RESULT* result /**< pointer to store the result of the separation call */
28432  )
28433 {
28434  assert(scip != NULL);
28435  assert(cons != NULL);
28436  assert(sol != NULL);
28437  assert(result != NULL);
28438 
28439  SCIP_CALL( checkStage(scip, "SCIPsepasolCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28440 
28441  SCIP_CALL( SCIPconsSepasol(cons, scip->set, sol, result) );
28442 
28443  return SCIP_OKAY;
28444 }
28445 
28446 /** calls domain propagation method of single constraint
28447  *
28448  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28449  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28450  *
28451  * @pre This method can be called if @p scip is in one of the following stages:
28452  * - \ref SCIP_STAGE_PRESOLVING
28453  * - \ref SCIP_STAGE_SOLVING
28454  *
28455  * @note This is an advanced method and should be used with caution.
28456  */
28458  SCIP* scip, /**< SCIP data structure */
28459  SCIP_CONS* cons, /**< constraint to propagate */
28460  SCIP_PROPTIMING proptiming, /**< current point in the node solving loop */
28461  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28462  )
28463 {
28464  assert(scip != NULL);
28465  assert(cons != NULL);
28466  assert(result != NULL);
28467 
28468  SCIP_CALL( checkStage(scip, "SCIPpropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28469 
28470  SCIP_CALL( SCIPconsProp(cons, scip->set, proptiming, result) );
28471 
28472  return SCIP_OKAY;
28473 }
28474 
28475 /** resolves propagation conflict of single constraint
28476  *
28477  *
28478  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28479  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28480  *
28481  * @pre This method can be called if @p scip is in one of the following stages:
28482  * - \ref SCIP_STAGE_PRESOLVING
28483  * - \ref SCIP_STAGE_SOLVING
28484  *
28485  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28486  * added to SCIP beforehand.
28487  */
28489  SCIP* scip, /**< SCIP data structure */
28490  SCIP_CONS* cons, /**< constraint to resolve conflict for */
28491  SCIP_VAR* infervar, /**< the conflict variable whose bound change has to be resolved */
28492  int inferinfo, /**< the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call */
28493  SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */
28494  SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
28495  SCIP_Real relaxedbd, /**< the relaxed bound which is sufficient to be explained */
28496  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28497  )
28498 {
28499  assert(scip != NULL);
28500  assert(cons != NULL);
28501  assert(!SCIPconsIsAdded(cons));
28502  assert(infervar != NULL);
28503  assert(bdchgidx != NULL);
28504  assert(result != NULL);
28505 
28506  SCIP_CALL( checkStage(scip, "SCIPrespropCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28507 
28508  SCIP_CALL( SCIPconsResprop(cons, scip->set, infervar, inferinfo, boundtype, bdchgidx, relaxedbd, result) );
28509 
28510  return SCIP_OKAY;
28511 }
28512 
28513 /** presolves of single constraint
28514  *
28515  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28516  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28517  *
28518  * @pre This method can be called if @p scip is in one of the following stages:
28519  * - \ref SCIP_STAGE_PRESOLVING
28520  *
28521  * @note This is an advanced method and should be used with caution.
28522  */
28524  SCIP* scip, /**< SCIP data structure */
28525  SCIP_CONS* cons, /**< constraint to presolve */
28526  int nrounds, /**< number of presolving rounds already done */
28527  SCIP_PRESOLTIMING presoltiming, /**< presolving timing(s) to be performed */
28528  int nnewfixedvars, /**< number of variables fixed since the last call to the presolving method */
28529  int nnewaggrvars, /**< number of variables aggregated since the last call to the presolving method */
28530  int nnewchgvartypes, /**< number of variable type changes since the last call to the presolving method */
28531  int nnewchgbds, /**< number of variable bounds tightened since the last call to the presolving method */
28532  int nnewholes, /**< number of domain holes added since the last call to the presolving method */
28533  int nnewdelconss, /**< number of deleted constraints since the last call to the presolving method */
28534  int nnewaddconss, /**< number of added constraints since the last call to the presolving method */
28535  int nnewupgdconss, /**< number of upgraded constraints since the last call to the presolving method */
28536  int nnewchgcoefs, /**< number of changed coefficients since the last call to the presolving method */
28537  int nnewchgsides, /**< number of changed left or right hand sides since the last call to the presolving method */
28538  int* nfixedvars, /**< pointer to count total number of variables fixed of all presolvers */
28539  int* naggrvars, /**< pointer to count total number of variables aggregated of all presolvers */
28540  int* nchgvartypes, /**< pointer to count total number of variable type changes of all presolvers */
28541  int* nchgbds, /**< pointer to count total number of variable bounds tightened of all presolvers */
28542  int* naddholes, /**< pointer to count total number of domain holes added of all presolvers */
28543  int* ndelconss, /**< pointer to count total number of deleted constraints of all presolvers */
28544  int* naddconss, /**< pointer to count total number of added constraints of all presolvers */
28545  int* nupgdconss, /**< pointer to count total number of upgraded constraints of all presolvers */
28546  int* nchgcoefs, /**< pointer to count total number of changed coefficients of all presolvers */
28547  int* nchgsides, /**< pointer to count total number of changed left/right hand sides of all presolvers */
28548  SCIP_RESULT* result /**< pointer to store the result of the callback method */
28549  )
28550 {
28551  assert(scip != NULL);
28552  assert(cons != NULL);
28553  assert(nfixedvars != NULL);
28554  assert(naggrvars != NULL);
28555  assert(nchgvartypes != NULL);
28556  assert(nchgbds != NULL);
28557  assert(naddholes != NULL);
28558  assert(ndelconss != NULL);
28559  assert(naddconss != NULL);
28560  assert(nupgdconss != NULL);
28561  assert(nchgcoefs != NULL);
28562  assert(nchgsides != NULL);
28563  assert(result != NULL);
28564 
28565  SCIP_CALL( checkStage(scip, "SCIPpresolCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
28566 
28567  SCIP_CALL( SCIPconsPresol(cons, scip->set, nrounds, presoltiming, nnewfixedvars, nnewaggrvars, nnewchgvartypes, nnewchgbds, nnewholes,
28568  nnewdelconss, nnewaddconss, nnewupgdconss, nnewchgcoefs, nnewchgsides, nfixedvars, naggrvars, nchgvartypes,
28569  nchgbds, naddholes, ndelconss, naddconss, nupgdconss, nchgcoefs, nchgsides , result) );
28570 
28571  return SCIP_OKAY;
28572 }
28573 
28574 /** calls constraint activation notification method of single constraint
28575  *
28576  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28577  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28578  *
28579  * @pre This method can be called if @p scip is in one of the following stages:
28580  * - \ref SCIP_STAGE_TRANSFORMING
28581  *
28582  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28583  * added to SCIP beforehand.
28584  */
28586  SCIP* scip, /**< SCIP data structure */
28587  SCIP_CONS* cons /**< constraint to notify */
28588  )
28589 {
28590  assert(scip != NULL);
28591  assert(cons != NULL);
28592  assert(!SCIPconsIsAdded(cons));
28593 
28594  SCIP_CALL( checkStage(scip, "SCIPactiveCons", FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
28595 
28596  SCIP_CALL( SCIPconsActive(cons, scip->set) );
28597 
28598  return SCIP_OKAY;
28599 }
28600 
28601 /** calls constraint deactivation notification method of single constraint
28602  *
28603  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28604  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28605  *
28606  * @pre This method can be called if @p scip is in one of the following stages:
28607  * - \ref SCIP_STAGE_PRESOLVING
28608  * - \ref SCIP_STAGE_SOLVING
28609  *
28610  * @note This is an advanced method and should be used with caution. It may only be called for constraints that were not
28611  * added to SCIP beforehand.
28612  */
28614  SCIP* scip, /**< SCIP data structure */
28615  SCIP_CONS* cons /**< constraint to notify */
28616  )
28617 {
28618  assert(scip != NULL);
28619  assert(cons != NULL);
28620  assert(!SCIPconsIsAdded(cons));
28621 
28622  SCIP_CALL( checkStage(scip, "SCIPdeactiveCons", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28623 
28624  SCIP_CALL( SCIPconsDeactive(cons, scip->set) );
28625 
28626  return SCIP_OKAY;
28627 }
28628 
28629 /** outputs constraint information to file stream via the message handler system
28630  *
28631  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28632  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28633  *
28634  * @pre This method can be called if @p scip is in one of the following stages:
28635  * - \ref SCIP_STAGE_PROBLEM
28636  * - \ref SCIP_STAGE_TRANSFORMING
28637  * - \ref SCIP_STAGE_TRANSFORMED
28638  * - \ref SCIP_STAGE_INITPRESOLVE
28639  * - \ref SCIP_STAGE_PRESOLVING
28640  * - \ref SCIP_STAGE_EXITPRESOLVE
28641  * - \ref SCIP_STAGE_PRESOLVED
28642  * - \ref SCIP_STAGE_INITSOLVE
28643  * - \ref SCIP_STAGE_SOLVING
28644  * - \ref SCIP_STAGE_SOLVED
28645  * - \ref SCIP_STAGE_EXITSOLVE
28646  * - \ref SCIP_STAGE_FREETRANS
28647  *
28648  * @note If the message handler is set to a NULL pointer nothing will be printed.
28649  * @note The file stream will not be flushed directly, this can be achieved by calling SCIPinfoMessage() printing a
28650  * newline character.
28651  */
28653  SCIP* scip, /**< SCIP data structure */
28654  SCIP_CONS* cons, /**< constraint */
28655  FILE* file /**< output file (or NULL for standard output) */
28656  )
28657 {
28658  SCIP_CALL( checkStage(scip, "SCIPprintCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
28659 
28660  SCIP_CALL( SCIPconsPrint(cons, scip->set, scip->messagehdlr, file) );
28661 
28662  return SCIP_OKAY;
28663 }
28664 
28665 /** method to collect the variables of a constraint
28666  *
28667  * If the number of variables is greater than the available slots in the variable array, nothing happens except that
28668  * the success point is set to FALSE. With the method SCIPgetConsNVars() it is possible to get the number of variables
28669  * a constraint has in its scope.
28670  *
28671  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28672  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28673  *
28674  * @pre This method can be called if @p scip is in one of the following stages:
28675  * - \ref SCIP_STAGE_PROBLEM
28676  * - \ref SCIP_STAGE_TRANSFORMING
28677  * - \ref SCIP_STAGE_TRANSFORMED
28678  * - \ref SCIP_STAGE_INITPRESOLVE
28679  * - \ref SCIP_STAGE_PRESOLVING
28680  * - \ref SCIP_STAGE_EXITPRESOLVE
28681  * - \ref SCIP_STAGE_PRESOLVED
28682  * - \ref SCIP_STAGE_INITSOLVE
28683  * - \ref SCIP_STAGE_SOLVING
28684  * - \ref SCIP_STAGE_SOLVED
28685  * - \ref SCIP_STAGE_EXITSOLVE
28686  * - \ref SCIP_STAGE_FREETRANS
28687  *
28688  * @note The success pointer indicates if all variables were copied into the vars arrray.
28689  *
28690  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
28691  * set to FALSE.
28692  */
28694  SCIP* scip, /**< SCIP data structure */
28695  SCIP_CONS* cons, /**< constraint for which the variables are wanted */
28696  SCIP_VAR** vars, /**< array to store the involved variable of the constraint */
28697  int varssize, /**< available slots in vars array which is needed to check if the array is large enough */
28698  SCIP_Bool* success /**< pointer to store whether the variables are successfully copied */
28699  )
28700 {
28701  SCIP_CALL( checkStage(scip, "SCIPgetConsVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
28702 
28703  assert(scip != NULL);
28704  assert(cons != NULL);
28705  assert(vars != NULL);
28706  assert(success != NULL);
28707 
28708  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, varssize, success) );
28709 
28710  return SCIP_OKAY;
28711 }
28712 
28713 /** method to collect the number of variables of a constraint
28714  *
28715  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28716  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28717  *
28718  * @pre This method can be called if @p scip is in one of the following stages:
28719  * - \ref SCIP_STAGE_PROBLEM
28720  * - \ref SCIP_STAGE_TRANSFORMING
28721  * - \ref SCIP_STAGE_TRANSFORMED
28722  * - \ref SCIP_STAGE_INITPRESOLVE
28723  * - \ref SCIP_STAGE_PRESOLVING
28724  * - \ref SCIP_STAGE_EXITPRESOLVE
28725  * - \ref SCIP_STAGE_PRESOLVED
28726  * - \ref SCIP_STAGE_INITSOLVE
28727  * - \ref SCIP_STAGE_SOLVING
28728  * - \ref SCIP_STAGE_SOLVED
28729  * - \ref SCIP_STAGE_EXITSOLVE
28730  * - \ref SCIP_STAGE_FREETRANS
28731  *
28732  * @note The success pointer indicates if the contraint handler was able to return the number of variables
28733  *
28734  * @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
28735  * set to FALSE
28736  */
28738  SCIP* scip, /**< SCIP data structure */
28739  SCIP_CONS* cons, /**< constraint for which the number of variables is wanted */
28740  int* nvars, /**< pointer to store the number of variables */
28741  SCIP_Bool* success /**< pointer to store whether the constraint successfully returned the number of variables */
28742  )
28743 {
28744  SCIP_CALL( checkStage(scip, "SCIPgetConsNVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
28745 
28746  assert(scip != NULL);
28747  assert(cons != NULL);
28748  assert(nvars != NULL);
28749  assert(success != NULL);
28750 
28751  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, nvars, success) );
28752 
28753  return SCIP_OKAY;
28754 }
28755 
28756 /*
28757  * LP methods
28758  */
28759 
28760 /** returns, whether the LP was or is to be solved in the current node
28761  *
28762  * @return whether the LP was or is to be solved in the current node.
28763  *
28764  * @pre This method can be called if @p scip is in one of the following stages:
28765  * - \ref SCIP_STAGE_SOLVING
28766  *
28767  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28768  */
28770  SCIP* scip /**< SCIP data structure */
28771  )
28772 {
28773  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasCurrentNodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28774 
28775  return SCIPtreeHasCurrentNodeLP(scip->tree);
28776 }
28777 
28778 /** returns, whether the LP of the current node is already constructed
28779  *
28780  * @return whether the LP of the current node is already constructed.
28781  *
28782  * @pre This method can be called if @p scip is in one of the following stages:
28783  * - \ref SCIP_STAGE_SOLVING
28784  *
28785  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28786  */
28788  SCIP* scip /**< SCIP data structure */
28789  )
28790 {
28791  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28792 
28793  return SCIPtreeIsFocusNodeLPConstructed(scip->tree);
28794 }
28795 
28796 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods
28797  *
28798  * @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also
28799  * the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to
28800  * call one of the later method after this one
28801  *
28802  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28803  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28804  *
28805  * @pre This method can be called if @p scip is in one of the following stages:
28806  * - \ref SCIP_STAGE_SOLVING
28807  *
28808  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28809  */
28811  SCIP* scip, /**< SCIP data structure */
28812  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
28813  )
28814 {
28815  SCIP_CALL( checkStage(scip, "SCIPconstructLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28816 
28817  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
28818  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
28819  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, cutoff) );
28820 
28821  return SCIP_OKAY;
28822 }
28823 
28824 /** makes sure that the LP of the current node is flushed
28825  *
28826  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
28827  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
28828  *
28829  * @pre This method can be called if @p scip is in one of the following stages:
28830  * - \ref SCIP_STAGE_SOLVING
28831  *
28832  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28833  */
28835  SCIP* scip /**< SCIP data structure */
28836  )
28837 {
28838  SCIP_CALL( checkStage(scip, "SCIPflushLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28839 
28840  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
28841 
28842  return SCIP_OKAY;
28843 }
28844 
28845 /** gets solution status of current LP
28846  *
28847  * @return the solution status of current LP.
28848  *
28849  * @pre This method can be called if @p scip is in one of the following stages:
28850  * - \ref SCIP_STAGE_SOLVING
28851  *
28852  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28853  */
28855  SCIP* scip /**< SCIP data structure */
28856  )
28857 {
28858  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28859 
28861  return SCIPlpGetSolstat(scip->lp);
28862  else
28863  return SCIP_LPSOLSTAT_NOTSOLVED;
28864 }
28865 
28866 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound
28867  *
28868  * @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound.
28869  *
28870  * @pre This method can be called if @p scip is in one of the following stages:
28871  * - \ref SCIP_STAGE_SOLVING
28872  *
28873  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28874  */
28876  SCIP* scip /**< SCIP data structure */
28877  )
28878 {
28879  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28880 
28881  return SCIPlpIsRelax(scip->lp);
28882 }
28883 
28884 /** gets objective value of current LP (which is the sum of column and loose objective value)
28885  *
28886  * @return the objective value of current LP (which is the sum of column and loose objective value).
28887  *
28888  * @pre This method can be called if @p scip is in one of the following stages:
28889  * - \ref SCIP_STAGE_SOLVING
28890  *
28891  * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
28892  * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by
28893  * SCIPgetLPSolstat() is SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
28894  *
28895  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28896  */
28898  SCIP* scip /**< SCIP data structure */
28899  )
28900 {
28901  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28902 
28903  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
28904 }
28905 
28906 /** gets part of objective value of current LP that results from COLUMN variables only
28907  *
28908  * @return the part of objective value of current LP that results from COLUMN variables only.
28909  *
28910  * @pre This method can be called if @p scip is in one of the following stages:
28911  * - \ref SCIP_STAGE_SOLVING
28912  *
28913  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28914  */
28916  SCIP* scip /**< SCIP data structure */
28917  )
28918 {
28919  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPColumnObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28920 
28921  return SCIPlpGetColumnObjval(scip->lp);
28922 }
28923 
28924 /** gets part of objective value of current LP that results from LOOSE variables only
28925  *
28926  * @return part of objective value of current LP that results from LOOSE variables only.
28927  *
28928  * @pre This method can be called if @p scip is in one of the following stages:
28929  * - \ref SCIP_STAGE_SOLVING
28930  *
28931  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28932  */
28934  SCIP* scip /**< SCIP data structure */
28935  )
28936 {
28937  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPLooseObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28938 
28939  return SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
28940 }
28941 
28942 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
28943  * function) global bound
28944  *
28945  * @return the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
28946  * function) global bound.
28947  *
28948  * @pre This method can be called if @p scip is in one of the following stages:
28949  * - \ref SCIP_STAGE_INITPRESOLVE
28950  * - \ref SCIP_STAGE_PRESOLVING
28951  * - \ref SCIP_STAGE_EXITPRESOLVE
28952  * - \ref SCIP_STAGE_PRESOLVED
28953  * - \ref SCIP_STAGE_INITSOLVE
28954  * - \ref SCIP_STAGE_SOLVING
28955  *
28956  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28957  */
28959  SCIP* scip /**< SCIP data structure */
28960  )
28961 {
28962  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28963 
28964  return SCIPlpGetGlobalPseudoObjval(scip->lp, scip->set, scip->transprob);
28965 }
28966 
28967 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
28968  * objective function) local bound
28969  *
28970  * @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
28971  * objective function) local bound.
28972  *
28973  * @pre This method can be called if @p scip is in one of the following stages:
28974  * - \ref SCIP_STAGE_INITPRESOLVE
28975  * - \ref SCIP_STAGE_PRESOLVING
28976  * - \ref SCIP_STAGE_EXITPRESOLVE
28977  * - \ref SCIP_STAGE_PRESOLVED
28978  * - \ref SCIP_STAGE_INITSOLVE
28979  * - \ref SCIP_STAGE_SOLVING
28980  *
28981  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
28982  */
28984  SCIP* scip /**< SCIP data structure */
28985  )
28986 {
28987  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
28988 
28989  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
28990 }
28991 
28992 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound
28993  *
28994  * @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound.
28995  *
28996  * @pre This method can be called if @p scip is in one of the following stages:
28997  * - \ref SCIP_STAGE_SOLVING
28998  *
28999  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29000  */
29002  SCIP* scip /**< SCIP data structure */
29003  )
29004 {
29005  SCIP_CALL_ABORT( checkStage(scip, "SCIPisRootLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29006 
29007  return SCIPlpIsRootLPRelax(scip->lp);
29008 }
29009 
29010 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved
29011  *
29012  * @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved.
29013  *
29014  * @pre This method can be called if @p scip is in one of the following stages:
29015  * - \ref SCIP_STAGE_INITPRESOLVE
29016  * - \ref SCIP_STAGE_PRESOLVING
29017  * - \ref SCIP_STAGE_EXITPRESOLVE
29018  * - \ref SCIP_STAGE_SOLVING
29019  *
29020  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29021  */
29023  SCIP* scip /**< SCIP data structure */
29024  )
29025 {
29026  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29027 
29028  return SCIPlpGetRootObjval(scip->lp);
29029 }
29030 
29031 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
29032  * returns SCIP_INVALID if the root node LP was not (yet) solved
29033  *
29034  * @return the part of the objective value of the root node LP that results from COLUMN variables only;
29035  * or SCIP_INVALID if the root node LP was not (yet) solved.
29036  *
29037  * @pre This method can be called if @p scip is in one of the following stages:
29038  * - \ref SCIP_STAGE_INITPRESOLVE
29039  * - \ref SCIP_STAGE_PRESOLVING
29040  * - \ref SCIP_STAGE_EXITPRESOLVE
29041  * - \ref SCIP_STAGE_SOLVING
29042  *
29043  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29044  */
29046  SCIP* scip /**< SCIP data structure */
29047  )
29048 {
29049  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootColumnObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29050 
29051  return SCIPlpGetRootColumnObjval(scip->lp);
29052 }
29053 
29054 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
29055  * returns SCIP_INVALID if the root node LP was not (yet) solved
29056  *
29057  * @return the part of the objective value of the root node LP that results from LOOSE variables only;
29058  * or SCIP_INVALID if the root node LP was not (yet) solved.
29059  *
29060  * @pre This method can be called if @p scip is in one of the following stages:
29061  * - \ref SCIP_STAGE_INITPRESOLVE
29062  * - \ref SCIP_STAGE_PRESOLVING
29063  * - \ref SCIP_STAGE_EXITPRESOLVE
29064  * - \ref SCIP_STAGE_SOLVING
29065  *
29066  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29067  */
29069  SCIP* scip /**< SCIP data structure */
29070  )
29071 {
29072  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRootLooseObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29073 
29074  return SCIPlpGetRootLooseObjval(scip->lp);
29075 }
29076 
29077 /** gets current LP columns along with the current number of LP columns
29078  *
29079  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29080  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29081  *
29082  * @pre This method can be called if @p scip is in one of the following stages:
29083  * - \ref SCIP_STAGE_SOLVING
29084  *
29085  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29086  */
29088  SCIP* scip, /**< SCIP data structure */
29089  SCIP_COL*** cols, /**< pointer to store the array of LP columns, or NULL */
29090  int* ncols /**< pointer to store the number of LP columns, or NULL */
29091  )
29092 {
29093  SCIP_CALL( checkStage(scip, "SCIPgetLPColsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29094 
29096  {
29097  if( cols != NULL )
29098  *cols = SCIPlpGetCols(scip->lp);
29099  if( ncols != NULL )
29100  *ncols = SCIPlpGetNCols(scip->lp);
29101  }
29102  else
29103  {
29104  if( cols != NULL )
29105  *cols = NULL;
29106  if( ncols != NULL )
29107  *ncols = 0;
29108  }
29109 
29110  return SCIP_OKAY;
29111 }
29112 
29113 /** gets current LP columns
29114  *
29115  * @return the current LP columns.
29116  *
29117  * @pre This method can be called if @p scip is in one of the following stages:
29118  * - \ref SCIP_STAGE_SOLVING
29119  *
29120  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29121  */
29123  SCIP* scip /**< SCIP data structure */
29124  )
29125 {
29126  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29127 
29129  return SCIPlpGetCols(scip->lp);
29130  else
29131  return NULL;
29132 }
29133 
29134 /** gets current number of LP columns
29135  *
29136  * @return the current number of LP columns.
29137  *
29138  * @pre This method can be called if @p scip is in one of the following stages:
29139  * - \ref SCIP_STAGE_SOLVING
29140  *
29141  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29142  */
29144  SCIP* scip /**< SCIP data structure */
29145  )
29146 {
29147  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29148 
29150  return SCIPlpGetNCols(scip->lp);
29151  else
29152  return 0;
29153 }
29154 
29155 /** gets current LP rows along with the current number of LP rows
29156  *
29157  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29158  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29159  *
29160  * @pre This method can be called if @p scip is in one of the following stages:
29161  * - \ref SCIP_STAGE_SOLVING
29162  *
29163  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29164  */
29166  SCIP* scip, /**< SCIP data structure */
29167  SCIP_ROW*** rows, /**< pointer to store the array of LP rows, or NULL */
29168  int* nrows /**< pointer to store the number of LP rows, or NULL */
29169  )
29170 {
29171  SCIP_CALL( checkStage(scip, "SCIPgetLPRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29172 
29174  {
29175  if( rows != NULL )
29176  *rows = SCIPlpGetRows(scip->lp);
29177  if( nrows != NULL )
29178  *nrows = SCIPlpGetNRows(scip->lp);
29179  }
29180  else
29181  {
29182  if( rows != NULL )
29183  *rows = NULL;
29184  if( nrows != NULL )
29185  *nrows = 0;
29186  }
29187 
29188  return SCIP_OKAY;
29189 }
29190 
29191 /** gets current LP rows
29192  *
29193  * @return the current LP rows.
29194  *
29195  * @pre This method can be called if @p scip is in one of the following stages:
29196  * - \ref SCIP_STAGE_SOLVING
29197  *
29198  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29199  */
29201  SCIP* scip /**< SCIP data structure */
29202  )
29203 {
29204  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29205 
29207  return SCIPlpGetRows(scip->lp);
29208  else
29209  return NULL;
29210 }
29211 
29212 /** gets current number of LP rows
29213  *
29214  * @return the current number of LP rows.
29215  *
29216  * @pre This method can be called if @p scip is in one of the following stages:
29217  * - \ref SCIP_STAGE_SOLVING
29218  *
29219  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29220  */
29222  SCIP* scip /**< SCIP data structure */
29223  )
29224 {
29225  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29226 
29228  return SCIPlpGetNRows(scip->lp);
29229  else
29230  return 0;
29231 }
29232 
29233 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
29234  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
29235  *
29236  * @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
29237  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing.
29238  *
29239  * @pre This method can be called if @p scip is in one of the following stages:
29240  * - \ref SCIP_STAGE_SOLVING
29241  *
29242  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29243  */
29245  SCIP* scip /**< SCIP data structure */
29246  )
29247 {
29248  SCIP_CALL_ABORT( checkStage(scip, "SCIPallColsInLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29249 
29250  return SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp);
29251 }
29252 
29253 /** returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis
29254  *
29255  * @return whether the current LP solution is basic, i.e. is defined by a valid simplex basis.
29256  *
29257  * @pre This method can be called if @p scip is in one of the following stages:
29258  * - \ref SCIP_STAGE_SOLVING
29259  *
29260  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29261  */
29263  SCIP* scip /**< SCIP data structure */
29264  )
29265 {
29266  SCIP_CALL_ABORT( checkStage(scip, "SCIPisLPSolBasic", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29267 
29268  return SCIPlpIsSolBasic(scip->lp);
29269 }
29270 
29271 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1
29272  *
29273  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29274  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29275  *
29276  * @pre This method can be called if @p scip is in one of the following stages:
29277  * - \ref SCIP_STAGE_SOLVING
29278  *
29279  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29280  */
29282  SCIP* scip, /**< SCIP data structure */
29283  int* basisind /**< pointer to store basis indices ready to keep number of rows entries */
29284  )
29285 {
29286  SCIP_CALL( checkStage(scip, "SCIPgetLPBasisInd", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29287 
29288  if( !SCIPlpIsSolBasic(scip->lp) )
29289  {
29290  SCIPerrorMessage("current LP solution is not basic\n");
29291  return SCIP_INVALIDCALL;
29292  }
29293 
29294  SCIP_CALL( SCIPlpGetBasisInd(scip->lp, basisind) );
29295 
29296  return SCIP_OKAY;
29297 }
29298 
29299 /** gets a row from the inverse basis matrix B^-1
29300  *
29301  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29302  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29303  *
29304  * @pre This method can be called if @p scip is in one of the following stages:
29305  * - \ref SCIP_STAGE_SOLVING
29306  *
29307  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29308  */
29310  SCIP* scip, /**< SCIP data structure */
29311  int r, /**< row number */
29312  SCIP_Real* coefs, /**< array to store the coefficients of the row */
29313  int* inds, /**< array to store the non-zero indices, or NULL */
29314  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29315  * (-1: if we do not store sparsity informations) */
29316  )
29317 {
29318  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29319 
29320  if( !SCIPlpIsSolBasic(scip->lp) )
29321  {
29322  SCIPerrorMessage("current LP solution is not basic\n");
29323  return SCIP_INVALIDCALL;
29324  }
29325 
29326  SCIP_CALL( SCIPlpGetBInvRow(scip->lp, r, coefs, inds, ninds) );
29327 
29328  /* debug check if the coef is the r-th line of the inverse matrix B^-1 */
29329  SCIP_CALL( SCIPdebugCheckBInvRow(scip, r, coefs) ); /*lint !e506 !e774*/
29330 
29331  return SCIP_OKAY;
29332 }
29333 
29334 /** gets a column from the inverse basis matrix B^-1
29335  *
29336  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29337  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
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  int c, /**< column number of B^-1; this is NOT the number of the column in the LP
29347  * returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
29348  * to get the array which links the B^-1 column numbers to the row and
29349  * column numbers of the LP! c must be between 0 and nrows-1, since the
29350  * basis has the size nrows * nrows */
29351  SCIP_Real* coefs, /**< array to store the coefficients of the column */
29352  int* inds, /**< array to store the non-zero indices, or NULL */
29353  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29354  * (-1: if we do not store sparsity informations) */
29355  )
29356 {
29357  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvCol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29358 
29359  if( !SCIPlpIsSolBasic(scip->lp) )
29360  {
29361  SCIPerrorMessage("current LP solution is not basic\n");
29362  return SCIP_INVALIDCALL;
29363  }
29364 
29365  SCIP_CALL( SCIPlpGetBInvCol(scip->lp, c, coefs, inds, ninds) );
29366 
29367  return SCIP_OKAY;
29368 }
29369 
29370 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A)
29371  *
29372  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29373  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29374  *
29375  * @pre This method can be called if @p scip is in one of the following stages:
29376  * - \ref SCIP_STAGE_SOLVING
29377  *
29378  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29379  */
29381  SCIP* scip, /**< SCIP data structure */
29382  int r, /**< row number */
29383  SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPgetLPBInvRow(), or NULL */
29384  SCIP_Real* coefs, /**< array to store the coefficients of the row */
29385  int* inds, /**< array to store the non-zero indices, or NULL */
29386  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29387  * (-1: if we do not store sparsity informations) */
29388  )
29389 {
29390  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvARow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29391 
29392  if( !SCIPlpIsSolBasic(scip->lp) )
29393  {
29394  SCIPerrorMessage("current LP solution is not basic\n");
29395  return SCIP_INVALIDCALL;
29396  }
29397 
29398  SCIP_CALL( SCIPlpGetBInvARow(scip->lp, r, binvrow, coefs, inds, ninds) );
29399 
29400  return SCIP_OKAY;
29401 }
29402 
29403 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
29404  * i.e., it computes B^-1 * A_c with A_c being the c'th column of A
29405  *
29406  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29407  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29408  *
29409  * @pre This method can be called if @p scip is in one of the following stages:
29410  * - \ref SCIP_STAGE_SOLVING
29411  *
29412  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29413  */
29415  SCIP* scip, /**< SCIP data structure */
29416  int c, /**< column number which can be accessed by SCIPcolGetLPPos() */
29417  SCIP_Real* coefs, /**< array to store the coefficients of the column */
29418  int* inds, /**< array to store the non-zero indices, or NULL */
29419  int* ninds /**< pointer to store the number of non-zero indices, or NULL
29420  * (-1: if we do not store sparsity informations) */
29421  )
29422 {
29423  SCIP_CALL( checkStage(scip, "SCIPgetLPBInvACol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29424 
29425  if( !SCIPlpIsSolBasic(scip->lp) )
29426  {
29427  SCIPerrorMessage("current LP solution is not basic\n");
29428  return SCIP_INVALIDCALL;
29429  }
29430 
29431  SCIP_CALL( SCIPlpGetBInvACol(scip->lp, c, coefs, inds, ninds) );
29432 
29433  return SCIP_OKAY;
29434 }
29435 
29436 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
29437  * LP row are swapped in the summation
29438  *
29439  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29440  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29441  *
29442  * @pre This method can be called if @p scip is in one of the following stages:
29443  * - \ref SCIP_STAGE_SOLVING
29444  *
29445  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29446  */
29448  SCIP* scip, /**< SCIP data structure */
29449  SCIP_Real* weights, /**< row weights in row summation */
29450  SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
29451  SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */
29452  SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */
29453  )
29454 {
29455  SCIP_CALL( checkStage(scip, "SCIPsumLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29456 
29457  SCIP_CALL( SCIPlpSumRows(scip->lp, scip->set, scip->transprob, weights, sumcoef, sumlhs, sumrhs) );
29458 
29459  return SCIP_OKAY;
29460 }
29461 
29462 /** calculates a MIR cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because these
29463  * rows cannot participate in a MIR cut.
29464  *
29465  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29466  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29467  *
29468  * @pre This method can be called if @p scip is in one of the following stages:
29469  * - \ref SCIP_STAGE_SOLVING
29470  *
29471  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29472  */
29474  SCIP* scip, /**< SCIP data structure */
29475  SCIP_SOL* sol, /**< the solution that should be separated, or NULL for LP solution */
29476  SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
29477  SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
29478  SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
29479  SCIP_Bool fixintegralrhs, /**< should complementation tried to be adjusted such that rhs gets fractional? */
29480  int* boundsfortrans, /**< bounds that should be used for transformed variables: vlb_idx/vub_idx,
29481  * -1 for global lb/ub, -2 for local lb/ub, or -3 for using closest bound;
29482  * NULL for using closest bound for all variables */
29483  SCIP_BOUNDTYPE* boundtypesfortrans, /**< type of bounds that should be used for transformed variables;
29484  * NULL for using closest bound for all variables */
29485  int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
29486  SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
29487  SCIP_Real minfrac, /**< minimal fractionality of rhs to produce MIR cut for */
29488  SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce MIR cut for */
29489  SCIP_Real* weights, /**< row weights in row summation; some weights might be set to zero */
29490  SCIP_Real maxweight, /**< largest magnitude of weights; set to -1.0 if sparsity information is
29491  * unknown */
29492  int* weightinds, /**< sparsity pattern of weights; size nrowinds; NULL if sparsity info is
29493  * unknown */
29494  int nweightinds, /**< number of nonzeros in weights; -1 if rowinds is NULL */
29495  int rowlensum, /**< total number of non-zeros in used rows (row associated with nonzero weight coefficient); -1 if unknown */
29496  int* sidetypes, /**< specify row side type (-1 = lhs, 0 = unkown, 1 = rhs) or NULL for automatic choices */
29497  SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
29498  SCIP_Real* mksetcoefs, /**< array to store mixed knapsack set coefficients: size nvars; or NULL */
29499  SCIP_Bool* mksetcoefsvalid, /**< pointer to store whether mixed knapsack set coefficients are valid; or NULL */
29500  SCIP_Real* mircoef, /**< array to store MIR coefficients: must be of size SCIPgetNVars() */
29501  SCIP_Real* mirrhs, /**< pointer to store the right hand side of the MIR row */
29502  SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
29503  SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid MIR cut */
29504  SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
29505  int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
29506  )
29507 {
29508  SCIP_CALL( checkStage(scip, "SCIPcalcMIR", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29509 
29510  SCIP_CALL( SCIPcutsCalcLpMIR(scip, sol, boundswitch, usevbds, allowlocal, fixintegralrhs, boundsfortrans,
29511  boundtypesfortrans, maxmksetcoefs, maxweightrange, minfrac, maxfrac, weights, maxweight, weightinds, nweightinds,
29512  rowlensum, sidetypes, scale, mksetcoefs, mksetcoefsvalid, mircoef, mirrhs, cutactivity, success, cutislocal,
29513  cutrank) );
29514 
29515  return SCIP_OKAY;
29516 }
29517 
29518 /** calculates a strong CG cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because these
29519  * rows cannot participate in a MIR cut.
29520  *
29521  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29522  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29523  *
29524  * @pre This method can be called if @p scip is in one of the following stages:
29525  * - \ref SCIP_STAGE_SOLVING
29526  *
29527  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29528  */
29530  SCIP* scip, /**< SCIP data structure */
29531  SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
29532  SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
29533  SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
29534  int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
29535  SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
29536  SCIP_Real minfrac, /**< minimal fractionality of rhs to produce strong CG cut for */
29537  SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce strong CG cut for */
29538  SCIP_Real* weights, /**< row weights in row summation; some weights might be set to zero */
29539  int* inds, /**< indices of non-zero entries in weights array, or NULL */
29540  int ninds, /**< number of indices of non-zero entries in weights array, -1 if inds is
29541  * NULL */
29542  SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
29543  SCIP_Real* mircoef, /**< array to store strong CG coefficients: must be of size SCIPgetNVars() */
29544  SCIP_Real* mirrhs, /**< pointer to store the right hand side of the strong CG row */
29545  SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
29546  SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid strong CG cut */
29547  SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
29548  int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
29549  )
29550 {
29551  SCIP_CALL( checkStage(scip, "SCIPcalcStrongCG", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29552 
29553  SCIP_CALL( SCIPcutsCalcStrongCG(scip, boundswitch, usevbds, allowlocal, maxmksetcoefs, maxweightrange, minfrac,
29554  maxfrac, weights, inds, ninds, scale, mircoef, mirrhs, cutactivity, success, cutislocal, cutrank) );
29555 
29556  return SCIP_OKAY;
29557 }
29558 
29559 /** writes current LP to a file
29560  *
29561  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29562  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29563  *
29564  * @pre This method can be called if @p scip is in one of the following stages:
29565  * - \ref SCIP_STAGE_SOLVING
29566  *
29567  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29568  */
29570  SCIP* scip, /**< SCIP data structure */
29571  const char* filename /**< file name */
29572  )
29573 {
29574 
29575  SCIP_Bool cutoff;
29576 
29577  SCIP_CALL( checkStage(scip, "SCIPwriteLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29579  {
29580  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
29581  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
29582  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, &cutoff) );
29583  }
29584 
29585  /* we need a flushed lp to write the current lp */
29586  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29587 
29588  SCIP_CALL( SCIPlpWrite(scip->lp, filename) );
29589 
29590  return SCIP_OKAY;
29591 }
29592 
29593 /** writes MIP relaxation of the current branch-and-bound node to a file
29594  *
29595  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29596  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29597  *
29598  * @pre This method can be called if @p scip is in one of the following stages:
29599  * - \ref SCIP_STAGE_SOLVING
29600  *
29601  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29602  */
29604  SCIP* scip, /**< SCIP data structure */
29605  const char* filename, /**< file name */
29606  SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid
29607  * troubles with reserved symbols? */
29608  SCIP_Bool origobj, /**< should the original objective function be used? */
29609  SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */
29610  )
29611 {
29612  SCIP_CALL( checkStage(scip, "SCIPwriteMIP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29613 
29614  /* we need a flushed lp to write the current mip */
29615  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
29616 
29617  SCIP_CALL( SCIPlpWriteMip(scip->lp, scip->set, scip->messagehdlr, filename, genericnames,
29618  origobj, scip->origprob->objsense, scip->transprob->objscale, scip->transprob->objoffset, lazyconss) );
29619 
29620  return SCIP_OKAY;
29621 }
29622 
29623 /** gets the LP interface of SCIP;
29624  * with the LPI you can use all of the methods defined in lpi/lpi.h;
29625  *
29626  * @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely
29627  * after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution
29628  * (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in
29629  * advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make
29630  * sure, the internal solution status is recovered completely at the end of your method. This can be achieved
29631  * by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it
29632  * afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the
29633  * appropriate SCIPlpiSolve...() call in order to reinstall the internal solution status.
29634  *
29635  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
29636  *
29637  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29638  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29639  *
29640  * @pre This method can be called if @p scip is in one of the following stages:
29641  * - \ref SCIP_STAGE_TRANSFORMED
29642  * - \ref SCIP_STAGE_INITPRESOLVE
29643  * - \ref SCIP_STAGE_PRESOLVING
29644  * - \ref SCIP_STAGE_EXITPRESOLVE
29645  * - \ref SCIP_STAGE_PRESOLVED
29646  * - \ref SCIP_STAGE_INITSOLVE
29647  * - \ref SCIP_STAGE_SOLVING
29648  * - \ref SCIP_STAGE_SOLVED
29649  * - \ref SCIP_STAGE_EXITSOLVE
29650  *
29651  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29652  */
29654  SCIP* scip, /**< SCIP data structure */
29655  SCIP_LPI** lpi /**< pointer to store the LP interface */
29656  )
29657 {
29658  assert(lpi != NULL);
29659 
29660  SCIP_CALL( checkStage(scip, "SCIPgetLPI", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
29661 
29662  *lpi = SCIPlpGetLPI(scip->lp);
29663 
29664  return SCIP_OKAY;
29665 }
29666 
29667 /** displays quality information about the current LP solution. An LP solution need to be available; information printed
29668  * is subject to what the LP solver supports
29669  *
29670  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29671  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29672  *
29673  * @pre This method can be called if @p scip is in one of the following stages:
29674  * - \ref SCIP_STAGE_INIT
29675  * - \ref SCIP_STAGE_PROBLEM
29676  * - \ref SCIP_STAGE_TRANSFORMED
29677  * - \ref SCIP_STAGE_INITPRESOLVE
29678  * - \ref SCIP_STAGE_PRESOLVING
29679  * - \ref SCIP_STAGE_EXITPRESOLVE
29680  * - \ref SCIP_STAGE_PRESOLVED
29681  * - \ref SCIP_STAGE_SOLVING
29682  * - \ref SCIP_STAGE_SOLVED
29683  * - \ref SCIP_STAGE_FREE
29684  *
29685  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29686  *
29687  * @note The printing process is done via the message handler system.
29688  */
29690  SCIP* scip, /**< SCIP data structure */
29691  FILE* file /**< output file (or NULL for standard output) */
29692  )
29693 {
29694  SCIP_LPI* lpi;
29695  SCIP_Real quality;
29696 
29697  SCIP_CALL( checkStage(scip, "SCIPprintLPSolutionQuality", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
29698 
29699  switch( scip->set->stage )
29700  {
29701  case SCIP_STAGE_INIT:
29702  case SCIP_STAGE_PROBLEM:
29705  case SCIP_STAGE_PRESOLVING:
29707  case SCIP_STAGE_PRESOLVED:
29708  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Problem not solving yet, no LP available.\n");
29709  return SCIP_OKAY;
29710 
29711  case SCIP_STAGE_SOLVING:
29712  case SCIP_STAGE_SOLVED:
29713  break;
29714 
29715  default:
29716  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
29717  return SCIP_INVALIDCALL;
29718  } /*lint !e788*/
29719 
29720  /* note that after diving mode, the LPI may only have the basis information, but SCIPlpiWasSolved() can be false; in
29721  * this case, we will (depending on the LP solver) probably not obtain the quality measure; one solution would be to
29722  * store the results of SCIPlpiGetRealSolQuality() within the SCIP_LP after each LP solve; this would have the added
29723  * advantage, that we reduce direct access to the LPI, but it sounds potentially expensive
29724  */
29725  lpi = SCIPlpGetLPI(scip->lp);
29726  assert(lpi != NULL);
29727 
29729  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (estimated): ");
29730  if( quality != SCIP_INVALID ) /*lint !e777*/
29731  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
29732  else
29733  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
29734 
29736  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (exact): ");
29737  if( quality != SCIP_INVALID ) /*lint !e777*/
29738  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
29739  else
29740  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
29741 
29742  return SCIP_OKAY;
29743 }
29744 
29745 /** compute relative interior point to current LP
29746  * @see SCIPlpComputeRelIntPoint
29747  *
29748  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29749  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29750  *
29751  * @pre This method can be called if @p scip is in one of the following stages:
29752  * - \ref SCIP_STAGE_TRANSFORMED
29753  * - \ref SCIP_STAGE_INITPRESOLVE
29754  * - \ref SCIP_STAGE_PRESOLVING
29755  * - \ref SCIP_STAGE_EXITPRESOLVE
29756  * - \ref SCIP_STAGE_PRESOLVED
29757  * - \ref SCIP_STAGE_SOLVING
29758  * - \ref SCIP_STAGE_SOLVED
29759  *
29760  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
29761  */
29763  SCIP* scip, /**< SCIP data structure */
29764  SCIP_Bool relaxrows, /**< should the rows be relaxed */
29765  SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */
29766  SCIP_Real timelimit, /**< time limit for LP solver */
29767  int iterlimit, /**< iteration limit for LP solver */
29768  SCIP_SOL** point /**< relative interior point on exit */
29769  )
29770 {
29771  SCIP_Real* pointvals;
29772  SCIP_Bool success;
29773 
29774  SCIP_CALL( checkStage(scip, "SCIPcomputeLPRelIntPoint", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
29775 
29776  assert(scip != NULL);
29777  assert(scip->lp != NULL);
29778  assert(point != NULL);
29779 
29780  *point = NULL;
29781 
29782  SCIP_CALL( SCIPallocBufferArray(scip, &pointvals, SCIPlpGetNCols(scip->lp)) );
29783 
29784  SCIP_CALL( SCIPlpComputeRelIntPoint(scip->set, scip->messagehdlr, scip->lp, scip->transprob,
29785  relaxrows, inclobjcutoff, timelimit, iterlimit, pointvals, &success) );
29786 
29787  /* if successful, create new solution with point values */
29788  if( success )
29789  {
29790  int i;
29791 
29792  SCIP_CALL( SCIPcreateSol(scip, point, NULL) );
29793 
29794  for( i = 0; i < SCIPlpGetNCols(scip->lp); ++i )
29795  {
29796  SCIP_CALL( SCIPsetSolVal(scip, *point, SCIPcolGetVar(SCIPlpGetCols(scip->lp)[i]), pointvals[i]) );
29797  }
29798  }
29799 
29800  SCIPfreeBufferArray(scip, &pointvals);
29801 
29802  return SCIP_OKAY;
29803 }
29804 
29805 /*
29806  * LP column methods
29807  */
29808 
29809 /** returns the reduced costs of a column in the last (feasible) LP
29810  *
29811  * @return the reduced costs of a column in the last (feasible) LP
29812  *
29813  * @pre this method can be called in one of the following stages of the SCIP solving process:
29814  * - \ref SCIP_STAGE_SOLVING
29815  * - \ref SCIP_STAGE_SOLVED
29816  *
29817  * @note calling this method in SCIP_STAGE_SOLVED is only recommended to experienced users and should only be called
29818  * for pure LP instances (without presolving)
29819  */
29821  SCIP* scip, /**< SCIP data structure */
29822  SCIP_COL* col /**< LP column */
29823  )
29824 {
29825  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColRedcost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
29826 
29827  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
29828  {
29829  SCIPerrorMessage("cannot get reduced costs, because node LP is not processed\n");
29830  SCIPABORT();
29831  return 0.0; /*lint !e527*/
29832  }
29833 
29834  return SCIPcolGetRedcost(col, scip->stat, scip->lp);
29835 }
29836 
29837 
29838 /** returns the Farkas coefficient of a column in the last (infeasible) LP
29839  *
29840  * @return the Farkas coefficient of a column in the last (infeasible) LP
29841  *
29842  * @pre this method can be called in one of the following stages of the SCIP solving process:
29843  * - \ref SCIP_STAGE_SOLVING
29844  */
29846  SCIP* scip, /**< SCIP data structure */
29847  SCIP_COL* col /**< LP column */
29848  )
29849 {
29850  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetColFarkasCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29851 
29852  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
29853  {
29854  SCIPerrorMessage("cannot get Farkas coeff, because node LP is not processed\n");
29855  SCIPABORT();
29856  return 0.0; /*lint !e527*/
29857  }
29858 
29859  return SCIPcolGetFarkasCoef(col, scip->stat, scip->lp);
29860 }
29861 
29862 /** marks a column to be not removable from the LP in the current node
29863  *
29864  * @pre this method can be called in the following stage of the SCIP solving process:
29865  * - \ref SCIP_STAGE_SOLVING
29866  */
29868  SCIP* scip, /**< SCIP data structure */
29869  SCIP_COL* col /**< LP column */
29870  )
29871 {
29872  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkColNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29873 
29874  SCIPcolMarkNotRemovableLocal(col, scip->stat);
29875 }
29876 
29877 /*
29878  * LP row methods
29879  */
29880 
29881 /** creates and captures an LP row from a constraint handler
29882  *
29883  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29884  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29885  *
29886  * @pre this method can be called in one of the following stages of the SCIP solving process:
29887  * - \ref SCIP_STAGE_INITSOLVE
29888  * - \ref SCIP_STAGE_SOLVING
29889  */
29891  SCIP* scip, /**< SCIP data structure */
29892  SCIP_ROW** row, /**< pointer to row */
29893  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
29894  const char* name, /**< name of row */
29895  int len, /**< number of nonzeros in the row */
29896  SCIP_COL** cols, /**< array with columns of row entries */
29897  SCIP_Real* vals, /**< array with coefficients of row entries */
29898  SCIP_Real lhs, /**< left hand side of row */
29899  SCIP_Real rhs, /**< right hand side of row */
29900  SCIP_Bool local, /**< is row only valid locally? */
29901  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
29902  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
29903  )
29904 {
29905  assert(conshdlr != NULL);
29906 
29907  SCIP_CALL( checkStage(scip, "SCIPcreateRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29908 
29909  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
29910  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
29911 
29912  return SCIP_OKAY;
29913 }
29914 
29915 /** creates and captures an LP row from a separator
29916  *
29917  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29918  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29919  *
29920  * @pre this method can be called in one of the following stages of the SCIP solving process:
29921  * - \ref SCIP_STAGE_INITSOLVE
29922  * - \ref SCIP_STAGE_SOLVING
29923  */
29925  SCIP* scip, /**< SCIP data structure */
29926  SCIP_ROW** row, /**< pointer to row */
29927  SCIP_SEPA* sepa, /**< separator that creates the row */
29928  const char* name, /**< name of row */
29929  int len, /**< number of nonzeros in the row */
29930  SCIP_COL** cols, /**< array with columns of row entries */
29931  SCIP_Real* vals, /**< array with coefficients of row entries */
29932  SCIP_Real lhs, /**< left hand side of row */
29933  SCIP_Real rhs, /**< right hand side of row */
29934  SCIP_Bool local, /**< is row only valid locally? */
29935  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
29936  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
29937  )
29938 {
29939  assert(sepa != NULL);
29940 
29941  SCIP_CALL( checkStage(scip, "SCIPcreateRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29942 
29943  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
29944  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
29945 
29946  return SCIP_OKAY;
29947 }
29948 
29949 /** creates and captures an LP row from an unspecified source
29950  *
29951  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29952  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29953  *
29954  * @pre this method can be called in one of the following stages of the SCIP solving process:
29955  * - \ref SCIP_STAGE_INITSOLVE
29956  * - \ref SCIP_STAGE_SOLVING
29957  */
29959  SCIP* scip, /**< SCIP data structure */
29960  SCIP_ROW** row, /**< pointer to row */
29961  const char* name, /**< name of row */
29962  int len, /**< number of nonzeros in the row */
29963  SCIP_COL** cols, /**< array with columns of row entries */
29964  SCIP_Real* vals, /**< array with coefficients of row entries */
29965  SCIP_Real lhs, /**< left hand side of row */
29966  SCIP_Real rhs, /**< right hand side of row */
29967  SCIP_Bool local, /**< is row only valid locally? */
29968  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
29969  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
29970  )
29971 {
29972  SCIP_CALL( checkStage(scip, "SCIPcreateRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
29973 
29974  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
29975  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
29976 
29977  return SCIP_OKAY;
29978 }
29979 
29980 /** creates and captures an LP row
29981  *
29982  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
29983  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
29984  *
29985  * @pre this method can be called in one of the following stages of the SCIP solving process:
29986  * - \ref SCIP_STAGE_INITSOLVE
29987  * - \ref SCIP_STAGE_SOLVING
29988  *
29989  * @deprecated Please use SCIPcreateRowCons() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order
29990  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec().
29991  */
29993  SCIP* scip, /**< SCIP data structure */
29994  SCIP_ROW** row, /**< pointer to row */
29995  const char* name, /**< name of row */
29996  int len, /**< number of nonzeros in the row */
29997  SCIP_COL** cols, /**< array with columns of row entries */
29998  SCIP_Real* vals, /**< array with coefficients of row entries */
29999  SCIP_Real lhs, /**< left hand side of row */
30000  SCIP_Real rhs, /**< right hand side of row */
30001  SCIP_Bool local, /**< is row only valid locally? */
30002  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30003  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30004  )
30005 {
30006  SCIP_CALL( checkStage(scip, "SCIPcreateRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30007 
30008  SCIP_CALL( SCIPcreateRowUnspec(scip, row, name, len, cols, vals, lhs, rhs, local, modifiable, removable) );
30009 
30010  return SCIP_OKAY;
30011 }
30012 
30013 /** creates and captures an LP row without any coefficients from a constraint handler
30014  *
30015  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30016  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30017  *
30018  * @pre this method can be called in one of the following stages of the SCIP solving process:
30019  * - \ref SCIP_STAGE_INITSOLVE
30020  * - \ref SCIP_STAGE_SOLVING
30021  */
30023  SCIP* scip, /**< SCIP data structure */
30024  SCIP_ROW** row, /**< pointer to row */
30025  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
30026  const char* name, /**< name of row */
30027  SCIP_Real lhs, /**< left hand side of row */
30028  SCIP_Real rhs, /**< right hand side of row */
30029  SCIP_Bool local, /**< is row only valid locally? */
30030  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30031  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30032  )
30033 {
30034  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30035 
30036  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30037  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
30038 
30039  return SCIP_OKAY;
30040 }
30041 
30042 /** creates and captures an LP row without any coefficients from a separator
30043  *
30044  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30045  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30046  *
30047  * @pre this method can be called in one of the following stages of the SCIP solving process:
30048  * - \ref SCIP_STAGE_INITSOLVE
30049  * - \ref SCIP_STAGE_SOLVING
30050  */
30052  SCIP* scip, /**< SCIP data structure */
30053  SCIP_ROW** row, /**< pointer to row */
30054  SCIP_SEPA* sepa, /**< separator that creates the row */
30055  const char* name, /**< name of row */
30056  SCIP_Real lhs, /**< left hand side of row */
30057  SCIP_Real rhs, /**< right hand side of row */
30058  SCIP_Bool local, /**< is row only valid locally? */
30059  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30060  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30061  )
30062 {
30063  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30064 
30065  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30066  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
30067 
30068  return SCIP_OKAY;
30069 }
30070 
30071 /** creates and captures an LP row without any coefficients from an unspecified source
30072  *
30073  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30074  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30075  *
30076  * @pre this method can be called in one of the following stages of the SCIP solving process:
30077  * - \ref SCIP_STAGE_INITSOLVE
30078  * - \ref SCIP_STAGE_SOLVING
30079  */
30081  SCIP* scip, /**< SCIP data structure */
30082  SCIP_ROW** row, /**< pointer to row */
30083  const char* name, /**< name of row */
30084  SCIP_Real lhs, /**< left hand side of row */
30085  SCIP_Real rhs, /**< right hand side of row */
30086  SCIP_Bool local, /**< is row only valid locally? */
30087  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30088  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30089  )
30090 {
30091  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30092 
30093  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
30094  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
30095 
30096  return SCIP_OKAY;
30097 }
30098 
30099 /** creates and captures an LP row without any coefficients
30100  *
30101  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30102  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30103  *
30104  * @pre this method can be called in one of the following stages of the SCIP solving process:
30105  * - \ref SCIP_STAGE_INITSOLVE
30106  * - \ref SCIP_STAGE_SOLVING
30107  *
30108  * @deprecated Please use SCIPcreateEmptyRowCons() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order
30109  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec().
30110  */
30112  SCIP* scip, /**< SCIP data structure */
30113  SCIP_ROW** row, /**< pointer to row */
30114  const char* name, /**< name of row */
30115  SCIP_Real lhs, /**< left hand side of row */
30116  SCIP_Real rhs, /**< right hand side of row */
30117  SCIP_Bool local, /**< is row only valid locally? */
30118  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
30119  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
30120  )
30121 {
30122  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30123 
30124  SCIP_CALL( SCIPcreateEmptyRowUnspec(scip, row, name, lhs, rhs, local, modifiable, removable) );
30125 
30126  return SCIP_OKAY;
30127 }
30128 
30129 /** increases usage counter of LP row
30130  *
30131  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30132  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30133  *
30134  * @pre this method can be called in one of the following stages of the SCIP solving process:
30135  * - \ref SCIP_STAGE_INITSOLVE
30136  * - \ref SCIP_STAGE_SOLVING
30137  */
30139  SCIP* scip, /**< SCIP data structure */
30140  SCIP_ROW* row /**< row to capture */
30141  )
30142 {
30143  SCIP_CALL( checkStage(scip, "SCIPcaptureRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30144 
30145  SCIProwCapture(row);
30146 
30147  return SCIP_OKAY;
30148 }
30149 
30150 /** decreases usage counter of LP row, and frees memory if necessary
30151  *
30152  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30153  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30154  *
30155  * @pre this method can be called in one of the following stages of the SCIP solving process:
30156  * - \ref SCIP_STAGE_INITSOLVE
30157  * - \ref SCIP_STAGE_SOLVING
30158  * - \ref SCIP_STAGE_EXITSOLVE
30159  */
30161  SCIP* scip, /**< SCIP data structure */
30162  SCIP_ROW** row /**< pointer to LP row */
30163  )
30164 {
30165  SCIP_CALL( checkStage(scip, "SCIPreleaseRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
30166 
30167  SCIP_CALL( SCIProwRelease(row, scip->mem->probmem, scip->set, scip->lp) );
30168 
30169  return SCIP_OKAY;
30170 }
30171 
30172 /** changes left hand side of LP row
30173  *
30174  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30175  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30176  *
30177  * @pre this method can be called in one of the following stages of the SCIP solving process:
30178  * - \ref SCIP_STAGE_INITSOLVE
30179  * - \ref SCIP_STAGE_SOLVING
30180  */
30182  SCIP* scip, /**< SCIP data structure */
30183  SCIP_ROW* row, /**< LP row */
30184  SCIP_Real lhs /**< new left hand side */
30185  )
30186 {
30187  SCIP_CALL( checkStage(scip, "SCIPchgRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30188 
30189  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
30190 
30191  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, lhs) );
30192 
30193  return SCIP_OKAY;
30194 }
30195 
30196 /** changes right hand side of LP row
30197  *
30198  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30199  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30200  *
30201  * @pre this method can be called in one of the following stages of the SCIP solving process:
30202  * - \ref SCIP_STAGE_INITSOLVE
30203  * - \ref SCIP_STAGE_SOLVING
30204  */
30206  SCIP* scip, /**< SCIP data structure */
30207  SCIP_ROW* row, /**< LP row */
30208  SCIP_Real rhs /**< new right hand side */
30209  )
30210 {
30211  SCIP_CALL( checkStage(scip, "SCIPchgRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30212 
30213  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
30214 
30215  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, rhs) );
30216 
30217  return SCIP_OKAY;
30218 }
30219 
30220 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
30221  * after all additions were applied, SCIPflushRowExtensions() must be called;
30222  * while the caching of row extensions is activated, information methods of the row give invalid results;
30223  * caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase
30224  * the performance
30225  *
30226  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30227  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30228  *
30229  * @pre this method can be called in one of the following stages of the SCIP solving process:
30230  * - \ref SCIP_STAGE_INITSOLVE
30231  * - \ref SCIP_STAGE_SOLVING
30232  */
30234  SCIP* scip, /**< SCIP data structure */
30235  SCIP_ROW* row /**< LP row */
30236  )
30237 {
30238  SCIP_CALL( checkStage(scip, "SCIPcacheRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30239 
30240  /* delay the row sorting */
30241  SCIProwDelaySort(row);
30242 
30243  return SCIP_OKAY;
30244 }
30245 
30246 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with
30247  * equal columns into a single coefficient
30248  *
30249  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30250  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30251  *
30252  * @pre this method can be called in one of the following stages of the SCIP solving process:
30253  * - \ref SCIP_STAGE_INITSOLVE
30254  * - \ref SCIP_STAGE_SOLVING
30255  */
30257  SCIP* scip, /**< SCIP data structure */
30258  SCIP_ROW* row /**< LP row */
30259  )
30260 {
30261  SCIP_CALL( checkStage(scip, "SCIPflushRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30262 
30263  /* force the row sorting, and merge equal column entries */
30264  SCIProwForceSort(row, scip->set);
30265 
30266  return SCIP_OKAY;
30267 }
30268 
30269 /** resolves variable to columns and adds them with the coefficient to the row
30270  *
30271  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30272  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30273  *
30274  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variable will not added.
30275  *
30276  * @pre this method can be called in one of the following stages of the SCIP solving process:
30277  * - \ref SCIP_STAGE_INITSOLVE
30278  * - \ref SCIP_STAGE_SOLVING
30279  *
30280  * @note In case calling this method in the enforcement process of an lp solution, it might be that some variables,
30281  * that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP.
30282  * For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution
30283  * on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but
30284  * creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the
30285  * initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was
30286  * violated, the linear relaxation might not be violated anymore.)
30287  */
30289  SCIP* scip, /**< SCIP data structure */
30290  SCIP_ROW* row, /**< LP row */
30291  SCIP_VAR* var, /**< problem variable */
30292  SCIP_Real val /**< value of coefficient */
30293  )
30294 {
30295  SCIP_CALL( checkStage(scip, "SCIPaddVarToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30296 
30297  SCIP_CALL( SCIPvarAddToRow(var, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp, row, val) );
30298 
30299  return SCIP_OKAY;
30300 }
30301 
30302 /** resolves variables to columns and adds them with the coefficients to the row;
30303  * this method caches the row extensions and flushes them afterwards to gain better performance
30304  *
30305  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30306  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30307  *
30308  * @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added.
30309  *
30310  * @pre this method can be called in one of the following stages of the SCIP solving process:
30311  * - \ref SCIP_STAGE_INITSOLVE
30312  * - \ref SCIP_STAGE_SOLVING
30313  */
30315  SCIP* scip, /**< SCIP data structure */
30316  SCIP_ROW* row, /**< LP row */
30317  int nvars, /**< number of variables to add to the row */
30318  SCIP_VAR** vars, /**< problem variables to add */
30319  SCIP_Real* vals /**< values of coefficients */
30320  )
30321 {
30322  int v;
30323 
30324  assert(nvars == 0 || vars != NULL);
30325  assert(nvars == 0 || vals != NULL);
30326 
30327  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30328 
30329  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
30330  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
30331 
30332  /* delay the row sorting */
30333  SCIProwDelaySort(row);
30334 
30335  /* add the variables to the row */
30336  for( v = 0; v < nvars; ++v )
30337  {
30338  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
30339  row, vals[v]) );
30340  }
30341 
30342  /* force the row sorting */
30343  SCIProwForceSort(row, scip->set);
30344 
30345  return SCIP_OKAY;
30346 }
30347 
30348 /** resolves variables to columns and adds them with the same single coefficient to the row;
30349  * this method caches the row extensions and flushes them afterwards to gain better performance
30350  *
30351  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30352  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30353  *
30354  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added.
30355  *
30356  * @pre this method can be called in one of the following stages of the SCIP solving process:
30357  * - \ref SCIP_STAGE_INITSOLVE
30358  * - \ref SCIP_STAGE_SOLVING
30359  */
30361  SCIP* scip, /**< SCIP data structure */
30362  SCIP_ROW* row, /**< LP row */
30363  int nvars, /**< number of variables to add to the row */
30364  SCIP_VAR** vars, /**< problem variables to add */
30365  SCIP_Real val /**< unique value of all coefficients */
30366  )
30367 {
30368  int v;
30369 
30370  assert(nvars == 0 || vars != NULL);
30371 
30372  SCIP_CALL( checkStage(scip, "SCIPaddVarsToRowSameCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30373 
30374  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
30375  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
30376 
30377  /* delay the row sorting */
30378  SCIProwDelaySort(row);
30379 
30380  /* add the variables to the row */
30381  for( v = 0; v < nvars; ++v )
30382  {
30383  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
30384  row, val) );
30385  }
30386 
30387  /* force the row sorting */
30388  SCIProwForceSort(row, scip->set);
30389 
30390  return SCIP_OKAY;
30391 }
30392 
30393 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
30394  *
30395  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30396  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30397  *
30398  * @pre this method can be called in one of the following stages of the SCIP solving process:
30399  * - \ref SCIP_STAGE_INITSOLVE
30400  * - \ref SCIP_STAGE_SOLVING
30401  */
30403  SCIP* scip, /**< SCIP data structure */
30404  SCIP_ROW* row, /**< LP row */
30405  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
30406  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
30407  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
30408  SCIP_Real maxscale, /**< maximal allowed scalar */
30409  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
30410  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
30411  SCIP_Bool* success /**< stores whether returned value is valid */
30412  )
30413 {
30414  SCIP_CALL( checkStage(scip, "SCIPcalcRowIntegralScalar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30415 
30416  SCIP_CALL( SCIProwCalcIntegralScalar(row, scip->set, mindelta, maxdelta, maxdnom, maxscale,
30417  usecontvars, intscalar, success) );
30418 
30419  return SCIP_OKAY;
30420 }
30421 
30422 /** tries to scale row, s.t. all coefficients (of integer variables) become integral
30423  *
30424  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30425  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30426  *
30427  * @pre this method can be called in one of the following stages of the SCIP solving process:
30428  * - \ref SCIP_STAGE_INITSOLVE
30429  * - \ref SCIP_STAGE_SOLVING
30430  */
30432  SCIP* scip, /**< SCIP data structure */
30433  SCIP_ROW* row, /**< LP row */
30434  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
30435  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
30436  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
30437  SCIP_Real maxscale, /**< maximal value to scale row with */
30438  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
30439  SCIP_Bool* success /**< stores whether row could be made rational */
30440  )
30441 {
30442  SCIP_CALL( checkStage(scip, "SCIPmakeRowIntegral", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30443 
30444  SCIP_CALL( SCIProwMakeIntegral(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->stat, scip->lp, mindelta, maxdelta, maxdnom, maxscale,
30445  usecontvars, success) );
30446 
30447  return SCIP_OKAY;
30448 }
30449 
30450 /** marks a row to be not removable from the LP in the current node
30451  *
30452  * @pre this method can be called in the following stage of the SCIP solving process:
30453  * - \ref SCIP_STAGE_SOLVING
30454  */
30456  SCIP* scip, /**< SCIP data structure */
30457  SCIP_ROW* row /**< LP row */
30458  )
30459 {
30460  SCIP_CALL_ABORT( checkStage(scip, "SCIPmarkRowNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30461 
30462  SCIProwMarkNotRemovableLocal(row, scip->stat);
30463 }
30464 
30465 /** returns minimal absolute value of row vector's non-zero coefficients
30466  *
30467  * @return minimal absolute value of row vector's non-zero coefficients
30468  *
30469  * @pre this method can be called in one of the following stages of the SCIP solving process:
30470  * - \ref SCIP_STAGE_INITSOLVE
30471  * - \ref SCIP_STAGE_SOLVING
30472  */
30474  SCIP* scip, /**< SCIP data structure */
30475  SCIP_ROW* row /**< LP row */
30476  )
30477 {
30478  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30479 
30480  return SCIProwGetMinval(row, scip->set);
30481 }
30482 
30483 /** returns maximal absolute value of row vector's non-zero coefficients
30484  *
30485  * @return maximal absolute value of row vector's non-zero coefficients
30486  *
30487  * @pre this method can be called in one of the following stages of the SCIP solving process:
30488  * - \ref SCIP_STAGE_INITSOLVE
30489  * - \ref SCIP_STAGE_SOLVING
30490  */
30492  SCIP* scip, /**< SCIP data structure */
30493  SCIP_ROW* row /**< LP row */
30494  )
30495 {
30496  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30497 
30498  return SCIProwGetMaxval(row, scip->set);
30499 }
30500 
30501 /** returns the minimal activity of a row w.r.t. the column's bounds
30502  *
30503  * @return the minimal activity of a row w.r.t. the column's bounds
30504  *
30505  * @pre this method can be called in one of the following stages of the SCIP solving process:
30506  * - \ref SCIP_STAGE_SOLVING
30507  */
30509  SCIP* scip, /**< SCIP data structure */
30510  SCIP_ROW* row /**< LP row */
30511  )
30512 {
30513  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMinActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30514 
30515  return SCIProwGetMinActivity(row, scip->set, scip->stat);
30516 }
30517 
30518 /** returns the maximal activity of a row w.r.t. the column's bounds
30519  *
30520  * @return the maximal activity of a row w.r.t. the column's bounds
30521  *
30522  * @pre this method can be called in one of the following stages of the SCIP solving process:
30523  * - \ref SCIP_STAGE_SOLVING
30524  */
30526  SCIP* scip, /**< SCIP data structure */
30527  SCIP_ROW* row /**< LP row */
30528  )
30529 {
30530  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowMaxActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30531 
30532  return SCIProwGetMaxActivity(row, scip->set, scip->stat);
30533 }
30534 
30535 /** recalculates the activity of a row in the last LP solution
30536  *
30537  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30538  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30539  *
30540  * @pre this method can be called in one of the following stages of the SCIP solving process:
30541  * - \ref SCIP_STAGE_SOLVING
30542  */
30544  SCIP* scip, /**< SCIP data structure */
30545  SCIP_ROW* row /**< LP row */
30546  )
30547 {
30548  SCIP_CALL( checkStage(scip, "SCIPrecalcRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30549 
30550  SCIProwRecalcLPActivity(row, scip->stat);
30551 
30552  return SCIP_OKAY;
30553 }
30554 
30555 /** returns the activity of a row in the last LP solution
30556  *
30557  * @return activity of a row in the last LP solution
30558  *
30559  * @pre this method can be called in one of the following stages of the SCIP solving process:
30560  * - \ref SCIP_STAGE_SOLVING
30561  */
30563  SCIP* scip, /**< SCIP data structure */
30564  SCIP_ROW* row /**< LP row */
30565  )
30566 {
30567  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30568 
30569  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
30570 }
30571 
30572 /** returns the feasibility of a row in the last LP solution
30573  *
30574  * @return the feasibility of a row in the last LP solution: negative value means infeasibility
30575  *
30576  * @pre this method can be called in one of the following stages of the SCIP solving process:
30577  * - \ref SCIP_STAGE_SOLVING
30578  */
30580  SCIP* scip, /**< SCIP data structure */
30581  SCIP_ROW* row /**< LP row */
30582  )
30583 {
30584  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30585 
30586  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
30587 }
30588 
30589 /** recalculates the activity of a row for the current pseudo solution
30590  *
30591  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30592  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30593  *
30594  * @pre this method can be called in one of the following stages of the SCIP solving process:
30595  * - \ref SCIP_STAGE_SOLVING
30596  */
30598  SCIP* scip, /**< SCIP data structure */
30599  SCIP_ROW* row /**< LP row */
30600  )
30601 {
30602  SCIP_CALL( checkStage(scip, "SCIPrecalcRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30603 
30604  SCIProwRecalcPseudoActivity(row, scip->stat);
30605 
30606  return SCIP_OKAY;
30607 }
30608 
30609 /** returns the activity of a row for the current pseudo solution
30610  *
30611  * @return the activity of a row for the current pseudo solution
30612  *
30613  * @pre this method can be called in one of the following stages of the SCIP solving process:
30614  * - \ref SCIP_STAGE_SOLVING
30615  */
30617  SCIP* scip, /**< SCIP data structure */
30618  SCIP_ROW* row /**< LP row */
30619  )
30620 {
30621  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30622 
30623  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
30624 }
30625 
30626 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
30627  *
30628  * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
30629  *
30630  * @pre this method can be called in one of the following stages of the SCIP solving process:
30631  * - \ref SCIP_STAGE_SOLVING
30632  */
30634  SCIP* scip, /**< SCIP data structure */
30635  SCIP_ROW* row /**< LP row */
30636  )
30637 {
30638  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30639 
30640  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
30641 }
30642 
30643 /** recalculates the activity of a row in the last LP or pseudo solution
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  * @pre this method can be called in one of the following stages of the SCIP solving process:
30649  * - \ref SCIP_STAGE_SOLVING
30650  */
30652  SCIP* scip, /**< SCIP data structure */
30653  SCIP_ROW* row /**< LP row */
30654  )
30655 {
30656  SCIP_CALL( checkStage(scip, "SCIPrecalcRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30657 
30658  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
30659  SCIProwRecalcLPActivity(row, scip->stat);
30660  else
30661  SCIProwRecalcPseudoActivity(row, scip->stat);
30662 
30663  return SCIP_OKAY;
30664 }
30665 
30666 /** returns the activity of a row in the last LP or pseudo solution
30667  *
30668  * @return the activity of a row in the last LP or pseudo solution
30669  *
30670  * @pre this method can be called in one of the following stages of the SCIP solving process:
30671  * - \ref SCIP_STAGE_SOLVING
30672  */
30674  SCIP* scip, /**< SCIP data structure */
30675  SCIP_ROW* row /**< LP row */
30676  )
30677 {
30678  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30679 
30680  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
30681  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
30682  else
30683  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
30684 }
30685 
30686 /** returns the feasibility of a row in the last LP or pseudo solution
30687  *
30688  * @return the feasibility of a row in the last LP or pseudo solution
30689  *
30690  * @pre this method can be called in one of the following stages of the SCIP solving process:
30691  * - \ref SCIP_STAGE_SOLVING
30692  */
30694  SCIP* scip, /**< SCIP data structure */
30695  SCIP_ROW* row /**< LP row */
30696  )
30697 {
30698  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30699 
30700  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
30701  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
30702  else
30703  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
30704 }
30705 
30706 /** returns the activity of a row for the given primal solution
30707  *
30708  * @return the activitiy of a row for the given primal solution
30709  *
30710  * @pre this method can be called in one of the following stages of the SCIP solving process:
30711  * - \ref SCIP_STAGE_SOLVING
30712  */
30714  SCIP* scip, /**< SCIP data structure */
30715  SCIP_ROW* row, /**< LP row */
30716  SCIP_SOL* sol /**< primal CIP solution */
30717  )
30718 {
30719  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
30720 
30721  if( sol != NULL )
30722  return SCIProwGetSolActivity(row, scip->set, scip->stat, sol);
30723  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
30724  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
30725  else
30726  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
30727 }
30728 
30729 /** returns the feasibility of a row for the given primal solution
30730  *
30731  * @return the feasibility of a row for the given primal solution
30732  *
30733  * @pre this method can be called in one of the following stages of the SCIP solving process:
30734  * - \ref SCIP_STAGE_SOLVING
30735  */
30737  SCIP* scip, /**< SCIP data structure */
30738  SCIP_ROW* row, /**< LP row */
30739  SCIP_SOL* sol /**< primal CIP solution */
30740  )
30741 {
30742  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30743 
30744  if( sol != NULL )
30745  return SCIProwGetSolFeasibility(row, scip->set, scip->stat, sol);
30746  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
30747  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
30748  else
30749  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
30750 }
30751 
30752 /** output row to file stream via the message handler system
30753  *
30754  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
30755  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
30756  *
30757  * @pre this method can be called in one of the following stages of the SCIP solving process:
30758  * - \ref SCIP_STAGE_SOLVING
30759  * - \ref SCIP_STAGE_SOLVED
30760  * - \ref SCIP_STAGE_EXITSOLVE
30761  */
30763  SCIP* scip, /**< SCIP data structure */
30764  SCIP_ROW* row, /**< LP row */
30765  FILE* file /**< output file (or NULL for standard output) */
30766  )
30767 {
30768  assert(row != NULL);
30769 
30770  SCIP_CALL( checkStage(scip, "SCIPprintRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
30771 
30772  SCIProwPrint(row, scip->messagehdlr, file);
30773 
30774  return SCIP_OKAY;
30775 }
30776 
30777 
30778 /*
30779  * NLP methods
30780  */
30781 
30782 /** returns whether the NLP relaxation has been enabled
30783  *
30784  * If the NLP relaxation is enabled, then SCIP will construct the NLP relaxation when the solving process is about to begin.
30785  * To check whether an NLP is existing, use SCIPisNLPConstructed().
30786  *
30787  * @pre This method can be called if SCIP is in one of the following stages:
30788  * - \ref SCIP_STAGE_INITPRESOLVE
30789  * - \ref SCIP_STAGE_PRESOLVING
30790  * - \ref SCIP_STAGE_EXITPRESOLVE
30791  * - \ref SCIP_STAGE_PRESOLVED
30792  * - \ref SCIP_STAGE_INITSOLVE
30793  * - \ref SCIP_STAGE_SOLVING
30794  *
30795  * @see SCIPenableNLP
30796  */
30798  SCIP* scip /**< SCIP data structure */
30799  )
30800 {
30801  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPEnabled", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30802 
30803  return scip->transprob->nlpenabled;
30804 }
30805 
30806 /** marks that there are constraints that are representable by nonlinear rows
30807  *
30808  * This method should be called by a constraint handler if it has constraints that have a representation as nonlinear rows.
30809  *
30810  * The function should be called before the branch-and-bound process is initialized, e.g., when presolve is exiting.
30811  *
30812  * @pre This method can be called if SCIP is in one of the following stages:
30813  * - \ref SCIP_STAGE_INITPRESOLVE
30814  * - \ref SCIP_STAGE_PRESOLVING
30815  * - \ref SCIP_STAGE_EXITPRESOLVE
30816  * - \ref SCIP_STAGE_PRESOLVED
30817  * - \ref SCIP_STAGE_INITSOLVE
30818  * - \ref SCIP_STAGE_SOLVING
30819  */
30821  SCIP* scip /**< SCIP data structure */
30822  )
30823 {
30824  SCIP_CALL_ABORT( checkStage(scip, "SCIPenableNLP", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30825 
30826  scip->transprob->nlpenabled = TRUE;
30827 }
30828 
30829 /** returns, whether an NLP has been constructed
30830  *
30831  * @pre This method can be called if SCIP is in one of the following stages:
30832  * - \ref SCIP_STAGE_INITSOLVE
30833  * - \ref SCIP_STAGE_SOLVING
30834  */
30836  SCIP* scip /**< SCIP data structure */
30837  )
30838 {
30839  SCIP_CALL_ABORT( checkStage(scip, "SCIPisNLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30840 
30841  return (scip->nlp != NULL);
30842 }
30843 
30844 /** returns whether the NLP has a continuous variable in a nonlinear term
30845  *
30846  * @pre This method can be called if SCIP is in one of the following stages:
30847  * - \ref SCIP_STAGE_INITSOLVE
30848  * - \ref SCIP_STAGE_SOLVING
30849  */
30851  SCIP* scip /**< SCIP data structure */
30852  )
30853 {
30854  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPContinuousNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30855 
30856  if( scip->nlp == NULL )
30857  {
30858  SCIPerrorMessage("NLP has not been not constructed.\n");
30859  SCIPABORT();
30860  return FALSE; /*lint !e527*/
30861  }
30862 
30863  return SCIPnlpHasContinuousNonlinearity(scip->nlp);
30864 }
30865 
30866 /** gets current NLP variables along with the current number of NLP variables
30867  *
30868  * @pre This method can be called if SCIP is in one of the following stages:
30869  * - \ref SCIP_STAGE_INITSOLVE
30870  * - \ref SCIP_STAGE_SOLVING
30871  */
30873  SCIP* scip, /**< SCIP data structure */
30874  SCIP_VAR*** vars, /**< pointer to store the array of NLP variables, or NULL */
30875  int* nvars /**< pointer to store the number of NLP variables, or NULL */
30876  )
30877 {
30878  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30879 
30880  if( scip->nlp != NULL )
30881  {
30882  if( vars != NULL )
30883  *vars = SCIPnlpGetVars(scip->nlp);
30884  if( nvars != NULL )
30885  *nvars = SCIPnlpGetNVars(scip->nlp);
30886  }
30887  else
30888  {
30889  SCIPerrorMessage("NLP has not been constructed.\n");
30890  return SCIP_INVALIDCALL;
30891  }
30892 
30893  return SCIP_OKAY;
30894 }
30895 
30896 /** gets array with variables of the NLP
30897  *
30898  * @pre This method can be called if SCIP is in one of the following stages:
30899  * - \ref SCIP_STAGE_INITSOLVE
30900  * - \ref SCIP_STAGE_SOLVING
30901  */
30903  SCIP* scip /**< SCIP data structure */
30904  )
30905 {
30906  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30907 
30908  if( scip->nlp == NULL )
30909  {
30910  SCIPerrorMessage("NLP has not been constructed.\n");
30911  SCIPABORT();
30912  return NULL; /*lint !e527*/
30913  }
30914 
30915  return SCIPnlpGetVars(scip->nlp);
30916 }
30917 
30918 /** gets current number of variables in NLP
30919  *
30920  * @pre This method can be called if SCIP is in one of the following stages:
30921  * - \ref SCIP_STAGE_INITSOLVE
30922  * - \ref SCIP_STAGE_SOLVING
30923  */
30925  SCIP* scip /**< SCIP data structure */
30926  )
30927 {
30928  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30929 
30930  if( scip->nlp == NULL )
30931  {
30932  SCIPerrorMessage("NLP has not been constructed.\n");
30933  SCIPABORT();
30934  return 0; /*lint !e527*/
30935  }
30936 
30937  return SCIPnlpGetNVars(scip->nlp);
30938 }
30939 
30940 /** computes for each variables the number of NLP rows in which the variable appears in a nonlinear var
30941  *
30942  * @pre This method can be called if SCIP is in one of the following stages:
30943  * - \ref SCIP_STAGE_INITSOLVE
30944  * - \ref SCIP_STAGE_SOLVING
30945  */
30947  SCIP* scip, /**< SCIP data structure */
30948  int* nlcount /**< an array of length at least SCIPnlpGetNVars() to store nonlinearity counts of variables */
30949  )
30950 {
30951  SCIP_CALL( checkStage(scip, "SCIPgetNLPVarsNonlinearity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30952 
30953  if( scip->nlp == NULL )
30954  {
30955  SCIPerrorMessage("NLP has not been constructed.\n");
30956  return SCIP_INVALIDCALL;
30957  }
30958 
30959  SCIP_CALL( SCIPnlpGetVarsNonlinearity(scip->nlp, nlcount) );
30960 
30961  return SCIP_OKAY;
30962 }
30963 
30964 /** returns dual solution values associated with lower bounds of NLP variables
30965  *
30966  * @pre This method can be called if SCIP is in one of the following stages:
30967  * - \ref SCIP_STAGE_INITSOLVE
30968  * - \ref SCIP_STAGE_SOLVING
30969  */
30971  SCIP* scip /**< SCIP data structure */
30972  )
30973 {
30974  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsLbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30975 
30976  if( scip->nlp == NULL )
30977  {
30978  SCIPerrorMessage("NLP has not been constructed.\n");
30979  SCIPABORT();
30980  return NULL; /*lint !e527*/
30981  }
30982 
30983  return SCIPnlpGetVarsLbDualsol(scip->nlp);
30984 }
30985 
30986 /** returns dual solution values associated with upper bounds of NLP variables
30987  *
30988  * @pre This method can be called if SCIP is in one of the following stages:
30989  * - \ref SCIP_STAGE_INITSOLVE
30990  * - \ref SCIP_STAGE_SOLVING
30991  */
30993  SCIP* scip /**< SCIP data structure */
30994  )
30995 {
30996  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPVarsUbDualsol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
30997 
30998  if( scip->nlp == NULL )
30999  {
31000  SCIPerrorMessage("NLP has not been constructed.\n");
31001  SCIPABORT();
31002  return NULL; /*lint !e527*/
31003  }
31004 
31005  return SCIPnlpGetVarsUbDualsol(scip->nlp);
31006 }
31007 
31008 /** gets current NLP nonlinear rows along with the current number of NLP nonlinear rows
31009  *
31010  * @pre This method can be called if SCIP is in one of the following stages:
31011  * - \ref SCIP_STAGE_INITSOLVE
31012  * - \ref SCIP_STAGE_SOLVING
31013  */
31015  SCIP* scip, /**< SCIP data structure */
31016  SCIP_NLROW*** nlrows, /**< pointer to store the array of NLP nonlinear rows, or NULL */
31017  int* nnlrows /**< pointer to store the number of NLP nonlinear rows, or NULL */
31018  )
31019 {
31020  SCIP_CALL( checkStage(scip, "SCIPgetNLPNlRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31021 
31022  if( scip->nlp == NULL )
31023  {
31024  SCIPerrorMessage("NLP has not been constructed.\n");
31025  return SCIP_INVALIDCALL;
31026  }
31027 
31028  if( nlrows != NULL )
31029  *nlrows = SCIPnlpGetNlRows(scip->nlp);
31030  if( nnlrows != NULL )
31031  *nnlrows = SCIPnlpGetNNlRows(scip->nlp);
31032 
31033  return SCIP_OKAY;
31034 }
31035 
31036 /** gets array with nonlinear rows of the NLP
31037  *
31038  * @pre This method can be called if SCIP is in one of the following stages:
31039  * - \ref SCIP_STAGE_INITSOLVE
31040  * - \ref SCIP_STAGE_SOLVING
31041  */
31043  SCIP* scip /**< SCIP data structure */
31044  )
31045 {
31046  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31047 
31048  if( scip->nlp == NULL )
31049  {
31050  SCIPerrorMessage("NLP has not been constructed.\n");
31051  SCIPABORT();
31052  return NULL; /*lint !e527*/
31053  }
31054 
31055  return SCIPnlpGetNlRows(scip->nlp);
31056 }
31057 
31058 /** gets current number of nonlinear rows in NLP
31059  *
31060  * @pre This method can be called if SCIP is in one of the following stages:
31061  * - \ref SCIP_STAGE_INITSOLVE
31062  * - \ref SCIP_STAGE_SOLVING
31063  */
31065  SCIP* scip /**< SCIP data structure */
31066  )
31067 {
31068  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNLPNlRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31069 
31070  if( scip->nlp == NULL )
31071  {
31072  SCIPerrorMessage("NLP has not been constructed.\n");
31073  SCIPABORT();
31074  return 0; /*lint !e527*/
31075  }
31076 
31077  return SCIPnlpGetNNlRows(scip->nlp);
31078 }
31079 
31080 /** adds a nonlinear row to the NLP. This row is captured by the NLP.
31081  *
31082  * @pre This method can be called if SCIP is in one of the following stages:
31083  * - \ref SCIP_STAGE_INITSOLVE
31084  * - \ref SCIP_STAGE_SOLVING
31085  */
31087  SCIP* scip, /**< SCIP data structure */
31088  SCIP_NLROW* nlrow /**< nonlinear row to add to NLP */
31089  )
31090 {
31091  SCIP_CALL( checkStage(scip, "SCIPaddNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31092 
31093  if( scip->nlp == NULL )
31094  {
31095  SCIPerrorMessage("NLP has not been constructed.\n");
31096  return SCIP_INVALIDCALL;
31097  }
31098 
31099  SCIP_CALL( SCIPnlpAddNlRow(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, nlrow) );
31100 
31101  return SCIP_OKAY;
31102 }
31103 
31104 /** makes sure that the NLP of the current node is flushed
31105  *
31106  * @pre This method can be called if SCIP is in one of the following stages:
31107  * - \ref SCIP_STAGE_INITSOLVE
31108  * - \ref SCIP_STAGE_SOLVING
31109  */
31111  SCIP* scip /**< SCIP data structure */
31112  )
31113 {
31114  SCIP_CALL( checkStage(scip, "SCIPflushNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31115 
31116  if( scip->nlp == NULL )
31117  {
31118  SCIPerrorMessage("NLP has not been constructed.\n");
31119  return SCIP_INVALIDCALL;
31120  }
31121 
31122  SCIP_CALL( SCIPnlpFlush(scip->nlp, scip->mem->probmem, scip->set) );
31123 
31124  return SCIP_OKAY;
31125 }
31126 
31127 /** sets or clears initial primal guess for NLP solution (start point for NLP solver)
31128  *
31129  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31130  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31131  *
31132  * @pre This method can be called if SCIP is in one of the following stages:
31133  * - \ref SCIP_STAGE_INITSOLVE
31134  * - \ref SCIP_STAGE_SOLVING
31135  */
31137  SCIP* scip, /**< SCIP data structure */
31138  SCIP_Real* initialguess /**< values of initial guess (corresponding to variables from SCIPgetNLPVarsData), or NULL to use no start point */
31139  )
31140 {
31141  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuess", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31142 
31143  if( scip->nlp == NULL )
31144  {
31145  SCIPerrorMessage("NLP has not been constructed.\n");
31146  return SCIP_INVALIDCALL;
31147  }
31148 
31149  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), initialguess) );
31150 
31151  return SCIP_OKAY;
31152 }
31153 
31154 /** sets initial primal guess for NLP solution (start point for NLP solver)
31155  *
31156  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31157  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31158  *
31159  * @pre This method can be called if SCIP is in one of the following stages:
31160  * - \ref SCIP_STAGE_INITSOLVE
31161  * - \ref SCIP_STAGE_SOLVING
31162  */
31164  SCIP* scip, /**< SCIP data structure */
31165  SCIP_SOL* sol /**< solution which values should be taken as initial guess, or NULL for LP solution */
31166  )
31167 {
31168  SCIP_Real* vals;
31169 
31170  SCIP_CALL( checkStage(scip, "SCIPsetNLPInitialGuessSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31171 
31172  if( scip->nlp == NULL )
31173  {
31174  SCIPerrorMessage("NLP has not been constructed.\n");
31175  return SCIP_INVALIDCALL;
31176  }
31177 
31178  SCIP_CALL( SCIPallocBufferArray(scip, &vals, SCIPnlpGetNVars(scip->nlp)) );
31179  SCIP_CALL( SCIPgetSolVals(scip, sol, SCIPnlpGetNVars(scip->nlp), SCIPnlpGetVars(scip->nlp), vals) );
31180  SCIP_CALL( SCIPnlpSetInitialGuess(scip->nlp, SCIPblkmem(scip), vals) );
31181  SCIPfreeBufferArray(scip, &vals);
31182 
31183  return SCIP_OKAY;
31184 }
31185 
31186 /** solves the current NLP
31187  *
31188  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31189  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31190  *
31191  * @pre This method can be called if SCIP is in one of the following stages:
31192  * - \ref SCIP_STAGE_INITSOLVE
31193  * - \ref SCIP_STAGE_SOLVING
31194  */
31196  SCIP* scip /**< SCIP data structure */
31197  )
31198 {
31199  SCIP_CALL( checkStage(scip, "SCIPsolveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31200 
31201  if( scip->nlp == NULL )
31202  {
31203  SCIPerrorMessage("NLP has not been constructed.\n");
31204  return SCIP_INVALIDCALL;
31205  }
31206 
31207  SCIP_CALL( SCIPnlpSolve(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
31208 
31209  return SCIP_OKAY;
31210 }
31211 
31212 /** gets solution status of current NLP
31213  *
31214  * @pre This method can be called if SCIP is in one of the following stages:
31215  * - \ref SCIP_STAGE_INITSOLVE
31216  * - \ref SCIP_STAGE_SOLVING
31217  */
31219  SCIP* scip /**< SCIP data structure */
31220  )
31221 {
31222  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31223 
31224  if( scip->nlp == NULL )
31225  {
31226  SCIPerrorMessage("NLP has not been constructed.\n");
31227  SCIPABORT();
31228  return SCIP_NLPSOLSTAT_UNKNOWN; /*lint !e527*/
31229  }
31230 
31231  return SCIPnlpGetSolstat(scip->nlp);
31232 }
31233 
31234 /** gets termination status of last NLP solve
31235  *
31236  * @pre This method can be called if SCIP is in one of the following stages:
31237  * - \ref SCIP_STAGE_INITSOLVE
31238  * - \ref SCIP_STAGE_SOLVING
31239  */
31241  SCIP* scip /**< SCIP data structure */
31242  )
31243 {
31244  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPTermstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31245 
31246  if( scip->nlp == NULL )
31247  {
31248  SCIPerrorMessage("NLP has not been constructed.\n");
31249  SCIPABORT();
31250  return SCIP_NLPTERMSTAT_OTHER; /*lint !e527*/
31251  }
31252 
31253  return SCIPnlpGetTermstat(scip->nlp);
31254 }
31255 
31256 /** gives statistics (number of iterations, solving time, ...) of last NLP solve
31257  *
31258  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31259  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31260  *
31261  * @pre This method can be called if SCIP is in one of the following stages:
31262  * - \ref SCIP_STAGE_INITSOLVE
31263  * - \ref SCIP_STAGE_SOLVING
31264  */
31266  SCIP* scip, /**< SCIP data structure */
31267  SCIP_NLPSTATISTICS* statistics /**< pointer to store statistics */
31268  )
31269 {
31270  SCIP_CALL( checkStage(scip, "SCIPgetNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31271 
31272  if( scip->nlp == NULL )
31273  {
31274  SCIPerrorMessage("NLP has not been constructed.\n");
31275  return SCIP_INVALIDCALL;
31276  }
31277 
31278  SCIP_CALL( SCIPnlpGetStatistics(scip->nlp, statistics) );
31279 
31280  return SCIP_OKAY;
31281 }
31282 
31283 /** gets objective value of current NLP
31284  *
31285  * @pre This method can be called if SCIP is in one of the following stages:
31286  * - \ref SCIP_STAGE_INITSOLVE
31287  * - \ref SCIP_STAGE_SOLVING
31288  */
31290  SCIP* scip /**< SCIP data structure */
31291  )
31292 {
31293  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31294 
31295  if( scip->nlp != NULL )
31296  {
31297  return SCIPnlpGetObjval(scip->nlp);
31298  }
31299  else
31300  {
31301  SCIPerrorMessage("NLP has not been constructed.\n");
31302  return SCIP_INVALID;
31303  }
31304 }
31305 
31306 /** indicates whether a feasible solution for the current NLP is available
31307  * thus, returns whether the solution status <= feasible
31308  *
31309  * @pre This method can be called if SCIP is in one of the following stages:
31310  * - \ref SCIP_STAGE_INITSOLVE
31311  * - \ref SCIP_STAGE_SOLVING
31312  */
31314  SCIP* scip /**< SCIP data structure */
31315  )
31316 {
31317  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasNLPSolution", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31318 
31319  if( scip->nlp == NULL )
31320  {
31321  SCIPerrorMessage("NLP has not been constructed.\n");
31322  SCIPABORT();
31323  return FALSE; /*lint !e527*/
31324  }
31325 
31326  return SCIPnlpHasSolution(scip->nlp);
31327 }
31328 
31329 /** gets fractional variables of last NLP solution along with solution values and fractionalities
31330  *
31331  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31332  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
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  SCIP_VAR*** fracvars, /**< pointer to store the array of NLP fractional variables, or NULL */
31341  SCIP_Real** fracvarssol, /**< pointer to store the array of NLP fractional variables solution values, or NULL */
31342  SCIP_Real** fracvarsfrac, /**< pointer to store the array of NLP fractional variables fractionalities, or NULL */
31343  int* nfracvars, /**< pointer to store the number of NLP fractional variables , or NULL */
31344  int* npriofracvars /**< pointer to store the number of NLP fractional variables with maximal branching priority, or NULL */
31345  )
31346 {
31347  SCIP_CALL( checkStage(scip, "SCIPgetNLPFracVars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31348 
31349  if( scip->nlp == NULL )
31350  {
31351  SCIPerrorMessage("NLP has not been constructed.\n");
31352  return SCIP_INVALIDCALL;
31353  }
31354 
31355  SCIP_CALL( SCIPnlpGetFracVars(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, fracvars, fracvarssol, fracvarsfrac, nfracvars, npriofracvars) );
31356 
31357  return SCIP_OKAY;
31358 }
31359 
31360 /** gets integer parameter of NLP
31361  *
31362  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31363  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31364  *
31365  * @pre This method can be called if SCIP is in one of the following stages:
31366  * - \ref SCIP_STAGE_INITSOLVE
31367  * - \ref SCIP_STAGE_SOLVING
31368  */
31370  SCIP* scip, /**< SCIP data structure */
31371  SCIP_NLPPARAM type, /**< parameter number */
31372  int* ival /**< pointer to store the parameter value */
31373  )
31374 {
31375  SCIP_CALL( checkStage(scip, "SCIPgetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31376 
31377  if( scip->nlp == NULL )
31378  {
31379  SCIPerrorMessage("NLP has not been constructed.\n");
31380  return SCIP_INVALIDCALL;
31381  }
31382 
31383  SCIP_CALL( SCIPnlpGetIntPar(scip->nlp, type, ival) );
31384 
31385  return SCIP_OKAY;
31386 }
31387 
31388 /** sets integer parameter of NLP
31389  *
31390  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31391  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31392  *
31393  * @pre This method can be called if SCIP is in one of the following stages:
31394  * - \ref SCIP_STAGE_INITSOLVE
31395  * - \ref SCIP_STAGE_SOLVING
31396  */
31398  SCIP* scip, /**< SCIP data structure */
31399  SCIP_NLPPARAM type, /**< parameter number */
31400  int ival /**< parameter value */
31401  )
31402 {
31403  SCIP_CALL( checkStage(scip, "SCIPsetNLPIntPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31404 
31405  if( scip->nlp == NULL )
31406  {
31407  SCIPerrorMessage("NLP has not been constructed.\n");
31408  return SCIP_INVALIDCALL;
31409  }
31410 
31411  SCIP_CALL( SCIPnlpSetIntPar(scip->nlp, type, ival) );
31412 
31413  return SCIP_OKAY;
31414 }
31415 
31416 /** gets floating point parameter of NLP
31417  *
31418  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31419  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31420  *
31421  * @pre This method can be called if SCIP is in one of the following stages:
31422  * - \ref SCIP_STAGE_INITSOLVE
31423  * - \ref SCIP_STAGE_SOLVING
31424  */
31426  SCIP* scip, /**< SCIP data structure */
31427  SCIP_NLPPARAM type, /**< parameter number */
31428  SCIP_Real* dval /**< pointer to store the parameter value */
31429  )
31430 {
31431  SCIP_CALL( checkStage(scip, "SCIPgetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31432 
31433  if( scip->nlp == NULL )
31434  {
31435  SCIPerrorMessage("NLP has not been constructed.\n");
31436  return SCIP_INVALIDCALL;
31437  }
31438 
31439  SCIP_CALL( SCIPnlpGetRealPar(scip->nlp, type, dval) );
31440 
31441  return SCIP_OKAY;
31442 }
31443 
31444 /** sets floating point parameter of NLP
31445  *
31446  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31447  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31448  *
31449  * @pre This method can be called if SCIP is in one of the following stages:
31450  * - \ref SCIP_STAGE_INITSOLVE
31451  * - \ref SCIP_STAGE_SOLVING
31452  */
31454  SCIP* scip, /**< SCIP data structure */
31455  SCIP_NLPPARAM type, /**< parameter number */
31456  SCIP_Real dval /**< parameter value */
31457  )
31458 {
31459  SCIP_CALL( checkStage(scip, "SCIPsetNLPRealPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31460 
31461  if( scip->nlp == NULL )
31462  {
31463  SCIPerrorMessage("NLP has not been constructed.\n");
31464  return SCIP_INVALIDCALL;
31465  }
31466 
31467  SCIP_CALL( SCIPnlpSetRealPar(scip->nlp, type, dval) );
31468 
31469  return SCIP_OKAY;
31470 }
31471 
31472 /** gets string parameter of NLP
31473  *
31474  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31475  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31476  *
31477  * @pre This method can be called if SCIP is in one of the following stages:
31478  * - \ref SCIP_STAGE_INITSOLVE
31479  * - \ref SCIP_STAGE_SOLVING
31480  */
31482  SCIP* scip, /**< SCIP data structure */
31483  SCIP_NLPPARAM type, /**< parameter number */
31484  const char** sval /**< pointer to store the parameter value */
31485  )
31486 {
31487  SCIP_CALL( checkStage(scip, "SCIPgetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31488 
31489  if( scip->nlp == NULL )
31490  {
31491  SCIPerrorMessage("NLP has not been constructed.\n");
31492  return SCIP_INVALIDCALL;
31493  }
31494 
31495  SCIP_CALL( SCIPnlpGetStringPar(scip->nlp, type, sval) );
31496 
31497  return SCIP_OKAY;
31498 }
31499 
31500 /** sets string parameter of NLP
31501  *
31502  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31503  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31504  *
31505  * @pre This method can be called if SCIP is in one of the following stages:
31506  * - \ref SCIP_STAGE_INITSOLVE
31507  * - \ref SCIP_STAGE_SOLVING
31508  */
31510  SCIP* scip, /**< SCIP data structure */
31511  SCIP_NLPPARAM type, /**< parameter number */
31512  const char* sval /**< parameter value */
31513  )
31514 {
31515  SCIP_CALL( checkStage(scip, "SCIPsetNLPStringPar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31516 
31517  if( scip->nlp == NULL )
31518  {
31519  SCIPerrorMessage("NLP has not been constructed.\n");
31520  return SCIP_INVALIDCALL;
31521  }
31522 
31523  SCIP_CALL( SCIPnlpSetStringPar(scip->nlp, type, sval) );
31524 
31525  return SCIP_OKAY;
31526 }
31527 
31528 /** writes current NLP to a file
31529  *
31530  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31531  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31532  *
31533  * @pre This method can be called if SCIP is in one of the following stages:
31534  * - \ref SCIP_STAGE_INITSOLVE
31535  * - \ref SCIP_STAGE_SOLVING
31536  */
31538  SCIP* scip, /**< SCIP data structure */
31539  const char* filename /**< file name */
31540  )
31541 {
31542  SCIP_CALL( checkStage(scip, "SCIPwriteNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31543 
31544  if( scip->nlp == NULL )
31545  {
31546  SCIPerrorMessage("NLP has not been constructed.\n");
31547  return SCIP_INVALIDCALL;
31548  }
31549 
31550  SCIP_CALL( SCIPnlpWrite(scip->nlp, scip->set, scip->messagehdlr, filename) );
31551 
31552  return SCIP_OKAY;
31553 }
31554 
31555 /** gets the NLP interface and problem used by the SCIP NLP;
31556  * with the NLPI and its problem you can use all of the methods defined in nlpi/nlpi.h;
31557  *
31558  * @warning You have to make sure, that the full internal state of the NLPI does not change or is recovered completely
31559  * after the end of the method that uses the NLPI. In particular, if you manipulate the NLP or its solution
31560  * (e.g. by calling one of the SCIPnlpiAdd...() or the SCIPnlpiSolve() method), you have to check in advance
31561  * whether the NLP is currently solved. If this is the case, you have to make sure, the internal solution
31562  * status is recovered completely at the end of your method. Additionally you have to resolve the NLP with
31563  * SCIPnlpiSolve() in order to reinstall the internal solution status.
31564  *
31565  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
31566  *
31567  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31568  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31569  *
31570  * @pre This method can be called if SCIP is in one of the following stages:
31571  * - \ref SCIP_STAGE_INITSOLVE
31572  * - \ref SCIP_STAGE_SOLVING
31573  */
31575  SCIP* scip, /**< SCIP data structure */
31576  SCIP_NLPI** nlpi, /**< pointer to store the NLP solver interface */
31577  SCIP_NLPIPROBLEM** nlpiproblem /**< pointer to store the NLP solver interface problem */
31578  )
31579 {
31580  assert(nlpi != NULL);
31581  assert(nlpiproblem != NULL);
31582 
31583  SCIP_CALL( checkStage(scip, "SCIPgetNLPI", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31584 
31585  if( scip->nlp == NULL )
31586  {
31587  SCIPerrorMessage("NLP has not been constructed.\n");
31588  return SCIP_INVALIDCALL;
31589  }
31590 
31591  *nlpi = SCIPnlpGetNLPI(scip->nlp);
31592  *nlpiproblem = SCIPnlpGetNLPIProblem(scip->nlp);
31593 
31594  return SCIP_OKAY;
31595 }
31596 
31597 
31598 /*
31599  * NLP diving methods
31600  */
31601 
31602 /**@name NLP Diving Methods */
31603 /**@{ */
31604 
31605 /** initiates NLP diving making methods SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), SCIPchgVarsBoundsDiveNLP(), and SCIPsolveDiveNLP() available
31606  *
31607  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31608  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31609  *
31610  * @pre This method can be called if SCIP is in one of the following stages:
31611  * - \ref SCIP_STAGE_INITSOLVE
31612  * - \ref SCIP_STAGE_SOLVING
31613  */
31615  SCIP* scip /**< SCIP data structure */
31616  )
31617 {
31618  SCIP_CALL( checkStage(scip, "SCIPstartDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31619 
31620  if( scip->nlp == NULL )
31621  {
31622  SCIPerrorMessage("NLP has not been constructed.\n");
31623  return SCIP_INVALIDCALL;
31624  }
31625 
31626  SCIP_CALL( SCIPnlpStartDive(scip->nlp, SCIPblkmem(scip), scip->set) );
31627 
31628  return SCIP_OKAY;
31629 }
31630 
31631 /** ends NLP diving
31632  *
31633  * Resets changes made by SCIPchgVarObjDiveNLP(), SCIPchgVarBoundsDiveNLP(), and SCIPchgVarsBoundsDiveNLP().
31634  *
31635  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31636  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31637  *
31638  * @pre This method can be called if SCIP is in one of the following stages:
31639  * - \ref SCIP_STAGE_INITSOLVE
31640  * - \ref SCIP_STAGE_SOLVING
31641  */
31643  SCIP* scip /**< SCIP data structure */
31644  )
31645 {
31646  SCIP_CALL( checkStage(scip, "SCIPendDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31647 
31648  if( scip->nlp == NULL )
31649  {
31650  SCIPerrorMessage("NLP has not been constructed.\n");
31651  return SCIP_INVALIDCALL;
31652  }
31653 
31654  SCIP_CALL( SCIPnlpEndDive(scip->nlp, SCIPblkmem(scip), scip->set) );
31655 
31656  return SCIP_OKAY;
31657 }
31658 
31659 /** changes linear objective coefficient of a variable in diving NLP
31660  *
31661  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31662  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31663  *
31664  * @pre This method can be called if SCIP is in one of the following stages:
31665  * - \ref SCIP_STAGE_INITSOLVE
31666  * - \ref SCIP_STAGE_SOLVING
31667  */
31669  SCIP* scip, /**< SCIP data structure */
31670  SCIP_VAR* var, /**< variable which coefficient to change */
31671  SCIP_Real coef /**< new value for coefficient */
31672  )
31673 {
31674  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31675 
31676  assert( var->scip == scip );
31677 
31678  if( scip->nlp == NULL )
31679  {
31680  SCIPerrorMessage("NLP has not been constructed.\n");
31681  return SCIP_INVALIDCALL;
31682  }
31683 
31684  SCIP_CALL( SCIPnlpChgVarObjDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->stat, var, coef) );
31685 
31686  return SCIP_OKAY;
31687 }
31688 
31689 /** changes bounds of a variable in diving NLP
31690  *
31691  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31692  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31693  *
31694  * @pre This method can be called if SCIP is in one of the following stages:
31695  * - \ref SCIP_STAGE_INITSOLVE
31696  * - \ref SCIP_STAGE_SOLVING
31697  */
31699  SCIP* scip, /**< SCIP data structure */
31700  SCIP_VAR* var, /**< variable which bounds to change */
31701  SCIP_Real lb, /**< new lower bound */
31702  SCIP_Real ub /**< new upper bound */
31703  )
31704 {
31705  SCIP_CALL( checkStage(scip, "SCIPchgVarBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31706 
31707  assert( var->scip == scip );
31708 
31709  if( scip->nlp == NULL )
31710  {
31711  SCIPerrorMessage("NLP has not been constructed.\n");
31712  return SCIP_INVALIDCALL;
31713  }
31714 
31715  SCIP_CALL( SCIPnlpChgVarBoundsDive(scip->nlp, var, lb, ub) );
31716 
31717  return SCIP_OKAY;
31718 }
31719 
31720 /** changes bounds of a set of variables in diving NLP
31721  *
31722  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31723  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31724  *
31725  * @pre This method can be called if SCIP is in one of the following stages:
31726  * - \ref SCIP_STAGE_INITSOLVE
31727  * - \ref SCIP_STAGE_SOLVING
31728  */
31730  SCIP* scip, /**< SCIP data structure */
31731  int nvars, /**< number of variables which bounds to changes */
31732  SCIP_VAR** vars, /**< variables which bounds to change */
31733  SCIP_Real* lbs, /**< new lower bounds */
31734  SCIP_Real* ubs /**< new upper bounds */
31735  )
31736 {
31737  SCIP_CALL( checkStage(scip, "SCIPchgVarsBoundsDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31738 
31739  if( scip->nlp == NULL )
31740  {
31741  SCIPerrorMessage("NLP has not been constructed.\n");
31742  return SCIP_INVALIDCALL;
31743  }
31744 
31745  SCIP_CALL( SCIPnlpChgVarsBoundsDive(scip->nlp, scip->set, nvars, vars, lbs, ubs) );
31746 
31747  return SCIP_OKAY;
31748 }
31749 
31750 /** solves diving NLP
31751  *
31752  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31753  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31754  *
31755  * @pre This method can be called if SCIP is in one of the following stages:
31756  * - \ref SCIP_STAGE_INITSOLVE
31757  * - \ref SCIP_STAGE_SOLVING
31758  */
31760  SCIP* scip /**< SCIP data structure */
31761  )
31762 {
31763  SCIP_CALL( checkStage(scip, "SCIPsolveDiveNLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31764 
31765  if( scip->nlp == NULL )
31766  {
31767  SCIPerrorMessage("NLP has not been constructed.\n");
31768  return SCIP_INVALIDCALL;
31769  }
31770 
31771  SCIP_CALL( SCIPnlpSolveDive(scip->nlp, SCIPblkmem(scip), scip->set, scip->messagehdlr, scip->stat) );
31772 
31773  return SCIP_OKAY;
31774 }
31775 
31776 /**@} */
31777 
31778 
31779 /*
31780  * NLP nonlinear row methods
31781  */
31782 
31783 /** creates and captures an NLP row
31784  *
31785  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31786  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31787  *
31788  * @pre This method can be called if SCIP is in one of the following stages:
31789  * - \ref SCIP_STAGE_PRESOLVED
31790  * - \ref SCIP_STAGE_INITSOLVE
31791  * - \ref SCIP_STAGE_SOLVING
31792  */
31794  SCIP* scip, /**< SCIP data structure */
31795  SCIP_NLROW** nlrow, /**< buffer to store pointer to nonlinear row */
31796  const char* name, /**< name of nonlinear row */
31797  SCIP_Real constant, /**< constant */
31798  int nlinvars, /**< number of linear variables */
31799  SCIP_VAR** linvars, /**< linear variables, or NULL if nlinvars == 0 */
31800  SCIP_Real* lincoefs, /**< linear coefficients, or NULL if nlinvars == 0 */
31801  int nquadvars, /**< number variables in quadratic terms */
31802  SCIP_VAR** quadvars, /**< variables in quadratic terms, or NULL if nquadvars == 0 */
31803  int nquadelems, /**< number of elements in quadratic term */
31804  SCIP_QUADELEM* quadelems, /**< elements (i.e., monomials) in quadratic term, or NULL if nquadelems == 0 */
31805  SCIP_EXPRTREE* expression, /**< nonlinear expression, or NULL */
31806  SCIP_Real lhs, /**< left hand side */
31807  SCIP_Real rhs, /**< right hand side */
31808  SCIP_EXPRCURV curvature /**< curvature of the nonlinear row */
31809  )
31810 {
31811  SCIP_CALL( checkStage(scip, "SCIPcreateNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31812 
31813  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
31814  name, constant, nlinvars, linvars, lincoefs, nquadvars, quadvars, nquadelems, quadelems, expression, lhs, rhs, curvature) );
31815 
31816  return SCIP_OKAY;
31817 }
31818 
31819 /** creates and captures an NLP nonlinear row without any coefficients
31820  *
31821  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31822  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31823  *
31824  * @pre This method can be called if SCIP is in one of the following stages:
31825  * - \ref SCIP_STAGE_PRESOLVED
31826  * - \ref SCIP_STAGE_INITSOLVE
31827  * - \ref SCIP_STAGE_SOLVING
31828  */
31830  SCIP* scip, /**< SCIP data structure */
31831  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
31832  const char* name, /**< name of nonlinear row */
31833  SCIP_Real lhs, /**< left hand side */
31834  SCIP_Real rhs /**< right hand side */
31835  )
31836 {
31837  SCIP_CALL( checkStage(scip, "SCIPcreateEmptyNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31838 
31839  SCIP_CALL( SCIPnlrowCreate(nlrow, scip->mem->probmem, scip->set,
31840  name, 0.0, 0, NULL, NULL, 0, NULL, 0, NULL, NULL, lhs, rhs, SCIP_EXPRCURV_UNKNOWN) );
31841 
31842  return SCIP_OKAY;
31843 }
31844 
31845 /** creates and captures an NLP row from a linear row
31846  *
31847  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31848  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31849  *
31850  * @pre This method can be called if SCIP is in one of the following stages:
31851  * - \ref SCIP_STAGE_PRESOLVED
31852  * - \ref SCIP_STAGE_INITSOLVE
31853  * - \ref SCIP_STAGE_SOLVING
31854  */
31856  SCIP* scip, /**< SCIP data structure */
31857  SCIP_NLROW** nlrow, /**< pointer to nonlinear row */
31858  SCIP_ROW* row /**< the linear row to copy */
31859  )
31860 {
31861  SCIP_CALL( checkStage(scip, "SCIPcreateNlRowFromRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31862 
31863  SCIP_CALL( SCIPnlrowCreateFromRow(nlrow, scip->mem->probmem, scip->set, row) );
31864 
31865  return SCIP_OKAY;
31866 }
31867 
31868 /** increases usage counter of NLP nonlinear row
31869  *
31870  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31871  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31872  *
31873  * @pre This method can be called if SCIP is in one of the following stages:
31874  * - \ref SCIP_STAGE_PRESOLVED
31875  * - \ref SCIP_STAGE_INITSOLVE
31876  * - \ref SCIP_STAGE_SOLVING
31877  */
31879  SCIP* scip, /**< SCIP data structure */
31880  SCIP_NLROW* nlrow /**< nonlinear row to capture */
31881  )
31882 {
31883  SCIP_CALL( checkStage(scip, "SCIPcaptureNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31884 
31885  SCIPnlrowCapture(nlrow);
31886 
31887  return SCIP_OKAY;
31888 }
31889 
31890 /** decreases usage counter of NLP nonlinear row, and frees memory if necessary
31891  *
31892  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31893  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31894  *
31895  * @pre This method can be called if SCIP is in one of the following stages:
31896  * - \ref SCIP_STAGE_PRESOLVED
31897  * - \ref SCIP_STAGE_INITSOLVE
31898  * - \ref SCIP_STAGE_SOLVING
31899  * - \ref SCIP_STAGE_EXITSOLVE
31900  */
31902  SCIP* scip, /**< SCIP data structure */
31903  SCIP_NLROW** nlrow /**< pointer to nonlinear row */
31904  )
31905 {
31906  SCIP_CALL( checkStage(scip, "SCIPreleaseNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
31907 
31908  SCIP_CALL( SCIPnlrowRelease(nlrow, scip->mem->probmem, scip->set) );
31909 
31910  return SCIP_OKAY;
31911 }
31912 
31913 /** changes left hand side of NLP nonlinear row
31914  *
31915  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31916  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31917  *
31918  * @pre This method can be called if SCIP is in one of the following stages:
31919  * - \ref SCIP_STAGE_PRESOLVED
31920  * - \ref SCIP_STAGE_INITSOLVE
31921  * - \ref SCIP_STAGE_SOLVING
31922  */
31924  SCIP* scip, /**< SCIP data structure */
31925  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
31926  SCIP_Real lhs /**< new left hand side */
31927  )
31928 {
31929  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31930 
31931  SCIP_CALL( SCIPnlrowChgLhs(nlrow, scip->set, scip->stat, scip->nlp, lhs) );
31932 
31933  return SCIP_OKAY;
31934 }
31935 
31936 /** changes right hand side of NLP nonlinear row
31937  *
31938  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31939  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31940  *
31941  * @pre This method can be called if SCIP is in one of the following stages:
31942  * - \ref SCIP_STAGE_PRESOLVED
31943  * - \ref SCIP_STAGE_INITSOLVE
31944  * - \ref SCIP_STAGE_SOLVING
31945  */
31947  SCIP* scip, /**< SCIP data structure */
31948  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
31949  SCIP_Real rhs /**< new right hand side */
31950  )
31951 {
31952  SCIP_CALL( checkStage(scip, "SCIPchgNlRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31953 
31954  SCIP_CALL( SCIPnlrowChgRhs(nlrow, scip->set, scip->stat, scip->nlp, rhs) );
31955 
31956  return SCIP_OKAY;
31957 }
31958 
31959 /** changes constant of NLP nonlinear row
31960  *
31961  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31962  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31963  *
31964  * @pre This method can be called if SCIP is in one of the following stages:
31965  * - \ref SCIP_STAGE_PRESOLVED
31966  * - \ref SCIP_STAGE_INITSOLVE
31967  * - \ref SCIP_STAGE_SOLVING
31968  */
31970  SCIP* scip, /**< SCIP data structure */
31971  SCIP_NLROW* nlrow, /**< NLP row */
31972  SCIP_Real constant /**< new value for constant */
31973  )
31974 {
31975  SCIP_CALL( checkStage(scip, "SCIPchgNlRowConstant", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
31976 
31977  SCIP_CALL( SCIPnlrowChgConstant(nlrow, scip->set, scip->stat, scip->nlp, constant) );
31978 
31979  return SCIP_OKAY;
31980 }
31981 
31982 /** adds variable with a linear coefficient to the nonlinear row
31983  *
31984  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
31985  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
31986  *
31987  * @pre This method can be called if SCIP is in one of the following stages:
31988  * - \ref SCIP_STAGE_PRESOLVED
31989  * - \ref SCIP_STAGE_INITSOLVE
31990  * - \ref SCIP_STAGE_SOLVING
31991  */
31993  SCIP* scip, /**< SCIP data structure */
31994  SCIP_NLROW* nlrow, /**< NLP row */
31995  SCIP_VAR* var, /**< problem variable */
31996  SCIP_Real val /**< value of coefficient in linear part of row */
31997  )
31998 {
31999  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32000 
32001  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, val) );
32002 
32003  return SCIP_OKAY;
32004 }
32005 
32006 /** adds variables with linear coefficients to the row
32007  *
32008  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32009  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32010  *
32011  * @pre This method can be called if SCIP is in one of the following stages:
32012  * - \ref SCIP_STAGE_PRESOLVED
32013  * - \ref SCIP_STAGE_INITSOLVE
32014  * - \ref SCIP_STAGE_SOLVING
32015  */
32017  SCIP* scip, /**< SCIP data structure */
32018  SCIP_NLROW* nlrow, /**< NLP row */
32019  int nvars, /**< number of variables to add to the row */
32020  SCIP_VAR** vars, /**< problem variables to add */
32021  SCIP_Real* vals /**< values of coefficients in linear part of row */
32022  )
32023 {
32024  int v;
32025 
32026  assert(nvars == 0 || vars != NULL);
32027  assert(nvars == 0 || vals != NULL);
32028 
32029  SCIP_CALL( checkStage(scip, "SCIPaddLinearCoefsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32030 
32031  /* add the variables to the row */
32032  for( v = 0; v < nvars; ++v )
32033  {
32034  SCIP_CALL( SCIPnlrowAddLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, vars[v], vals[v]) );
32035  }
32036 
32037  return SCIP_OKAY;
32038 }
32039 
32040 /** changes linear coefficient of a variables in a row
32041  *
32042  * Setting the coefficient to 0.0 means that it is removed from the row
32043  * the variable does not need to exists before.
32044  *
32045  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32046  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32047  *
32048  * @pre This method can be called if SCIP is in one of the following stages:
32049  * - \ref SCIP_STAGE_PRESOLVED
32050  * - \ref SCIP_STAGE_INITSOLVE
32051  * - \ref SCIP_STAGE_SOLVING
32052  */
32054  SCIP* scip, /**< SCIP data structure */
32055  SCIP_NLROW* nlrow, /**< NLP row */
32056  SCIP_VAR* var, /**< variable */
32057  SCIP_Real coef /**< new value of coefficient */
32058  )
32059 {
32060  assert(var != NULL);
32061 
32062  SCIP_CALL( checkStage(scip, "SCIPchgNlRowLinearCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32063 
32064  SCIP_CALL( SCIPnlrowChgLinearCoef(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, var, coef) );
32065 
32066  return SCIP_OKAY;
32067 }
32068 
32069 /** adds quadratic variable to the nonlinear row
32070  *
32071  * After adding a quadratic variable, it can be used to add quadratic elements.
32072  *
32073  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32074  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32075  *
32076  * @pre This method can be called if SCIP is in one of the following stages:
32077  * - \ref SCIP_STAGE_PRESOLVED
32078  * - \ref SCIP_STAGE_INITSOLVE
32079  * - \ref SCIP_STAGE_SOLVING
32080  */
32082  SCIP* scip, /**< SCIP data structure */
32083  SCIP_NLROW* nlrow, /**< NLP row */
32084  SCIP_VAR* var /**< problem variable */
32085  )
32086 {
32087  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32088 
32089  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, var) );
32090 
32091  return SCIP_OKAY;
32092 }
32093 
32094 /** adds quadratic variables to the nonlinear row
32095  *
32096  * After adding quadratic variables, they can be used to add quadratic elements.
32097  *
32098  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32099  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32100  *
32101  * @pre This method can be called if SCIP is in one of the following stages:
32102  * - \ref SCIP_STAGE_PRESOLVED
32103  * - \ref SCIP_STAGE_INITSOLVE
32104  * - \ref SCIP_STAGE_SOLVING
32105  */
32107  SCIP* scip, /**< SCIP data structure */
32108  SCIP_NLROW* nlrow, /**< NLP row */
32109  int nvars, /**< number of problem variables */
32110  SCIP_VAR** vars /**< problem variables */
32111  )
32112 {
32113  int v;
32114 
32115  assert(nvars == 0 || vars != NULL);
32116 
32117  SCIP_CALL( checkStage(scip, "SCIPaddQuadVarsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32118 
32119  SCIP_CALL( SCIPnlrowEnsureQuadVarsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadVars(nlrow) + nvars) );
32120  for( v = 0; v < nvars; ++v )
32121  {
32122  SCIP_CALL( SCIPnlrowAddQuadVar(nlrow, scip->mem->probmem, scip->set, vars[v]) );
32123  }
32124 
32125  return SCIP_OKAY;
32126 }
32127 
32128 /** add a quadratic element to the nonlinear row
32129  *
32130  * Variable indices of the quadratic element need to be relative to quadratic variables array of row.
32131  *
32132  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32133  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32134  *
32135  * @pre This method can be called if SCIP is in one of the following stages:
32136  * - \ref SCIP_STAGE_PRESOLVED
32137  * - \ref SCIP_STAGE_INITSOLVE
32138  * - \ref SCIP_STAGE_SOLVING
32139  */
32141  SCIP* scip, /**< SCIP data structure */
32142  SCIP_NLROW* nlrow, /**< NLP row */
32143  SCIP_QUADELEM quadelem /**< quadratic element */
32144  )
32145 {
32146  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32147 
32148  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelem) );
32149 
32150  /* invalidate curvature */
32151  if( quadelem.coef != 0.0 )
32153 
32154  return SCIP_OKAY;
32155 }
32156 
32157 /** adds quadratic elements to the nonlinear row
32158  *
32159  * Variable indices of the quadratic elements need to be relative to quadratic variables array of row.
32160  *
32161  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32162  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32163  *
32164  * @pre This method can be called if SCIP is in one of the following stages:
32165  * - \ref SCIP_STAGE_PRESOLVED
32166  * - \ref SCIP_STAGE_INITSOLVE
32167  * - \ref SCIP_STAGE_SOLVING
32168  */
32170  SCIP* scip, /**< SCIP data structure */
32171  SCIP_NLROW* nlrow, /**< NLP row */
32172  int nquadelems, /**< number of quadratic elements */
32173  SCIP_QUADELEM* quadelems /**< quadratic elements */
32174  )
32175 {
32176  int v;
32177 
32178  assert(nquadelems == 0 || quadelems != NULL);
32179 
32180  SCIP_CALL( checkStage(scip, "SCIPaddQuadElementsToNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32181 
32182  SCIP_CALL( SCIPnlrowEnsureQuadElementsSize(nlrow, scip->mem->probmem, scip->set, SCIPnlrowGetNQuadElems(nlrow) + nquadelems) );
32183  for( v = 0; v < nquadelems; ++v )
32184  {
32185  SCIP_CALL( SCIPnlrowAddQuadElement(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelems[v]) );
32186  }
32187 
32188  /* invalidate curvature */
32190 
32191  return SCIP_OKAY;
32192 }
32193 
32194 /** changes coefficient in quadratic part of a row
32195  *
32196  * Setting the coefficient in the quadelement to 0.0 means that it is removed from the row
32197  * the element does not need to exists before.
32198  *
32199  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32200  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32201  *
32202  * @pre This method can be called if SCIP is in one of the following stages:
32203  * - \ref SCIP_STAGE_PRESOLVED
32204  * - \ref SCIP_STAGE_INITSOLVE
32205  * - \ref SCIP_STAGE_SOLVING
32206  */
32208  SCIP* scip, /**< SCIP data structure */
32209  SCIP_NLROW* nlrow, /**< NLP row */
32210  SCIP_QUADELEM quadelement /**< new quadratic element, or update for existing one */
32211  )
32212 {
32213  SCIP_CALL( checkStage(scip, "SCIPchgNlRowQuadElement", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32214 
32215  SCIP_CALL( SCIPnlrowChgQuadElem(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, quadelement) );
32216 
32217  return SCIP_OKAY;
32218 }
32219 
32220 /** sets or deletes expression tree in the nonlinear row
32221  *
32222  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32223  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32224  *
32225  * @pre This method can be called if SCIP is in one of the following stages:
32226  * - \ref SCIP_STAGE_PRESOLVED
32227  * - \ref SCIP_STAGE_INITSOLVE
32228  * - \ref SCIP_STAGE_SOLVING
32229  */
32231  SCIP* scip, /**< SCIP data structure */
32232  SCIP_NLROW* nlrow, /**< NLP row */
32233  SCIP_EXPRTREE* exprtree /**< expression tree, or NULL */
32234  )
32235 {
32236  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtree", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32237 
32238  SCIP_CALL( SCIPnlrowChgExprtree(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, exprtree) );
32239 
32240  /* invalidate curvature */
32242 
32243  return SCIP_OKAY;
32244 }
32245 
32246 /** sets a parameter of expression tree in the nonlinear row
32247  *
32248  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32249  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32250  *
32251  * @pre This method can be called if SCIP is in one of the following stages:
32252  * - \ref SCIP_STAGE_PRESOLVED
32253  * - \ref SCIP_STAGE_INITSOLVE
32254  * - \ref SCIP_STAGE_SOLVING
32255  */
32257  SCIP* scip, /**< SCIP data structure */
32258  SCIP_NLROW* nlrow, /**< NLP row */
32259  int paramidx, /**< index of parameter in expression tree */
32260  SCIP_Real paramval /**< new value of parameter in expression tree */
32261  )
32262 {
32263  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParam", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32264 
32265  SCIP_CALL( SCIPnlrowChgExprtreeParam(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramidx, paramval) );
32266 
32267  return SCIP_OKAY;
32268 }
32269 
32270 /** sets parameters of expression tree in the nonlinear row
32271  *
32272  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32273  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32274  *
32275  * @pre This method can be called if SCIP is in one of the following stages:
32276  * - \ref SCIP_STAGE_PRESOLVED
32277  * - \ref SCIP_STAGE_INITSOLVE
32278  * - \ref SCIP_STAGE_SOLVING
32279  */
32281  SCIP* scip, /**< SCIP data structure */
32282  SCIP_NLROW* nlrow, /**< NLP row */
32283  SCIP_Real* paramvals /**< new values of parameter in expression tree */
32284  )
32285 {
32286  SCIP_CALL( checkStage(scip, "SCIPsetNlRowExprtreeParams", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32287 
32288  SCIP_CALL( SCIPnlrowChgExprtreeParams(nlrow, scip->mem->probmem, scip->set, scip->stat, scip->nlp, paramvals) );
32289 
32290  return SCIP_OKAY;
32291 }
32292 
32293 /** recalculates the activity of a nonlinear row in the last NLP solution
32294  *
32295  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32296  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32297  *
32298  * @pre This method can be called if SCIP is in one of the following stages:
32299  * - \ref SCIP_STAGE_PRESOLVED
32300  * - \ref SCIP_STAGE_INITSOLVE
32301  * - \ref SCIP_STAGE_SOLVING
32302  */
32304  SCIP* scip, /**< SCIP data structure */
32305  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32306  )
32307 {
32308  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32309 
32310  if( scip->nlp == NULL )
32311  {
32312  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
32313  return SCIP_INVALIDCALL;
32314  }
32315 
32316  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
32317 
32318  return SCIP_OKAY;
32319 }
32320 
32321 /** returns the activity of a nonlinear row in the last NLP solution
32322  *
32323  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32324  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32325  *
32326  * @pre This method can be called if SCIP is in one of the following stages:
32327  * - \ref SCIP_STAGE_INITSOLVE
32328  * - \ref SCIP_STAGE_SOLVING
32329  */
32331  SCIP* scip, /**< SCIP data structure */
32332  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32333  SCIP_Real* activity /**< pointer to store activity value */
32334  )
32335 {
32336  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32337 
32338  if( scip->nlp == NULL )
32339  {
32340  SCIPerrorMessage("do not have NLP for computing NLP activity\n");
32341  return SCIP_INVALIDCALL;
32342  }
32343 
32344  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32345 
32346  return SCIP_OKAY;
32347 }
32348 
32349 /** gives the feasibility of a nonlinear row in the last NLP solution: negative value means infeasibility
32350  *
32351  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32352  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32353  *
32354  * @pre This method can be called if SCIP is in one of the following stages:
32355  * - \ref SCIP_STAGE_INITSOLVE
32356  * - \ref SCIP_STAGE_SOLVING
32357  */
32359  SCIP* scip, /**< SCIP data structure */
32360  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32361  SCIP_Real* feasibility /**< pointer to store feasibility value */
32362  )
32363 {
32364  SCIP_CALL( checkStage(scip, "SCIPgetNlRowNLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32365 
32366  if( scip->nlp == NULL )
32367  {
32368  SCIPerrorMessage("do not have NLP for computing NLP feasibility\n");
32369  return SCIP_INVALIDCALL;
32370  }
32371 
32372  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32373 
32374  return SCIP_OKAY;
32375 }
32376 
32377 /** recalculates the activity of a nonlinear row for the current pseudo solution
32378  *
32379  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32380  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32381  *
32382  * @pre This method can be called if SCIP is in one of the following stages:
32383  * - \ref SCIP_STAGE_INITSOLVE
32384  * - \ref SCIP_STAGE_SOLVING
32385  */
32387  SCIP* scip, /**< SCIP data structure */
32388  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32389  )
32390 {
32391  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32392 
32393  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
32394 
32395  return SCIP_OKAY;
32396 }
32397 
32398 /** gives the activity of a nonlinear row for the current pseudo solution
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_INITSOLVE
32405  * - \ref SCIP_STAGE_SOLVING
32406  */
32408  SCIP* scip, /**< SCIP data structure */
32409  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32410  SCIP_Real* pseudoactivity /**< pointer to store pseudo activity value */
32411  )
32412 {
32413  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32414 
32415  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, pseudoactivity) );
32416 
32417  return SCIP_OKAY;
32418 }
32419 
32420 /** gives the feasibility of a nonlinear row for the current pseudo solution: negative value means infeasibility
32421  *
32422  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32423  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32424  *
32425  * @pre This method can be called if SCIP is in one of the following stages:
32426  * - \ref SCIP_STAGE_INITSOLVE
32427  * - \ref SCIP_STAGE_SOLVING
32428  */
32430  SCIP* scip, /**< SCIP data structure */
32431  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32432  SCIP_Real* pseudofeasibility /**< pointer to store pseudo feasibility value */
32433  )
32434 {
32435  SCIP_CALL( checkStage(scip, "SCIPgetNlRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32436 
32437  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, pseudofeasibility) );
32438 
32439  return SCIP_OKAY;
32440 }
32441 
32442 /** recalculates the activity of a nonlinear row in the last NLP or pseudo solution
32443  *
32444  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32445  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32446  *
32447  * @pre This method can be called if SCIP is in one of the following stages:
32448  * - \ref SCIP_STAGE_INITSOLVE
32449  * - \ref SCIP_STAGE_SOLVING
32450  */
32452  SCIP* scip, /**< SCIP data structure */
32453  SCIP_NLROW* nlrow /**< NLP nonlinear row */
32454  )
32455 {
32456  SCIP_CALL( checkStage(scip, "SCIPrecalcNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32457 
32458  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32459  {
32460  SCIP_CALL( SCIPnlrowRecalcNLPActivity(nlrow, scip->set, scip->stat, scip->nlp) );
32461  }
32462  else
32463  {
32464  SCIP_CALL( SCIPnlrowRecalcPseudoActivity(nlrow, scip->set, scip->stat) );
32465  }
32466 
32467  return SCIP_OKAY;
32468 }
32469 
32470 /** gives the activity of a nonlinear row in the last NLP or pseudo solution
32471  *
32472  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32473  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32474  *
32475  * @pre This method can be called if SCIP is in one of the following stages:
32476  * - \ref SCIP_STAGE_INITSOLVE
32477  * - \ref SCIP_STAGE_SOLVING
32478  */
32480  SCIP* scip, /**< SCIP data structure */
32481  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32482  SCIP_Real* activity /**< pointer to store activity value */
32483  )
32484 {
32485  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32486 
32487  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32488  {
32489  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32490  }
32491  else
32492  {
32493  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
32494  }
32495 
32496  return SCIP_OKAY;
32497 }
32498 
32499 /** gives the feasibility of a nonlinear row in the last NLP or pseudo solution
32500  *
32501  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32502  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32503  *
32504  * @pre This method can be called if SCIP is in one of the following stages:
32505  * - \ref SCIP_STAGE_INITSOLVE
32506  * - \ref SCIP_STAGE_SOLVING
32507  */
32509  SCIP* scip, /**< SCIP data structure */
32510  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32511  SCIP_Real* feasibility /**< pointer to store feasibility value */
32512  )
32513 {
32514  SCIP_CALL( checkStage(scip, "SCIPgetNlRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32515 
32516  if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32517  {
32518  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32519  }
32520  else
32521  {
32522  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
32523  }
32524 
32525  return SCIP_OKAY;
32526 }
32527 
32528 /** gives the activity of a nonlinear row for the given primal solution or NLP solution or pseudo solution
32529  *
32530  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32531  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32532  *
32533  * @pre This method can be called if SCIP is in one of the following stages:
32534  * - \ref SCIP_STAGE_INITSOLVE
32535  * - \ref SCIP_STAGE_SOLVING
32536  */
32538  SCIP* scip, /**< SCIP data structure */
32539  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32540  SCIP_SOL* sol, /**< primal CIP solution, or NULL for NLP solution of pseudo solution */
32541  SCIP_Real* activity /**< pointer to store activity value */
32542  )
32543 {
32544  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32545 
32546  if( sol != NULL )
32547  {
32548  SCIP_CALL( SCIPnlrowGetSolActivity(nlrow, scip->set, scip->stat, sol, activity) );
32549  }
32550  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32551  {
32552  SCIP_CALL( SCIPnlrowGetNLPActivity(nlrow, scip->set, scip->stat, scip->nlp, activity) );
32553  }
32554  else
32555  {
32556  SCIP_CALL( SCIPnlrowGetPseudoActivity(nlrow, scip->set, scip->stat, activity) );
32557  }
32558 
32559  return SCIP_OKAY;
32560 }
32561 
32562 /** gives the feasibility of a nonlinear row for the given primal solution
32563  *
32564  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32565  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32566  *
32567  * @pre This method can be called if SCIP is in one of the following stages:
32568  * - \ref SCIP_STAGE_INITSOLVE
32569  * - \ref SCIP_STAGE_SOLVING
32570  */
32572  SCIP* scip, /**< SCIP data structure */
32573  SCIP_NLROW* nlrow, /**< NLP nonlinear row */
32574  SCIP_SOL* sol, /**< primal CIP solution */
32575  SCIP_Real* feasibility /**< pointer to store feasibility value */
32576  )
32577 {
32578  SCIP_CALL( checkStage(scip, "SCIPgetNlRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32579 
32580  if( sol != NULL )
32581  {
32582  SCIP_CALL( SCIPnlrowGetSolFeasibility(nlrow, scip->set, scip->stat, sol, feasibility) );
32583  }
32584  else if( scip->nlp != NULL && SCIPnlpHasCurrentNodeNLP(scip->nlp) && SCIPnlpHasSolution(scip->nlp) )
32585  {
32586  SCIP_CALL( SCIPnlrowGetNLPFeasibility(nlrow, scip->set, scip->stat, scip->nlp, feasibility) );
32587  }
32588  else
32589  {
32590  SCIP_CALL( SCIPnlrowGetPseudoFeasibility(nlrow, scip->set, scip->stat, feasibility) );
32591  }
32592 
32593  return SCIP_OKAY;
32594 }
32595 
32596 /** gives the minimal and maximal activity of a nonlinear row w.r.t. the variable's bounds
32597  *
32598  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32599  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32600  *
32601  * @pre This method can be called if SCIP is in one of the following stages:
32602  * - \ref SCIP_STAGE_PRESOLVED
32603  * - \ref SCIP_STAGE_INITSOLVE
32604  * - \ref SCIP_STAGE_SOLVING
32605  */
32607  SCIP* scip, /**< SCIP data structure */
32608  SCIP_NLROW* nlrow, /**< NLP row */
32609  SCIP_Real* minactivity, /**< buffer to store minimal activity, or NULL */
32610  SCIP_Real* maxactivity /**< buffer to store maximal activity, or NULL */
32611  )
32612 {
32613  SCIP_CALL( checkStage(scip, "SCIPgetNlRowActivityBounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32614 
32615  SCIP_CALL( SCIPnlrowGetActivityBounds(nlrow, scip->set, scip->stat, minactivity, maxactivity) );
32616 
32617  return SCIP_OKAY;
32618 }
32619 
32620 /** output nonlinear row to file stream
32621  *
32622  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32623  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32624  *
32625  * @pre This method can be called if SCIP is in one of the following stages:
32626  * - \ref SCIP_STAGE_PRESOLVED
32627  * - \ref SCIP_STAGE_INITSOLVE
32628  * - \ref SCIP_STAGE_SOLVING
32629  */
32631  SCIP* scip, /**< SCIP data structure */
32632  SCIP_NLROW* nlrow, /**< NLP row */
32633  FILE* file /**< output file (or NULL for standard output) */
32634  )
32635 {
32636  assert(nlrow != NULL);
32637 
32638  SCIP_CALL( checkStage(scip, "SCIPprintNlRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
32639 
32640  SCIP_CALL( SCIPnlrowPrint(nlrow, scip->messagehdlr, file) );
32641 
32642  return SCIP_OKAY;
32643 }
32644 
32645 /**@name Expression tree methods */
32646 /**@{ */
32647 
32648 /** translate from one value of infinity to another
32649  *
32650  * if val is >= infty1, then give infty2, else give val
32651  */
32652 #define infty2infty(infty1, infty2, val) (val >= infty1 ? infty2 : val)
32653 
32654 /** replaces array of variables in expression tree by corresponding transformed variables
32655  *
32656  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32657  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32658  *
32659  * @pre This method can be called if @p scip is in one of the following stages:
32660  * - \ref SCIP_STAGE_TRANSFORMING
32661  * - \ref SCIP_STAGE_TRANSFORMED
32662  * - \ref SCIP_STAGE_INITPRESOLVE
32663  * - \ref SCIP_STAGE_PRESOLVING
32664  * - \ref SCIP_STAGE_EXITPRESOLVE
32665  * - \ref SCIP_STAGE_PRESOLVED
32666  * - \ref SCIP_STAGE_INITSOLVE
32667  * - \ref SCIP_STAGE_SOLVING
32668  * - \ref SCIP_STAGE_SOLVED
32669  * - \ref SCIP_STAGE_EXITSOLVE
32670  * - \ref SCIP_STAGE_FREETRANS
32671  *
32672  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32673  */
32675  SCIP* scip, /**< SCIP data structure */
32676  SCIP_EXPRTREE* tree /**< expression tree */
32677  )
32678 {
32679  assert(scip != NULL);
32680  assert(tree != NULL);
32681 
32682  SCIP_CALL( checkStage(scip, "SCIPgetExprtreeTransformedVars", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
32683 
32684  if( SCIPexprtreeGetNVars(tree) == 0 )
32685  return SCIP_OKAY;
32686 
32688 
32689  return SCIP_OKAY;
32690 }
32691 
32692 /** evaluates an expression tree for a primal solution or LP solution
32693  *
32694  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32695  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32696  *
32697  * @pre This method can be called if @p scip is in one of the following stages:
32698  * - \ref SCIP_STAGE_PROBLEM
32699  * - \ref SCIP_STAGE_TRANSFORMING
32700  * - \ref SCIP_STAGE_TRANSFORMED
32701  * - \ref SCIP_STAGE_INITPRESOLVE
32702  * - \ref SCIP_STAGE_PRESOLVING
32703  * - \ref SCIP_STAGE_EXITPRESOLVE
32704  * - \ref SCIP_STAGE_PRESOLVED
32705  * - \ref SCIP_STAGE_INITSOLVE
32706  * - \ref SCIP_STAGE_SOLVING
32707  * - \ref SCIP_STAGE_SOLVED
32708  * - \ref SCIP_STAGE_EXITSOLVE
32709  * - \ref SCIP_STAGE_FREETRANS
32710  *
32711  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32712  */
32714  SCIP* scip, /**< SCIP data structure */
32715  SCIP_EXPRTREE* tree, /**< expression tree */
32716  SCIP_SOL* sol, /**< a solution, or NULL for current LP solution */
32717  SCIP_Real* val /**< buffer to store value */
32718  )
32719 {
32720  SCIP_Real* varvals;
32721  int nvars;
32722 
32723  assert(scip != NULL);
32724  assert(tree != NULL);
32725  assert(val != NULL);
32726 
32727  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
32728 
32729  nvars = SCIPexprtreeGetNVars(tree);
32730 
32731  if( nvars == 0 )
32732  {
32733  SCIP_CALL( SCIPexprtreeEval(tree, NULL, val) );
32734  return SCIP_OKAY;
32735  }
32736 
32737  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
32738  SCIP_CALL( SCIPgetSolVals(scip, sol, nvars, SCIPexprtreeGetVars(tree), varvals) );
32739 
32740  SCIP_CALL( SCIPexprtreeEval(tree, varvals, val) );
32741 
32742  SCIPfreeBufferArray(scip, &varvals);
32743 
32744  return SCIP_OKAY;
32745 }
32746 
32747 /** evaluates an expression tree w.r.t. current global bounds
32748  *
32749  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
32750  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
32751  *
32752  * @pre This method can be called if @p scip is in one of the following stages:
32753  * - \ref SCIP_STAGE_PROBLEM
32754  * - \ref SCIP_STAGE_TRANSFORMING
32755  * - \ref SCIP_STAGE_TRANSFORMED
32756  * - \ref SCIP_STAGE_INITPRESOLVE
32757  * - \ref SCIP_STAGE_PRESOLVING
32758  * - \ref SCIP_STAGE_EXITPRESOLVE
32759  * - \ref SCIP_STAGE_PRESOLVED
32760  * - \ref SCIP_STAGE_INITSOLVE
32761  * - \ref SCIP_STAGE_SOLVING
32762  * - \ref SCIP_STAGE_SOLVED
32763  * - \ref SCIP_STAGE_EXITSOLVE
32764  * - \ref SCIP_STAGE_FREETRANS
32765  *
32766  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32767  */
32769  SCIP* scip, /**< SCIP data structure */
32770  SCIP_EXPRTREE* tree, /**< expression tree */
32771  SCIP_Real infinity, /**< value to use for infinity */
32772  SCIP_INTERVAL* val /**< buffer to store result */
32773  )
32774 {
32775  SCIP_INTERVAL* varvals;
32776  SCIP_VAR** vars;
32777  int nvars;
32778  int i;
32779 
32780  assert(scip != NULL);
32781  assert(tree != NULL);
32782  assert(val != NULL);
32783 
32784  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeGlobalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
32785 
32786  nvars = SCIPexprtreeGetNVars(tree);
32787 
32788  if( nvars == 0 )
32789  {
32790  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
32791  return SCIP_OKAY;
32792  }
32793 
32794  vars = SCIPexprtreeGetVars(tree);
32795  assert(vars != NULL);
32796 
32797  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
32798  for( i = 0; i < nvars; ++i )
32799  {
32800  SCIPintervalSetBounds(&varvals[i],
32801  -infty2infty(SCIPinfinity(scip), infinity, -SCIPvarGetLbGlobal(vars[i])), /*lint !e666*/
32802  infty2infty(SCIPinfinity(scip), infinity, SCIPvarGetUbGlobal(vars[i]))); /*lint !e666*/
32803  }
32804 
32805  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
32806 
32807  SCIPfreeBufferArray(scip, &varvals);
32808 
32809  return SCIP_OKAY;
32810 }
32811 
32812 /** evaluates an expression tree w.r.t. current local bounds
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 @p scip is in one of the following stages:
32818  * - \ref SCIP_STAGE_PROBLEM
32819  * - \ref SCIP_STAGE_TRANSFORMING
32820  * - \ref SCIP_STAGE_TRANSFORMED
32821  * - \ref SCIP_STAGE_INITPRESOLVE
32822  * - \ref SCIP_STAGE_PRESOLVING
32823  * - \ref SCIP_STAGE_EXITPRESOLVE
32824  * - \ref SCIP_STAGE_PRESOLVED
32825  * - \ref SCIP_STAGE_INITSOLVE
32826  * - \ref SCIP_STAGE_SOLVING
32827  * - \ref SCIP_STAGE_SOLVED
32828  * - \ref SCIP_STAGE_EXITSOLVE
32829  * - \ref SCIP_STAGE_FREETRANS
32830  *
32831  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
32832  */
32834  SCIP* scip, /**< SCIP data structure */
32835  SCIP_EXPRTREE* tree, /**< expression tree */
32836  SCIP_Real infinity, /**< value to use for infinity */
32837  SCIP_INTERVAL* val /**< buffer to store result */
32838  )
32839 {
32840  SCIP_INTERVAL* varvals;
32841  SCIP_VAR** vars;
32842  int nvars;
32843  int i;
32844 
32845  assert(scip != NULL);
32846  assert(tree != NULL);
32847  assert(val != NULL);
32848 
32849  SCIP_CALL( checkStage(scip, "SCIPevalExprtreeLocalBounds", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
32850 
32851  nvars = SCIPexprtreeGetNVars(tree);
32852 
32853  if( nvars == 0 )
32854  {
32855  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, NULL, val) );
32856  return SCIP_OKAY;
32857  }
32858 
32859  vars = SCIPexprtreeGetVars(tree);
32860  assert(vars != NULL);
32861 
32862  SCIP_CALL( SCIPallocBufferArray(scip, &varvals, nvars) );
32863  for( i = 0; i < nvars; ++i )
32864  {
32865  /* due to numerics, the lower bound on a variable in SCIP can be slightly higher than the upper bound
32866  * in this case, we take the most conservative way and switch the bounds
32867  * further, we translate SCIP's value for infinity to the users value for infinity
32868  */
32869  SCIPintervalSetBounds(&varvals[i],
32870  -infty2infty(SCIPinfinity(scip), infinity, -MIN(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i]))), /*lint !e666*/
32871  infty2infty(SCIPinfinity(scip), infinity, MAX(SCIPvarGetLbLocal(vars[i]), SCIPvarGetUbLocal(vars[i])))); /*lint !e666*/
32872  }
32873 
32874  SCIP_CALL( SCIPexprtreeEvalInt(tree, infinity, varvals, val) );
32875 
32876  SCIPfreeBufferArray(scip, &varvals);
32877 
32878  return SCIP_OKAY;
32879 }
32880 
32881 #undef infty2infty
32882 
32883 /**@} */
32884 
32885 /*
32886  * nonlinear methods
32887  */
32888 
32889 /**@name Nonlinear Methods */
32890 /**@{ */
32891 
32892 /** computes coefficients of linearization of a square term in a reference point */
32894  SCIP* scip, /**< SCIP data structure */
32895  SCIP_Real sqrcoef, /**< coefficient of square term */
32896  SCIP_Real refpoint, /**< point where to linearize */
32897  SCIP_Bool isint, /**< whether corresponding variable is a discrete variable, and thus linearization could be moved */
32898  SCIP_Real* lincoef, /**< buffer to add coefficient of linearization */
32899  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
32900  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
32901  )
32902 {
32903  assert(scip != NULL);
32904  assert(lincoef != NULL);
32905  assert(linconstant != NULL);
32906  assert(success != NULL);
32907 
32908  if( sqrcoef == 0.0 )
32909  return;
32910 
32911  if( SCIPisInfinity(scip, REALABS(refpoint)) )
32912  {
32913  *success = FALSE;
32914  return;
32915  }
32916 
32917  if( !isint || SCIPisIntegral(scip, refpoint) )
32918  {
32919  SCIP_Real tmp;
32920 
32921  /* sqrcoef * x^2 -> tangent in refpoint = sqrcoef * 2 * refpoint * (x - refpoint) */
32922 
32923  tmp = sqrcoef * refpoint;
32924 
32925  if( SCIPisInfinity(scip, 2.0 * REALABS(tmp)) )
32926  {
32927  *success = FALSE;
32928  return;
32929  }
32930 
32931  *lincoef += 2.0 * tmp;
32932  tmp *= refpoint;
32933  *linconstant -= tmp;
32934  }
32935  else
32936  {
32937  /* sqrcoef * x^2 -> secant between f=floor(refpoint) and f+1 = sqrcoef * (f^2 + ((f+1)^2 - f^2) * (x-f))
32938  * = sqrcoef * (-f*(f+1) + (2*f+1)*x)
32939  */
32940  SCIP_Real f;
32941  SCIP_Real coef;
32942  SCIP_Real constant;
32943 
32944  f = SCIPfloor(scip, refpoint);
32945 
32946  coef = sqrcoef * (2.0 * f + 1.0);
32947  constant = -sqrcoef * f * (f + 1.0);
32948 
32949  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
32950  {
32951  *success = FALSE;
32952  return;
32953  }
32954 
32955  *lincoef += coef;
32956  *linconstant += constant;
32957  }
32958 }
32959 
32960 /** computes coefficients of secant of a square term */
32962  SCIP* scip, /**< SCIP data structure */
32963  SCIP_Real sqrcoef, /**< coefficient of square term */
32964  SCIP_Real lb, /**< lower bound on variable */
32965  SCIP_Real ub, /**< upper bound on variable */
32966  SCIP_Real refpoint, /**< point for which to compute value of linearization */
32967  SCIP_Real* lincoef, /**< buffer to add coefficient of secant */
32968  SCIP_Real* linconstant, /**< buffer to add constant of secant */
32969  SCIP_Bool* success /**< buffer to set to FALSE if secant has failed due to large numbers or unboundedness */
32970  )
32971 {
32972  SCIP_Real coef;
32973  SCIP_Real constant;
32974 
32975  assert(scip != NULL);
32976  assert(!SCIPisInfinity(scip, lb));
32977  assert(!SCIPisInfinity(scip, -ub));
32978  assert(SCIPisLE(scip, lb, ub));
32979  assert(SCIPisLE(scip, lb, refpoint));
32980  assert(SCIPisGE(scip, ub, refpoint));
32981  assert(lincoef != NULL);
32982  assert(linconstant != NULL);
32983  assert(success != NULL);
32984 
32985  if( sqrcoef == 0.0 )
32986  return;
32987 
32988  if( SCIPisInfinity(scip, -lb) || SCIPisInfinity(scip, ub) )
32989  {
32990  /* unboundedness */
32991  *success = FALSE;
32992  return;
32993  }
32994 
32995  /* sqrcoef * x^2 -> sqrcoef * (lb * lb + (ub*ub - lb*lb)/(ub-lb) * (x-lb)) = sqrcoef * (lb*lb + (ub+lb)*(x-lb))
32996  * = sqrcoef * ((lb+ub)*x - lb*ub)
32997  */
32998  coef = sqrcoef * (lb + ub);
32999  constant = -sqrcoef * lb * ub;
33000  if( SCIPisInfinity(scip, REALABS(coef)) || SCIPisInfinity(scip, REALABS(constant)) )
33001  {
33002  *success = FALSE;
33003  return;
33004  }
33005 
33006  *lincoef += coef;
33007  *linconstant += constant;
33008 }
33009 
33010 /** computes coefficients of linearization of a bilinear term in a reference point */
33012  SCIP* scip, /**< SCIP data structure */
33013  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33014  SCIP_Real refpointx, /**< point where to linearize first variable */
33015  SCIP_Real refpointy, /**< point where to linearize second variable */
33016  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
33017  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
33018  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33019  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33020  )
33021 {
33022  SCIP_Real constant;
33023 
33024  assert(scip != NULL);
33025  assert(lincoefx != NULL);
33026  assert(lincoefy != NULL);
33027  assert(linconstant != NULL);
33028  assert(success != NULL);
33029 
33030  if( bilincoef == 0.0 )
33031  return;
33032 
33033  if( SCIPisInfinity(scip, REALABS(refpointx)) || SCIPisInfinity(scip, REALABS(refpointy)) )
33034  {
33035  *success = FALSE;
33036  return;
33037  }
33038 
33039  /* bilincoef * x * y -> bilincoef * (refpointx * refpointy + refpointy * (x - refpointx) + refpointx * (y - refpointy))
33040  * = -bilincoef * refpointx * refpointy + bilincoef * refpointy * x + bilincoef * refpointx * y
33041  */
33042 
33043  constant = -bilincoef * refpointx * refpointy;
33044 
33045  if( SCIPisInfinity(scip, REALABS(bilincoef * refpointx)) || SCIPisInfinity(scip, REALABS(bilincoef * refpointy))
33046  || SCIPisInfinity(scip, REALABS(constant)) )
33047  {
33048  *success = FALSE;
33049  return;
33050  }
33051 
33052  *lincoefx += bilincoef * refpointy;
33053  *lincoefy += bilincoef * refpointx;
33054  *linconstant += constant;
33055 }
33056 
33057 /** computes coefficients of McCormick under- or overestimation of a bilinear term */
33059  SCIP* scip, /**< SCIP data structure */
33060  SCIP_Real bilincoef, /**< coefficient of bilinear term */
33061  SCIP_Real lbx, /**< lower bound on first variable */
33062  SCIP_Real ubx, /**< upper bound on first variable */
33063  SCIP_Real refpointx, /**< reference point for first variable */
33064  SCIP_Real lby, /**< lower bound on second variable */
33065  SCIP_Real uby, /**< upper bound on second variable */
33066  SCIP_Real refpointy, /**< reference point for second variable */
33067  SCIP_Bool overestimate, /**< whether to compute an overestimator instead of an underestimator */
33068  SCIP_Real* lincoefx, /**< buffer to add coefficient of first variable in linearization */
33069  SCIP_Real* lincoefy, /**< buffer to add coefficient of second variable in linearization */
33070  SCIP_Real* linconstant, /**< buffer to add constant of linearization */
33071  SCIP_Bool* success /**< buffer to set to FALSE if linearization has failed due to large numbers */
33072  )
33073 {
33074  SCIP_Real constant;
33075  SCIP_Real coefx;
33076  SCIP_Real coefy;
33077 
33078  assert(scip != NULL);
33079  assert(!SCIPisInfinity(scip, lbx));
33080  assert(!SCIPisInfinity(scip, -ubx));
33081  assert(!SCIPisInfinity(scip, lby));
33082  assert(!SCIPisInfinity(scip, -uby));
33083  assert(SCIPisLE(scip, lbx, ubx));
33084  assert(SCIPisLE(scip, lby, uby));
33085  assert(SCIPisLE(scip, lbx, refpointx));
33086  assert(SCIPisGE(scip, ubx, refpointx));
33087  assert(SCIPisLE(scip, lby, refpointy));
33088  assert(SCIPisGE(scip, uby, refpointy));
33089  assert(lincoefx != NULL);
33090  assert(lincoefy != NULL);
33091  assert(linconstant != NULL);
33092  assert(success != NULL);
33093 
33094  if( bilincoef == 0.0 )
33095  return;
33096 
33097  if( overestimate )
33098  bilincoef = -bilincoef;
33099 
33100  if( SCIPisRelEQ(scip, lbx, ubx) && SCIPisRelEQ(scip, lby, uby) )
33101  {
33102  /* both x and y are mostly fixed */
33103  SCIP_Real cand1;
33104  SCIP_Real cand2;
33105  SCIP_Real cand3;
33106  SCIP_Real cand4;
33107 
33108  coefx = 0.0;
33109  coefy = 0.0;
33110 
33111  /* estimate x * y by constant */
33112  cand1 = lbx * lby;
33113  cand2 = lbx * uby;
33114  cand3 = ubx * lby;
33115  cand4 = ubx * uby;
33116 
33117  /* take most conservative value for underestimator */
33118  if( bilincoef < 0.0 )
33119  constant = bilincoef * MAX( MAX(cand1, cand2), MAX(cand3, cand4) );
33120  else
33121  constant = bilincoef * MIN( MIN(cand1, cand2), MIN(cand3, cand4) );
33122  }
33123  else if( bilincoef > 0.0 )
33124  {
33125  /* either x or y is not fixed and coef > 0.0 */
33126  if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, -lby) &&
33127  (SCIPisInfinity(scip, ubx) || SCIPisInfinity(scip, uby)
33128  || (uby - refpointy) * (ubx - refpointx) >= (refpointy - lby) * (refpointx - lbx)) )
33129  {
33130  if( SCIPisRelEQ(scip, lbx, ubx) )
33131  {
33132  /* x*y = lbx * y + (x-lbx) * y >= lbx * y + (x-lbx) * lby >= lbx * y + min{(ubx-lbx) * lby, 0 * lby} */
33133  coefx = 0.0;
33134  coefy = bilincoef * lbx;
33135  constant = bilincoef * (lby < 0.0 ? (ubx-lbx) * lby : 0.0);
33136  }
33137  else if( SCIPisRelEQ(scip, lby, uby) )
33138  {
33139  /* x*y = lby * x + (y-lby) * x >= lby * x + (y-lby) * lbx >= lby * x + min{(uby-lby) * lbx, 0 * lbx} */
33140  coefx = bilincoef * lby;
33141  coefy = 0.0;
33142  constant = bilincoef * (lbx < 0.0 ? (uby-lby) * lbx : 0.0);
33143  }
33144  else
33145  {
33146  coefx = bilincoef * lby;
33147  coefy = bilincoef * lbx;
33148  constant = -bilincoef * lbx * lby;
33149  }
33150  }
33151  else if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, uby) )
33152  {
33153  if( SCIPisRelEQ(scip, lbx, ubx) )
33154  {
33155  /* x*y = ubx * y + (x-ubx) * y >= ubx * y + (x-ubx) * uby >= ubx * y + min{(lbx-ubx) * uby, 0 * uby} */
33156  coefx = 0.0;
33157  coefy = bilincoef * ubx;
33158  constant = bilincoef * (uby > 0.0 ? (lbx-ubx) * uby : 0.0);
33159  }
33160  else if( SCIPisRelEQ(scip, lby, uby) )
33161  {
33162  /* x*y = uby * x + (y-uby) * x >= uby * x + (y-uby) * ubx >= uby * x + min{(lby-uby) * ubx, 0 * ubx} */
33163  coefx = bilincoef * uby;
33164  coefy = 0.0;
33165  constant = bilincoef * (ubx > 0.0 ? (lby-uby) * ubx : 0.0);
33166  }
33167  else
33168  {
33169  coefx = bilincoef * uby;
33170  coefy = bilincoef * ubx;
33171  constant = -bilincoef * ubx * uby;
33172  }
33173  }
33174  else
33175  {
33176  *success = FALSE;
33177  return;
33178  }
33179  }
33180  else
33181  {
33182  /* either x or y is not fixed and coef < 0.0 */
33183  if( !SCIPisInfinity(scip, ubx) && !SCIPisInfinity(scip, -lby) &&
33184  (SCIPisInfinity(scip, -lbx) || SCIPisInfinity(scip, uby)
33185  || (ubx - lbx) * (refpointy - lby) <= (uby - lby) * (refpointx - lbx)) )
33186  {
33187  if( SCIPisRelEQ(scip, lbx, ubx) )
33188  {
33189  /* x*y = ubx * y + (x-ubx) * y <= ubx * y + (x-ubx) * lby <= ubx * y + max{(lbx-ubx) * lby, 0 * lby} */
33190  coefx = 0.0;
33191  coefy = bilincoef * ubx;
33192  constant = bilincoef * (lby < 0.0 ? (lbx - ubx) * lby : 0.0);
33193  }
33194  else if( SCIPisRelEQ(scip, lby, uby) )
33195  {
33196  /* x*y = lby * x + (y-lby) * x <= lby * x + (y-lby) * ubx <= lby * x + max{(uby-lby) * ubx, 0 * ubx} */
33197  coefx = bilincoef * lby;
33198  coefy = 0.0;
33199  constant = bilincoef * (ubx > 0.0 ? (uby - lby) * ubx : 0.0);
33200  }
33201  else
33202  {
33203  coefx = bilincoef * lby;
33204  coefy = bilincoef * ubx;
33205  constant = -bilincoef * ubx * lby;
33206  }
33207  }
33208  else if( !SCIPisInfinity(scip, -lbx) && !SCIPisInfinity(scip, uby) )
33209  {
33210  if( SCIPisRelEQ(scip, lbx, ubx) )
33211  {
33212  /* x*y = lbx * y + (x-lbx) * y <= lbx * y + (x-lbx) * uby <= lbx * y + max{(ubx-lbx) * uby, 0 * uby} */
33213  coefx = 0.0;
33214  coefy = bilincoef * lbx;
33215  constant = bilincoef * (uby > 0.0 ? (ubx-lbx) * uby : 0.0);
33216  }
33217  else if( SCIPisRelEQ(scip, lby, uby) )
33218  {
33219  /* x*y = uby * x + (y-uby) * x <= uby * x + (y-uby) * lbx <= uby * x + max{(lby-uby) * lbx, 0 * lbx} */
33220  coefx = bilincoef * uby;
33221  coefy = 0.0;
33222  constant = bilincoef * (lbx < 0.0 ? (lby-uby) * lbx : 0.0);
33223  }
33224  else
33225  {
33226  coefx = bilincoef * uby;
33227  coefy = bilincoef * lbx;
33228  constant = -bilincoef * lbx * uby;
33229  }
33230  }
33231  else
33232  {
33233  *success = FALSE;
33234  return;
33235  }
33236  }
33237 
33238  if( SCIPisInfinity(scip, REALABS(coefx)) || SCIPisInfinity(scip, REALABS(coefy))
33239  || SCIPisInfinity(scip, REALABS(constant)) )
33240  {
33241  *success = FALSE;
33242  return;
33243  }
33244 
33245  if( overestimate )
33246  {
33247  coefx = -coefx;
33248  coefy = -coefy;
33249  constant = -constant;
33250  }
33251 
33252  SCIPdebugMsg(scip, "%.20g * x[%.20g,%.20g] * y[%.20g,%.20g] %c= %.20g * x %+.20g * y %+.20g\n", bilincoef, lbx, ubx,
33253  lby, uby, overestimate ? '<' : '>', coefx, coefy, constant);
33254 
33255  *lincoefx += coefx;
33256  *lincoefy += coefy;
33257  *linconstant += constant;
33258 }
33259 
33260 /** creates an NLP relaxation and stores it in a given NLPI problem; the function computes for each variable which the
33261  * number of non-linearly occurrences and stores it in the nlscore array
33262  *
33263  * @note the first row corresponds always to the cutoff row (even if cutoffbound is SCIPinfinity(scip))
33264  **/
33266  SCIP* scip, /**< SCIP data structure */
33267  SCIP_NLPI* nlpi, /**< interface to NLP solver */
33268  SCIP_NLROW** nlrows, /**< nonlinear rows */
33269  int nnlrows, /**< total number of nonlinear rows */
33270  SCIP_NLPIPROBLEM* nlpiprob, /**< empty nlpi problem */
33271  SCIP_HASHMAP* var2idx, /**< empty hash map to store mapping between variables and indices in nlpi
33272  * problem */
33273  SCIP_Real* nlscore, /**< array to store the score of each nonlinear variable (NULL if not
33274  * needed) */
33275  SCIP_Real cutoffbound, /**< cutoff bound */
33276  SCIP_Bool setobj, /**< should the objective function be set? */
33277  SCIP_Bool onlyconvex /**< filter only for convex constraints */
33278  )
33279 {
33280  SCIP_EXPRTREE** exprtrees;
33281  int** exprvaridxs;
33282  SCIP_QUADELEM** quadelems;
33283  int* nquadelems;
33284  SCIP_Real** linvals;
33285  int** lininds;
33286  int* nlininds;
33287  SCIP_Real* lhss;
33288  SCIP_Real* rhss;
33289  const char** names;
33290  SCIP_VAR** vars;
33291  int nvars;
33292  SCIP_Real* lbs;
33293  SCIP_Real* ubs;
33294  SCIP_Real* objvals = NULL;
33295  int* objinds = NULL;
33296  const char** varnames;
33297  int nobjinds;
33298  int nconss;
33299  int i;
33300 
33301  assert(nlpiprob != NULL);
33302  assert(var2idx != NULL);
33303  assert(nlrows != NULL);
33304  assert(nnlrows > 0);
33305  assert(nlpi != NULL);
33306 
33307  SCIPdebugMsg(scip, "call SCIPcreateConvexNlpNlobbt() with cutoffbound %g\n", cutoffbound);
33308 
33309  if( nlscore != NULL )
33310  {
33311  BMSclearMemoryArray(nlscore, SCIPgetNVars(scip));
33312  }
33313  vars = SCIPgetVars(scip);
33314  nvars = SCIPgetNVars(scip);
33315  nconss = 0;
33316 
33317  SCIP_CALL( SCIPallocBufferArray(scip, &exprtrees, nnlrows + 1) );
33318  SCIP_CALL( SCIPallocBufferArray(scip, &exprvaridxs, nnlrows + 1) );
33319  SCIP_CALL( SCIPallocBufferArray(scip, &quadelems, nnlrows + 1) );
33320  SCIP_CALL( SCIPallocBufferArray(scip, &nquadelems, nnlrows + 1) );
33321  SCIP_CALL( SCIPallocBufferArray(scip, &linvals, nnlrows + 1) );
33322  SCIP_CALL( SCIPallocBufferArray(scip, &lininds, nnlrows + 1) );
33323  SCIP_CALL( SCIPallocBufferArray(scip, &nlininds, nnlrows + 1) );
33324  SCIP_CALL( SCIPallocBufferArray(scip, &names, nnlrows + 1) );
33325  SCIP_CALL( SCIPallocBufferArray(scip, &lhss, nnlrows + 1) );
33326  SCIP_CALL( SCIPallocBufferArray(scip, &rhss, nnlrows + 1) );
33327 
33328  if( setobj )
33329  {
33330  SCIP_CALL( SCIPallocBufferArray(scip, &objvals, nvars) );
33331  SCIP_CALL( SCIPallocBufferArray(scip, &objinds, nvars) );
33332  }
33333 
33334  SCIP_CALL( SCIPallocBufferArray(scip, &lbs, nvars) );
33335  SCIP_CALL( SCIPallocBufferArray(scip, &ubs, nvars) );
33336  SCIP_CALL( SCIPallocBufferArray(scip, &varnames, nvars) );
33337 
33338  /* create a unique mapping between variables and {0,..,nvars-1} */
33339  nobjinds = 0;
33340  for( i = 0; i < nvars; ++i )
33341  {
33342  assert(vars[i] != NULL);
33343  SCIP_CALL( SCIPhashmapInsert(var2idx, (void*)vars[i], (void*)(size_t)i) );
33344 
33345  lbs[i] = SCIPvarGetLbLocal(vars[i]);
33346  ubs[i] = SCIPvarGetUbLocal(vars[i]);
33347  varnames[i] = SCIPvarGetName(vars[i]);
33348 
33349  /* collect non-zero objective coefficients */
33350  if( setobj && !SCIPisZero(scip, SCIPvarGetObj(vars[i])) )
33351  {
33352  assert(objvals != NULL);
33353  assert(objinds != NULL);
33354 
33355  objvals[nobjinds] = SCIPvarGetObj(vars[i]);
33356  objinds[nobjinds] = i;
33357  ++nobjinds;
33358  }
33359  }
33360 
33361  /* add variables */
33362  SCIP_CALL( SCIPnlpiAddVars(nlpi, nlpiprob, nvars, lbs, ubs, varnames) );
33363  SCIPfreeBufferArray(scip, &varnames);
33364  SCIPfreeBufferArray(scip, &ubs);
33365  SCIPfreeBufferArray(scip, &lbs);
33366 
33367  /* set the objective function */
33368  if( setobj )
33369  {
33370  if( nobjinds > 0 )
33371  {
33372  SCIP_CALL( SCIPnlpiSetObjective(nlpi, nlpiprob, nobjinds, objinds, objvals, 0, NULL, NULL, NULL, 0.0) );
33373  }
33374 
33375  SCIPfreeBufferArray(scip, &objinds);
33376  SCIPfreeBufferArray(scip, &objvals);
33377  }
33378 
33379  /* add row for cutoff bound even if cutoffbound == SCIPinfinity() */
33380  lhss[nconss] = -SCIPinfinity(scip);
33381  rhss[nconss] = cutoffbound;
33382  names[nconss] = "objcutoff";
33383  lininds[nconss] = NULL;
33384  linvals[nconss] = NULL;
33385  nlininds[nconss] = 0;
33386  nquadelems[nconss] = 0;
33387  quadelems[nconss] = NULL;
33388  exprtrees[nconss] = NULL;
33389  exprvaridxs[nconss] = NULL;
33390 
33391  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[nconss], nvars) ); /*lint !e866*/
33392  SCIP_CALL( SCIPallocBufferArray(scip, &linvals[nconss], nvars) ); /*lint !e866*/
33393 
33394  for( i = 0; i < nvars; ++i )
33395  {
33396  if( !SCIPisZero(scip, SCIPvarGetObj(vars[i])) )
33397  {
33398  linvals[nconss][nlininds[nconss]] = SCIPvarGetObj(vars[i]);
33399  lininds[nconss][nlininds[nconss]] = i;
33400  ++nlininds[nconss];
33401  }
33402  }
33403  ++nconss;
33404 
33405  /* add convex nonlinear rows to NLPI problem */
33406  for( i = 0; i < nnlrows; ++i )
33407  {
33408  SCIP_Bool userhs;
33409  SCIP_Bool uselhs;
33410  int k;
33411 
33412  assert(nlrows[i] != NULL);
33413 
33414  uselhs = FALSE;
33415  userhs = FALSE;
33416 
33417  /* check curvature together with constraint sides of a nonlinear row */
33418  if( SCIPnlrowGetNQuadElems(nlrows[i]) == 0 && SCIPnlrowGetExprtree(nlrows[i]) == NULL )
33419  {
33420  uselhs = TRUE;
33421  userhs = TRUE;
33422  }
33423  else
33424  {
33425  if( (!onlyconvex || SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONVEX)
33426  && !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
33427  userhs = TRUE;
33428  if( (!onlyconvex || SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONCAVE)
33429  && !SCIPisInfinity(scip, SCIPnlrowGetLhs(nlrows[i])) )
33430  uselhs = TRUE;
33431  }
33432 
33433  if( !uselhs && !userhs )
33434  continue;
33435 
33436  lhss[nconss] = uselhs ? SCIPnlrowGetLhs(nlrows[i]) - SCIPnlrowGetConstant(nlrows[i]) : -SCIPinfinity(scip);
33437  rhss[nconss] = userhs ? SCIPnlrowGetRhs(nlrows[i]) - SCIPnlrowGetConstant(nlrows[i]) : SCIPinfinity(scip);
33438  names[nconss] = SCIPnlrowGetName(nlrows[i]);
33439  nlininds[nconss] = 0;
33440  lininds[nconss] = NULL;
33441  linvals[nconss] = NULL;
33442  nquadelems[nconss] = 0;
33443  quadelems[nconss] = NULL;
33444  exprtrees[nconss] = NULL;
33445  exprvaridxs[nconss] = NULL;
33446 
33447  /* copy linear part */
33448  if( SCIPnlrowGetNLinearVars(nlrows[i]) > 0 )
33449  {
33450  SCIP_VAR* var;
33451 
33452  nlininds[nconss] = SCIPnlrowGetNLinearVars(nlrows[i]);
33453 
33454  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[nconss], nlininds[nconss]) ); /*lint !e866*/
33455  SCIP_CALL( SCIPallocBufferArray(scip, &linvals[nconss], nlininds[nconss]) ); /*lint !e866*/
33456 
33457  for( k = 0; k < nlininds[nconss]; ++k )
33458  {
33459  var = SCIPnlrowGetLinearVars(nlrows[i])[k];
33460  assert(var != NULL);
33461  assert(SCIPhashmapExists(var2idx, (void*)var));
33462 
33463  lininds[nconss][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
33464  assert(var == vars[lininds[nconss][k]]);
33465  linvals[nconss][k] = SCIPnlrowGetLinearCoefs(nlrows[i])[k];
33466  }
33467  }
33468 
33469  /* copy quadratic part */
33470  if( SCIPnlrowGetNQuadElems(nlrows[i]) > 0 )
33471  {
33472  SCIP_QUADELEM quadelem;
33473  SCIP_VAR* var1;
33474  SCIP_VAR* var2;
33475 
33476  nquadelems[nconss] = SCIPnlrowGetNQuadElems(nlrows[i]);
33477  SCIP_CALL( SCIPallocBufferArray(scip, &quadelems[nconss], nquadelems[nconss]) ); /*lint !e866*/
33478 
33479  for( k = 0; k < nquadelems[nconss]; ++k )
33480  {
33481  quadelem = SCIPnlrowGetQuadElems(nlrows[i])[k];
33482 
33483  var1 = SCIPnlrowGetQuadVars(nlrows[i])[quadelem.idx1];
33484  assert(var1 != NULL);
33485  assert(SCIPhashmapExists(var2idx, (void*)var1));
33486 
33487  var2 = SCIPnlrowGetQuadVars(nlrows[i])[quadelem.idx2];
33488  assert(var2 != NULL);
33489  assert(SCIPhashmapExists(var2idx, (void*)var2));
33490 
33491  quadelems[nconss][k].coef = quadelem.coef;
33492  quadelems[nconss][k].idx1 = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var1);
33493  quadelems[nconss][k].idx2 = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var2);
33494 
33495  /* expr.c assumes that the indices are ordered */
33496  if( quadelems[nconss][k].idx1 > quadelems[nconss][k].idx2 )
33497  {
33498  SCIPswapInts(&quadelems[nconss][k].idx1, &quadelems[nconss][k].idx2);
33499  }
33500  assert(quadelems[nconss][k].idx1 <= quadelems[nconss][k].idx2);
33501 
33502  /* update nlscore */
33503  if( nlscore != NULL )
33504  {
33505  ++nlscore[quadelems[nconss][k].idx1];
33506  if( quadelems[nconss][k].idx1 != quadelems[nconss][k].idx2 )
33507  ++nlscore[quadelems[nconss][k].idx2];
33508  }
33509  }
33510  }
33511 
33512  /* copy expression tree */
33513  if( SCIPnlrowGetExprtree(nlrows[i]) != NULL )
33514  {
33515  SCIP_VAR* var;
33516 
33517  /* note that we don't need to copy the expression tree here since only the mapping between variables in the
33518  * tree and the corresponding indices change; this mapping is stored in the exprvaridxs array
33519  */
33520  exprtrees[nconss] = SCIPnlrowGetExprtree(nlrows[i]);
33521 
33522  SCIP_CALL( SCIPallocBufferArray(scip, &exprvaridxs[nconss], SCIPexprtreeGetNVars(exprtrees[nconss])) ); /*lint !e866*/
33523 
33524  for( k = 0; k < SCIPexprtreeGetNVars(exprtrees[nconss]); ++k )
33525  {
33526  var = SCIPexprtreeGetVars(exprtrees[nconss])[k];
33527  assert(var != NULL);
33528  assert(SCIPhashmapExists(var2idx, (void*)var));
33529 
33530  exprvaridxs[nconss][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
33531 
33532  /* update nlscore */
33533  if( nlscore != NULL )
33534  ++nlscore[exprvaridxs[nconss][k]];
33535  }
33536  }
33537 
33538  ++nconss;
33539  }
33540  assert(nconss > 0);
33541 
33542  /* pass all constraint information to nlpi */
33543  SCIP_CALL( SCIPnlpiAddConstraints(nlpi, nlpiprob, nconss, lhss, rhss, nlininds, lininds, linvals, nquadelems,
33544  quadelems, exprvaridxs, exprtrees, names) );
33545 
33546  /* free memory */
33547  for( i = nconss - 1; i > 0; --i )
33548  {
33549  if( exprtrees[i] != NULL )
33550  {
33551  assert(exprvaridxs[i] != NULL);
33552  SCIPfreeBufferArray(scip, &exprvaridxs[i]);
33553  }
33554 
33555  if( nquadelems[i] > 0 )
33556  {
33557  assert(quadelems[i] != NULL);
33558  SCIPfreeBufferArray(scip, &quadelems[i]);
33559  }
33560 
33561  if( nlininds[i] > 0 )
33562  {
33563  assert(linvals[i] != NULL);
33564  assert(lininds[i] != NULL);
33565  SCIPfreeBufferArray(scip, &linvals[i]);
33566  SCIPfreeBufferArray(scip, &lininds[i]);
33567  }
33568  }
33569  /* free row for cutoff bound even if objective is 0 */
33570  SCIPfreeBufferArray(scip, &linvals[i]);
33571  SCIPfreeBufferArray(scip, &lininds[i]);
33572 
33573  SCIPfreeBufferArray(scip, &rhss);
33574  SCIPfreeBufferArray(scip, &lhss);
33575  SCIPfreeBufferArray(scip, &names);
33576  SCIPfreeBufferArray(scip, &nlininds);
33577  SCIPfreeBufferArray(scip, &lininds);
33578  SCIPfreeBufferArray(scip, &linvals);
33579  SCIPfreeBufferArray(scip, &nquadelems);
33580  SCIPfreeBufferArray(scip, &quadelems);
33581  SCIPfreeBufferArray(scip, &exprvaridxs);
33582  SCIPfreeBufferArray(scip, &exprtrees);
33583 
33584  return SCIP_OKAY;
33585 }
33586 
33587 /** updates bounds of each variable and the cutoff row in the nlpiproblem */
33589  SCIP* scip, /**< SCIP data structure */
33590  SCIP_NLPI* nlpi, /**< interface to NLP solver */
33591  SCIP_NLPIPROBLEM* nlpiprob, /**< nlpi problem representing the convex NLP relaxation */
33592  SCIP_HASHMAP* var2nlpiidx, /**< mapping between variables and nlpi indices */
33593  SCIP_VAR** nlpivars, /**< array containing all variables of the nlpi */
33594  int nlpinvars, /**< total number of nlpi variables */
33595  SCIP_Real cutoffbound /**< new cutoff bound */
33596  )
33597 {
33598  SCIP_Real* lbs;
33599  SCIP_Real* ubs;
33600  SCIP_Real lhs;
33601  SCIP_Real rhs;
33602  int* inds;
33603  int i;
33604 
33605  SCIPdebugMsg(scip, "call SCIPupdateConvexNlpNlobbt()\n");
33606 
33607  /* update variable bounds */
33608  SCIP_CALL( SCIPallocBufferArray(scip, &lbs, nlpinvars) );
33609  SCIP_CALL( SCIPallocBufferArray(scip, &ubs, nlpinvars) );
33610  SCIP_CALL( SCIPallocBufferArray(scip, &inds, nlpinvars) );
33611 
33612  for( i = 0; i < nlpinvars; ++i )
33613  {
33614  assert(nlpivars[i] != NULL);
33615  assert(SCIPhashmapExists(var2nlpiidx, (void*)nlpivars[i]));
33616 
33617  lbs[i] = SCIPvarGetLbLocal(nlpivars[i]);
33618  ubs[i] = SCIPvarGetUbLocal(nlpivars[i]);
33619  inds[i] = (int)(size_t)SCIPhashmapGetImage(var2nlpiidx, (void*)nlpivars[i]);
33620  assert(inds[i] >= 0 && inds[i] < nlpinvars);
33621  }
33622 
33623  SCIP_CALL( SCIPnlpiChgVarBounds(nlpi, nlpiprob, nlpinvars, inds, lbs, ubs) );
33624 
33625  SCIPfreeBufferArray(scip, &inds);
33626  SCIPfreeBufferArray(scip, &ubs);
33627  SCIPfreeBufferArray(scip, &lbs);
33628 
33629  /* update cutoff row */
33630  lhs = -SCIPinfinity(scip);
33631  rhs = cutoffbound;
33632  i = 0;
33633 
33634  SCIP_CALL( SCIPnlpiChgConsSides(nlpi, nlpiprob, 1, &i, &lhs, &rhs) );
33635 
33636  return SCIP_OKAY;
33637 }
33638 
33639 /** adds linear rows to the NLP relaxation */
33641  SCIP* scip, /**< SCIP data structure */
33642  SCIP_NLPI* nlpi, /**< interface to NLP solver */
33643  SCIP_NLPIPROBLEM* nlpiprob, /**< nlpi problem */
33644  SCIP_HASHMAP* var2idx, /**< empty hash map to store mapping between variables and indices in nlpi
33645  * problem */
33646  SCIP_ROW** rows, /**< rows to add */
33647  int nrows /**< total number of rows to add */
33648  )
33649 {
33650  const char** names;
33651  SCIP_Real* lhss;
33652  SCIP_Real* rhss;
33653  SCIP_Real** linvals;
33654  int** lininds;
33655  int* nlininds;
33656  int i;
33657 
33658  assert(nlpi != NULL);
33659  assert(nlpiprob != NULL);
33660  assert(var2idx != NULL);
33661  assert(nrows == 0 || rows != NULL);
33662 
33663  SCIPdebugMsg(scip, "call SCIPaddConvexNlpRowsNlobbt() with %d rows\n", nrows);
33664 
33665  if( nrows <= 0 )
33666  return SCIP_OKAY;
33667 
33668  SCIP_CALL( SCIPallocBufferArray(scip, &names, nrows) );
33669  SCIP_CALL( SCIPallocBufferArray(scip, &lhss, nrows) );
33670  SCIP_CALL( SCIPallocBufferArray(scip, &rhss, nrows) );
33671  SCIP_CALL( SCIPallocBufferArray(scip, &linvals, nrows) );
33672  SCIP_CALL( SCIPallocBufferArray(scip, &lininds, nrows) );
33673  SCIP_CALL( SCIPallocBufferArray(scip, &nlininds, nrows) );
33674 
33675  for( i = 0; i < nrows; ++i )
33676  {
33677  int k;
33678 
33679  assert(rows[i] != NULL);
33680  assert(SCIProwGetNNonz(rows[i]) <= SCIPgetNVars(scip));
33681 
33682  names[i] = SCIProwGetName(rows[i]);
33683  lhss[i] = SCIProwGetLhs(rows[i]) - SCIProwGetConstant(rows[i]);
33684  rhss[i] = SCIProwGetRhs(rows[i]) - SCIProwGetConstant(rows[i]);
33685  nlininds[i] = SCIProwGetNNonz(rows[i]);
33686  linvals[i] = SCIProwGetVals(rows[i]);
33687  lininds[i] = NULL;
33688 
33689  SCIP_CALL( SCIPallocBufferArray(scip, &lininds[i], SCIProwGetNNonz(rows[i])) ); /*lint !e866*/
33690 
33691  for( k = 0; k < SCIProwGetNNonz(rows[i]); ++k )
33692  {
33693  SCIP_VAR* var;
33694 
33695  var = SCIPcolGetVar(SCIProwGetCols(rows[i])[k]);
33696  assert(var != NULL);
33697  assert(SCIPhashmapExists(var2idx, (void*)var));
33698 
33699  lininds[i][k] = (int)(size_t)SCIPhashmapGetImage(var2idx, (void*)var);
33700  assert(lininds[i][k] >= 0 && lininds[i][k] < SCIPgetNVars(scip));
33701  }
33702  }
33703 
33704  /* pass all linear rows to the nlpi */
33705  SCIP_CALL( SCIPnlpiAddConstraints(nlpi, nlpiprob, nrows, lhss, rhss, nlininds, lininds, linvals, NULL,
33706  NULL, NULL, NULL, names) );
33707 
33708  /* free memory */
33709  for( i = nrows - 1; i >= 0; --i )
33710  {
33711  SCIPfreeBufferArray(scip, &lininds[i]);
33712  }
33713  SCIPfreeBufferArray(scip, &nlininds);
33714  SCIPfreeBufferArray(scip, &lininds);
33715  SCIPfreeBufferArray(scip, &linvals);
33716  SCIPfreeBufferArray(scip, &rhss);
33717  SCIPfreeBufferArray(scip, &lhss);
33718  SCIPfreeBufferArray(scip, &names);
33719 
33720  return SCIP_OKAY;
33721 }
33722 
33723 /**@} */
33724 
33725 /*
33726  * cutting plane methods
33727  */
33728 
33729 /** returns efficacy of the cut with respect to the given primal solution or the current LP solution:
33730  * e = -feasibility/norm
33731  *
33732  * @return the efficacy of the cut with respect to the given primal solution or the current LP solution:
33733  * e = -feasibility/norm
33734  *
33735  * @pre This method can be called if @p scip is in one of the following stages:
33736  * - \ref SCIP_STAGE_SOLVING
33737  */
33739  SCIP* scip, /**< SCIP data structure */
33740  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
33741  SCIP_ROW* cut /**< separated cut */
33742  )
33743 {
33744  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutEfficacy", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33745 
33746  if( sol == NULL )
33747  return SCIProwGetLPEfficacy(cut, scip->set, scip->stat, scip->lp);
33748  else
33749  return SCIProwGetSolEfficacy(cut, scip->set, scip->stat, sol);
33750 }
33751 
33752 /** returns whether the cut's efficacy with respect to the given primal solution or the current LP solution is greater
33753  * than the minimal cut efficacy
33754  *
33755  * @return TRUE if the cut's efficacy with respect to the given primal solution or the current LP solution is greater
33756  * than the minimal cut efficacy, otherwise FALSE
33757  *
33758  * @pre This method can be called if @p scip is in one of the following stages:
33759  * - \ref SCIP_STAGE_SOLVING
33760  */
33762  SCIP* scip, /**< SCIP data structure */
33763  SCIP_SOL* sol, /**< primal CIP solution, or NULL for current LP solution */
33764  SCIP_ROW* cut /**< separated cut */
33765  )
33766 {
33767  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutEfficacious", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33768 
33769  if( sol == NULL )
33770  return SCIProwIsLPEfficacious(cut, scip->set, scip->stat, scip->lp, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
33771  else
33772  return SCIProwIsSolEfficacious(cut, scip->set, scip->stat, sol, (SCIPtreeGetCurrentDepth(scip->tree) == 0));
33773 }
33774 
33775 /** checks, if the given cut's efficacy is larger than the minimal cut efficacy
33776  *
33777  * @return TRUE if the given cut's efficacy is larger than the minimal cut efficacy, otherwise FALSE
33778  */
33780  SCIP* scip, /**< SCIP data structure */
33781  SCIP_Real efficacy /**< efficacy of the cut */
33782  )
33783 {
33784  assert(scip != NULL);
33785 
33786  return SCIPsetIsEfficacious(scip->set, (SCIPtreeGetCurrentDepth(scip->tree) == 0), efficacy);
33787 }
33788 
33789 /** calculates the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
33790  *
33791  * @return the efficacy norm of the given vector, which depends on the "separating/efficacynorm" parameter
33792  */
33794  SCIP* scip, /**< SCIP data structure */
33795  SCIP_Real* vals, /**< array of values */
33796  int nvals /**< number of values */
33797  )
33798 {
33799  SCIP_Real norm;
33800  int i;
33801 
33802  assert(scip != NULL);
33803  assert(scip->set != NULL);
33804 
33805  norm = 0.0;
33806  switch( scip->set->sepa_efficacynorm )
33807  {
33808  case 'e':
33809  for( i = 0; i < nvals; ++i )
33810  norm += SQR(vals[i]);
33811  norm = SQRT(norm);
33812  break;
33813  case 'm':
33814  for( i = 0; i < nvals; ++i )
33815  {
33816  SCIP_Real absval;
33817 
33818  absval = REALABS(vals[i]);
33819  norm = MAX(norm, absval);
33820  }
33821  break;
33822  case 's':
33823  for( i = 0; i < nvals; ++i )
33824  norm += REALABS(vals[i]);
33825  break;
33826  case 'd':
33827  for( i = 0; i < nvals; ++i )
33828  {
33829  if( !SCIPisZero(scip, vals[i]) )
33830  {
33831  norm = 1.0;
33832  break;
33833  }
33834  }
33835  break;
33836  default:
33837  SCIPerrorMessage("invalid efficacy norm parameter '%c'\n", scip->set->sepa_efficacynorm);
33838  assert(FALSE);
33839  }
33840 
33841  return norm;
33842 }
33843 
33844 /** indicates whether a cut is applicable, i.e., will modify the LP when applied
33845  *
33846  * @pre This method can be called if @p scip is in one of the following stages:
33847  * - \ref SCIP_STAGE_SOLVING
33848  *
33849  * @return whether the cut is modifiable, not a bound change, or a bound change that changes bounds by at least epsilon
33850  */
33852  SCIP* scip, /**< SCIP data structure */
33853  SCIP_ROW* cut /**< separated cut */
33854  )
33855 {
33856  SCIP_CALL_ABORT( checkStage(scip, "SCIPisCutApplicable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33857 
33858  return SCIPsepastoreIsCutApplicable(scip->set, cut);
33859 }
33860 
33861 /** adds cut to separation storage
33862  *
33863  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33864  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33865  *
33866  * @pre This method can be called if @p scip is in one of the following stages:
33867  * - \ref SCIP_STAGE_SOLVING
33868  */
33870  SCIP* scip, /**< SCIP data structure */
33871  SCIP_SOL* sol, /**< primal solution that was separated, or NULL for LP solution */
33872  SCIP_ROW* cut, /**< separated cut */
33873  SCIP_Bool forcecut, /**< should the cut be forced to enter the LP? */
33874  SCIP_Bool* infeasible /**< pointer to store whether cut has been detected to be infeasible for local bounds */
33875  )
33876 {
33877  SCIP_CALL( checkStage(scip, "SCIPaddCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33878 
33879  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
33880 
33881  SCIP_CALL( SCIPsepastoreAddCut(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
33882  scip->eventfilter, scip->lp, sol, cut, forcecut, (SCIPtreeGetCurrentDepth(scip->tree) == 0), infeasible) );
33883 
33884  /* possibly run conflict analysis */
33885  if ( *infeasible && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && SCIPisConflictAnalysisApplicable(scip) )
33886  {
33887  SCIP_Real act;
33888  SCIP_VAR* var;
33889  SCIP_Real val;
33890  int ncols;
33891  int j;
33892 
33893  /* initialize conflict analysis */
33895 
33896  if ( ! SCIPisInfinity(scip, -cut->lhs) )
33897  {
33898  act = SCIProwGetMaxActivity(cut, scip->set, scip->stat);
33899  if ( SCIPisLT(scip, act, cut->lhs) )
33900  {
33901  ncols = SCIProwGetNNonz(cut);
33902  for (j = 0; j < ncols; ++j)
33903  {
33904  val = cut->vals[j];
33905  if ( ! SCIPisZero(scip, val) )
33906  {
33907  var = SCIPcolGetVar(cut->cols[j]);
33908  assert( var != NULL );
33909 
33910  if ( val > 0.0 )
33911  {
33912  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
33913  }
33914  else
33915  {
33916  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
33917  }
33918  }
33919  }
33920  }
33921  }
33922  else if ( ! SCIPisInfinity(scip, cut->rhs) )
33923  {
33924  act = SCIProwGetMinActivity(cut, scip->set, scip->stat);
33925  if ( SCIPisGT(scip, act, cut->rhs) )
33926  {
33927  ncols = SCIProwGetNNonz(cut);
33928  for (j = 0; j < ncols; ++j)
33929  {
33930  val = cut->vals[j];
33931  if ( ! SCIPisZero(scip, val) )
33932  {
33933  var = SCIPcolGetVar(cut->cols[j]);
33934  assert( var != NULL );
33935 
33936  if ( val > 0.0 )
33937  {
33938  SCIP_CALL( SCIPaddConflictLb(scip, var, NULL) );
33939  }
33940  else
33941  {
33942  SCIP_CALL( SCIPaddConflictUb(scip, var, NULL) );
33943  }
33944  }
33945  }
33946  }
33947  }
33948 
33949  /* analyze the conflict */
33951  }
33952 
33953  return SCIP_OKAY;
33954 }
33955 
33956 /** if not already existing, adds row to global cut pool
33957  *
33958  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33959  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33960  *
33961  * @pre This method can be called if @p scip is in one of the following stages:
33962  * - \ref SCIP_STAGE_SOLVING
33963  */
33965  SCIP* scip, /**< SCIP data structure */
33966  SCIP_ROW* row /**< row to remove */
33967  )
33968 {
33969  SCIP_CALL( checkStage(scip, "SCIPaddPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33970 
33971  SCIP_CALL( SCIPcutpoolAddRow(scip->cutpool, scip->mem->probmem, scip->set, row) );
33972 
33973  return SCIP_OKAY;
33974 }
33975 
33976 /** removes the row from the global cut pool
33977  *
33978  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
33979  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
33980  *
33981  * @pre This method can be called if @p scip is in one of the following stages:
33982  * - \ref SCIP_STAGE_SOLVING
33983  */
33985  SCIP* scip, /**< SCIP data structure */
33986  SCIP_ROW* row /**< cutting plane to add */
33987  )
33988 {
33989  SCIP_CALL( checkStage(scip, "SCIPdelPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
33990 
33991  SCIP_CALL( SCIPcutpoolDelRow(scip->cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
33992 
33993  return SCIP_OKAY;
33994 }
33995 
33996 /** gets current cuts in the global cut pool
33997  *
33998  * @return the current cuts in the global cut pool
33999  *
34000  * @pre This method can be called if @p scip is in one of the following stages:
34001  * - \ref SCIP_STAGE_SOLVING
34002  * - \ref SCIP_STAGE_SOLVED
34003  * - \ref SCIP_STAGE_EXITSOLVE
34004  */
34006  SCIP* scip /**< SCIP data structure */
34007  )
34008 {
34009  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34010 
34011  return SCIPcutpoolGetCuts(scip->cutpool);
34012 }
34013 
34014 /** gets current number of rows in the global cut pool
34015  *
34016  * @return the current number of rows in the global cut pool
34017  *
34018  * @pre This method can be called if @p scip is in one of the following stages:
34019  * - \ref SCIP_STAGE_SOLVING
34020  * - \ref SCIP_STAGE_SOLVED
34021  * - \ref SCIP_STAGE_EXITSOLVE
34022  */
34024  SCIP* scip /**< SCIP data structure */
34025  )
34026 {
34027  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34028 
34029  return SCIPcutpoolGetNCuts(scip->cutpool);
34030 }
34031 
34032 /** gets the global cut pool used by SCIP
34033  *
34034  * @return the global cut pool used by SCIP
34035  *
34036  * @pre This method can be called if @p scip is in one of the following stages:
34037  * - \ref SCIP_STAGE_SOLVING
34038  * - \ref SCIP_STAGE_SOLVED
34039  * - \ref SCIP_STAGE_EXITSOLVE
34040  */
34042  SCIP* scip /**< SCIP data structure */
34043  )
34044 {
34045  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34046 
34047  return scip->cutpool;
34048 }
34049 
34050 /** creates a cut pool
34051  *
34052  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34053  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34054  *
34055  * @pre This method can be called if @p scip is in one of the following stages:
34056  * - \ref SCIP_STAGE_TRANSFORMING
34057  * - \ref SCIP_STAGE_TRANSFORMED
34058  * - \ref SCIP_STAGE_INITPRESOLVE
34059  * - \ref SCIP_STAGE_PRESOLVING
34060  * - \ref SCIP_STAGE_EXITPRESOLVE
34061  * - \ref SCIP_STAGE_PRESOLVED
34062  * - \ref SCIP_STAGE_INITSOLVE
34063  * - \ref SCIP_STAGE_SOLVING
34064  */
34066  SCIP* scip, /**< SCIP data structure */
34067  SCIP_CUTPOOL** cutpool, /**< pointer to store cut pool */
34068  int agelimit /**< maximum age a cut can reach before it is deleted from the pool */
34069  )
34070 {
34071  SCIP_CALL( checkStage(scip, "SCIPcreateCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34072 
34073  SCIP_CALL( SCIPcutpoolCreate(cutpool, scip->mem->probmem, scip->set, agelimit, FALSE) );
34074 
34075  return SCIP_OKAY;
34076 }
34077 
34078 /** frees a cut pool
34079  *
34080  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34081  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34082  *
34083  * @pre This method can be called if @p scip is in one of the following stages:
34084  * - \ref SCIP_STAGE_TRANSFORMING
34085  * - \ref SCIP_STAGE_TRANSFORMED
34086  * - \ref SCIP_STAGE_INITPRESOLVE
34087  * - \ref SCIP_STAGE_PRESOLVING
34088  * - \ref SCIP_STAGE_EXITPRESOLVE
34089  * - \ref SCIP_STAGE_PRESOLVED
34090  * - \ref SCIP_STAGE_INITSOLVE
34091  * - \ref SCIP_STAGE_SOLVING
34092  * - \ref SCIP_STAGE_SOLVED
34093  * - \ref SCIP_STAGE_EXITSOLVE
34094  * - \ref SCIP_STAGE_FREETRANS
34095  */
34097  SCIP* scip, /**< SCIP data structure */
34098  SCIP_CUTPOOL** cutpool /**< pointer to store cut pool */
34099  )
34100 {
34101  SCIP_CALL( checkStage(scip, "SCIPfreeCutpool", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34102 
34103  SCIP_CALL( SCIPcutpoolFree(cutpool, scip->mem->probmem, scip->set, scip->lp) );
34104 
34105  return SCIP_OKAY;
34106 }
34107 
34108 /** if not already existing, adds row to a cut pool and captures it
34109  *
34110  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34111  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34112  *
34113  * @pre This method can be called if @p scip is in one of the following stages:
34114  * - \ref SCIP_STAGE_INITSOLVE
34115  * - \ref SCIP_STAGE_SOLVING
34116  */
34118  SCIP* scip, /**< SCIP data structure */
34119  SCIP_CUTPOOL* cutpool, /**< cut pool */
34120  SCIP_ROW* row /**< cutting plane to add */
34121  )
34122 {
34123  SCIP_CALL( checkStage(scip, "SCIPaddRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34124 
34125  SCIP_CALL( SCIPcutpoolAddRow(cutpool, scip->mem->probmem, scip->set, row) );
34126 
34127  return SCIP_OKAY;
34128 }
34129 
34130 /** adds row to a cut pool and captures it; doesn't check for multiple cuts
34131  *
34132  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34133  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34134  *
34135  * @pre This method can be called if @p scip is in one of the following stages:
34136  * - \ref SCIP_STAGE_INITSOLVE
34137  * - \ref SCIP_STAGE_SOLVING
34138  */
34140  SCIP* scip, /**< SCIP data structure */
34141  SCIP_CUTPOOL* cutpool, /**< cut pool */
34142  SCIP_ROW* row /**< cutting plane to add */
34143  )
34144 {
34145  SCIP_CALL( checkStage(scip, "SCIPaddNewRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34146 
34147  SCIP_CALL( SCIPcutpoolAddNewRow(cutpool, scip->mem->probmem, scip->set, row) );
34148 
34149  return SCIP_OKAY;
34150 }
34151 
34152 /** removes the LP row from a cut pool
34153  *
34154  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34155  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34156  *
34157  * @pre This method can be called if @p scip is in one of the following stages:
34158  * - \ref SCIP_STAGE_INITSOLVE
34159  * - \ref SCIP_STAGE_SOLVING
34160  * - \ref SCIP_STAGE_SOLVED
34161  */
34163  SCIP* scip, /**< SCIP data structure */
34164  SCIP_CUTPOOL* cutpool, /**< cut pool */
34165  SCIP_ROW* row /**< row to remove */
34166  )
34167 {
34168  SCIP_CALL( checkStage(scip, "SCIPdelRowCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
34169 
34170  SCIP_CALL( SCIPcutpoolDelRow(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34171 
34172  return SCIP_OKAY;
34173 }
34174 
34175 /** separates cuts from a cut pool
34176  *
34177  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34178  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34179  *
34180  * @pre This method can be called if @p scip is in one of the following stages:
34181  * - \ref SCIP_STAGE_SOLVING
34182  */
34184  SCIP* scip, /**< SCIP data structure */
34185  SCIP_CUTPOOL* cutpool, /**< cut pool */
34186  SCIP_RESULT* result /**< pointer to store the result of the separation call */
34187  )
34188 {
34189  SCIP_CALL( checkStage(scip, "SCIPseparateCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34190 
34191  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
34192 
34193  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
34194  {
34195  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
34196  return SCIP_INVALIDCALL;
34197  }
34198 
34199  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
34200  scip->lp, scip->sepastore, NULL, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
34201 
34202  return SCIP_OKAY;
34203 }
34204 
34205 /** separates cuts w.r.t. given solution from a cut pool
34206  *
34207  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34208  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34209  *
34210  * @pre This method can be called if @p scip is in one of the following stages:
34211  * - \ref SCIP_STAGE_SOLVING
34212  */
34214  SCIP* scip, /**< SCIP data structure */
34215  SCIP_CUTPOOL* cutpool, /**< cut pool */
34216  SCIP_SOL* sol, /**< solution to be separated */
34217  SCIP_RESULT* result /**< pointer to store the result of the separation call */
34218  )
34219 {
34220  SCIP_CALL( checkStage(scip, "SCIPseparateSolCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34221 
34222  assert(SCIPtreeGetCurrentNode(scip->tree) != NULL);
34223 
34224  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
34225  {
34226  SCIPerrorMessage("cannot add cuts, because node LP is not processed\n");
34227  return SCIP_INVALIDCALL;
34228  }
34229 
34230  SCIP_CALL( SCIPcutpoolSeparate(cutpool, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->eventfilter,
34231  scip->lp, scip->sepastore, sol, FALSE, (SCIPtreeGetCurrentDepth(scip->tree) == 0), result) );
34232 
34233  return SCIP_OKAY;
34234 }
34235 
34236 /** if not already existing, adds row to delayed global cut pool
34237  *
34238  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34239  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34240  *
34241  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
34242  */
34244  SCIP* scip, /**< SCIP data structure */
34245  SCIP_ROW* row /**< cutting plane to add */
34246  )
34247 {
34248  SCIP_CALL( checkStage(scip, "SCIPaddDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34249 
34250  SCIP_CALL( SCIPcutpoolAddRow(scip->delayedcutpool, scip->mem->probmem, scip->set, row) );
34251 
34252  return SCIP_OKAY;
34253 }
34254 
34255 /** removes the row from the delayed global cut pool
34256  *
34257  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34258  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34259  *
34260  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
34261  */
34263  SCIP* scip, /**< SCIP data structure */
34264  SCIP_ROW* row /**< cutting plane to add */
34265  )
34266 {
34267  SCIP_CALL( checkStage(scip, "SCIPdelDelayedPoolCut", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34268 
34269  SCIP_CALL( SCIPcutpoolDelRow(scip->delayedcutpool, scip->mem->probmem, scip->set, scip->stat, scip->lp, row) );
34270 
34271  return SCIP_OKAY;
34272 }
34273 
34274 /** gets current cuts in the delayed global cut pool
34275  *
34276  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34277  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34278  *
34279  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
34280  */
34282  SCIP* scip /**< SCIP data structure */
34283  )
34284 {
34285  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34286 
34287  return SCIPcutpoolGetCuts(scip->delayedcutpool);
34288 }
34289 
34290 /** gets current number of rows in the delayed global cut pool
34291  *
34292  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34293  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34294  *
34295  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
34296  */
34298  SCIP* scip /**< SCIP data structure */
34299  )
34300 {
34301  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDelayedPoolCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34302 
34303  return SCIPcutpoolGetNCuts(scip->delayedcutpool);
34304 }
34305 
34306 /** gets the delayed global cut pool used by SCIP
34307  *
34308  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34309  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34310  *
34311  * @pre This method can be called if @p scip is the stages \ref SCIP_STAGE_SOLVING
34312  */
34314  SCIP* scip /**< SCIP data structure */
34315  )
34316 {
34317  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDelayedGlobalCutpool", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE) );
34318 
34319  return scip->delayedcutpool;
34320 }
34321 
34322 /** separates the given primal solution or the current LP solution by calling the separators and constraint handlers'
34323  * separation methods;
34324  * the generated cuts are stored in the separation storage and can be accessed with the methods SCIPgetCuts() and
34325  * SCIPgetNCuts();
34326  * after evaluating the cuts, you have to call SCIPclearCuts() in order to remove the cuts from the
34327  * separation storage;
34328  * it is possible to call SCIPseparateSol() multiple times with different solutions and evaluate the found cuts
34329  * afterwards
34330  *
34331  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34332  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34333  *
34334  * @pre This method can be called if @p scip is in one of the following stages:
34335  * - \ref SCIP_STAGE_SOLVING
34336  */
34338  SCIP* scip, /**< SCIP data structure */
34339  SCIP_SOL* sol, /**< primal solution that should be separated, or NULL for LP solution */
34340  SCIP_Bool pretendroot, /**< should the cut separators be called as if we are at the root node? */
34341  SCIP_Bool onlydelayed, /**< should only separators be called that were delayed in the previous round? */
34342  SCIP_Bool* delayed, /**< pointer to store whether a separator was delayed */
34343  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
34344  )
34345 {
34346  int actdepth;
34347 
34348  SCIP_CALL( checkStage(scip, "SCIPseparateSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34349 
34350  /* get current depth */
34351  actdepth = (pretendroot ? 0 : SCIPtreeGetCurrentDepth(scip->tree));
34352 
34353  /* apply separation round */
34354  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,
34355  sol, actdepth, onlydelayed, delayed, cutoff) );
34356 
34357  return SCIP_OKAY;
34358 }
34359 
34360 /** gets the array of cuts currently stored in the separation storage
34361  *
34362  * @return the array of cuts currently stored in the separation storage
34363  *
34364  * @pre This method can be called if @p scip is in one of the following stages:
34365  * - \ref SCIP_STAGE_PRESOLVED
34366  * - \ref SCIP_STAGE_SOLVING
34367  * - \ref SCIP_STAGE_SOLVED
34368  */
34370  SCIP* scip /**< SCIP data structure */
34371  )
34372 {
34373  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
34374 
34375  return SCIPsepastoreGetCuts(scip->sepastore);
34376 }
34377 
34378 /** get current number of cuts in the separation storage
34379  *
34380  * @return the current number of cuts in the separation storage
34381  *
34382  * @pre This method can be called if @p scip is in one of the following stages:
34383  * - \ref SCIP_STAGE_PRESOLVED
34384  * - \ref SCIP_STAGE_SOLVING
34385  * - \ref SCIP_STAGE_SOLVED
34386  */
34388  SCIP* scip /**< SCIP data structure */
34389  )
34390 {
34391  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
34392 
34393  return SCIPsepastoreGetNCuts(scip->sepastore);
34394 }
34395 
34396 /** clears the separation storage
34397  *
34398  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34399  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34400  *
34401  * @pre This method can be called if @p scip is in one of the following stages:
34402  * - \ref SCIP_STAGE_SOLVING
34403  */
34405  SCIP* scip /**< SCIP data structure */
34406  )
34407 {
34408  SCIP_CALL( checkStage(scip, "SCIPclearCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34409 
34410  SCIP_CALL( SCIPsepastoreClearCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, scip->lp) );
34411 
34412  return SCIP_OKAY;
34413 }
34414 
34415 /** removes cuts that are inefficacious w.r.t. the current LP solution from separation storage without adding the cuts to the LP
34416  *
34417  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34418  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34419  *
34420  * @pre This method can be called if @p scip is in one of the following stages:
34421  * - \ref SCIP_STAGE_SOLVING
34422  */
34424  SCIP* scip /**< SCIP data structure */
34425  )
34426 {
34427  SCIP_Bool isroot;
34428 
34429  SCIP_CALL( checkStage(scip, "SCIPremoveInefficaciousCuts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34430 
34431  isroot = FALSE;
34432  if( SCIPtreeGetCurrentDepth(scip->tree) == 0 )
34433  isroot = TRUE;
34435  scip->eventqueue, scip->eventfilter, scip->lp, isroot, SCIP_EFFICIACYCHOICE_LP) );
34436 
34437  return SCIP_OKAY;
34438 }
34439 
34440 /** returns current factor on cut infeasibility to limit feasibility tolerance for relaxation solver
34441  *
34442  * Gives value of separating/feastolfac parameter.
34443  *
34444  * @return factor on cut infeasibility to limit feasibility tolerance for relaxation solver
34445  *
34446  * @pre This method can be called if @p scip is in one of the following stages:
34447  * - \ref SCIP_STAGE_SOLVING
34448  */
34450  SCIP* scip /**< SCIP data structure */
34451  )
34452 {
34453  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRelaxFeastolFactor", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34454 
34455  return scip->set->sepa_feastolfac;
34456 }
34457 
34458 /*
34459  * LP diving methods
34460  */
34461 
34462 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
34463  *
34464  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34465  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34466  *
34467  * @pre This method can be called if @p scip is in one of the following stages:
34468  * - \ref SCIP_STAGE_SOLVING
34469  *
34470  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34471  *
34472  * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
34473  * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
34474  * numerical troubles during the last LP solve; because of this, most users will want to call this method only if
34475  * SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
34476  */
34478  SCIP* scip /**< SCIP data structure */
34479  )
34480 {
34481  assert(scip != NULL);
34482 
34483  SCIP_CALL( checkStage(scip, "SCIPstartDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34485 
34486  if( SCIPlpDiving(scip->lp) )
34487  {
34488  SCIPerrorMessage("already in diving mode\n");
34489  return SCIP_INVALIDCALL;
34490  }
34491 
34492  if( SCIPtreeProbing(scip->tree) )
34493  {
34494  SCIPerrorMessage("cannot start diving while being in probing mode\n");
34495  return SCIP_INVALIDCALL;
34496  }
34497 
34499  {
34500  SCIPerrorMessage("cannot start diving if LP has not been constructed\n");
34501  return SCIP_INVALIDCALL;
34502  }
34503  assert(SCIPtreeHasCurrentNodeLP(scip->tree));
34504 
34505  SCIP_CALL( SCIPlpStartDive(scip->lp, scip->mem->probmem, scip->set, scip->stat) );
34506 
34507  return SCIP_OKAY;
34508 }
34509 
34510 /** quits LP diving and resets bounds and objective values of columns to the current node's values
34511  *
34512  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34513  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34514  *
34515  * @pre This method can be called if @p scip is in one of the following stages:
34516  * - \ref SCIP_STAGE_SOLVING
34517  *
34518  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34519  */
34521  SCIP* scip /**< SCIP data structure */
34522  )
34523 {
34524  assert(scip != NULL);
34525 
34526  SCIP_CALL( checkStage(scip, "SCIPendDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34527 
34528  if( !SCIPlpDiving(scip->lp) )
34529  {
34530  SCIPerrorMessage("not in diving mode\n");
34531  return SCIP_INVALIDCALL;
34532  }
34533 
34534  /* unmark the diving flag in the LP and reset all variables' objective and bound values */
34535  SCIP_CALL( SCIPlpEndDive(scip->lp, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->eventqueue, scip->eventfilter,
34536  scip->transprob, scip->transprob->vars, scip->transprob->nvars) );
34537 
34538  /* the lower bound may have changed slightly due to LP resolve in SCIPlpEndDive() */
34539  if( !scip->lp->resolvelperror && scip->tree->focusnode != NULL && SCIPlpIsRelax(scip->lp) && SCIPlpIsSolved(scip->lp) )
34540  {
34541  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
34542  SCIP_CALL( SCIPnodeUpdateLowerboundLP(scip->tree->focusnode, scip->set, scip->stat, scip->tree, scip->transprob,
34543  scip->origprob, scip->lp) );
34544  }
34545  /* reset the probably changed LP's cutoff bound */
34546  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, scip->primal->cutoffbound) );
34547  assert(scip->lp->cutoffbound == scip->primal->cutoffbound); /*lint !e777*/
34548 
34549  /* if a new best solution was created, the cutoff of the tree was delayed due to diving;
34550  * the cutoff has to be done now.
34551  */
34552  if( scip->tree->cutoffdelayed )
34553  {
34554  SCIP_CALL( SCIPtreeCutoff(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
34555  scip->lp, scip->primal->cutoffbound) );
34556  }
34557 
34558  return SCIP_OKAY;
34559 }
34560 
34561 /** changes cutoffbound in current dive
34562  *
34563  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34564  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34565  *
34566  * @pre This method can be called if @p scip is in one of the following stages:
34567  * - \ref SCIP_STAGE_SOLVING
34568  *
34569  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34570  */
34572  SCIP* scip, /**< SCIP data structure */
34573  SCIP_Real newcutoffbound /**< new cutoffbound */
34574  )
34575 {
34576  assert(scip != NULL);
34577 
34578  SCIP_CALL( checkStage(scip, "SCIPchgCutoffboundDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34579 
34580  if( !SCIPlpDiving(scip->lp) )
34581  {
34582  SCIPerrorMessage("not in diving mode\n");
34583  return SCIP_INVALIDCALL;
34584  }
34585 
34586  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, newcutoffbound) );
34587 
34588  return SCIP_OKAY;
34589 }
34590 
34591 /** changes variable's objective value in current dive
34592  *
34593  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34594  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34595  *
34596  * @pre This method can be called if @p scip is in one of the following stages:
34597  * - \ref SCIP_STAGE_SOLVING
34598  *
34599  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34600  */
34602  SCIP* scip, /**< SCIP data structure */
34603  SCIP_VAR* var, /**< variable to change the objective value for */
34604  SCIP_Real newobj /**< new objective value */
34605  )
34606 {
34607  assert(scip != NULL);
34608  assert(var != NULL);
34609 
34610  SCIP_CALL( checkStage(scip, "SCIPchgVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34611 
34612  if( !SCIPlpDiving(scip->lp) )
34613  {
34614  SCIPerrorMessage("not in diving mode\n");
34615  return SCIP_INVALIDCALL;
34616  }
34617 
34618  /* invalidate the LP's cutoff bound, since this has nothing to do with the current objective value anymore;
34619  * the cutoff bound is reset in SCIPendDive()
34620  */
34621  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
34622 
34623  /* mark the LP's objective function invalid */
34625 
34626  /* change the objective value of the variable in the diving LP */
34627  SCIP_CALL( SCIPvarChgObjDive(var, scip->set, scip->lp, newobj) );
34628 
34629  return SCIP_OKAY;
34630 }
34631 
34632 /** changes variable's lower bound in current dive
34633  *
34634  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34635  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34636  *
34637  * @pre This method can be called if @p scip is in one of the following stages:
34638  * - \ref SCIP_STAGE_SOLVING
34639  *
34640  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34641  */
34643  SCIP* scip, /**< SCIP data structure */
34644  SCIP_VAR* var, /**< variable to change the bound for */
34645  SCIP_Real newbound /**< new value for bound */
34646  )
34647 {
34648  assert(scip != NULL);
34649  assert(var != NULL);
34650 
34651  SCIP_CALL( checkStage(scip, "SCIPchgVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34652 
34653  if( !SCIPlpDiving(scip->lp) )
34654  {
34655  SCIPerrorMessage("not in diving mode\n");
34656  return SCIP_INVALIDCALL;
34657  }
34658 
34659  SCIP_CALL( SCIPvarChgLbDive(var, scip->set, scip->lp, newbound) );
34660 
34661  return SCIP_OKAY;
34662 }
34663 
34664 /** changes variable's upper bound in current dive
34665  *
34666  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34667  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34668  *
34669  * @pre This method can be called if @p scip is in one of the following stages:
34670  * - \ref SCIP_STAGE_SOLVING
34671  *
34672  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34673  */
34675  SCIP* scip, /**< SCIP data structure */
34676  SCIP_VAR* var, /**< variable to change the bound for */
34677  SCIP_Real newbound /**< new value for bound */
34678  )
34679 {
34680  assert(scip != NULL);
34681  assert(var != NULL);
34682 
34683  SCIP_CALL( checkStage(scip, "SCIPchgVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34684 
34685  if( !SCIPlpDiving(scip->lp) )
34686  {
34687  SCIPerrorMessage("not in diving mode\n");
34688  return SCIP_INVALIDCALL;
34689  }
34690 
34691  SCIP_CALL( SCIPvarChgUbDive(var, scip->set, scip->lp, newbound) );
34692 
34693  return SCIP_OKAY;
34694 }
34695 
34696 /** adds a row to the LP in current dive
34697  *
34698  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34699  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34700  *
34701  * @pre This method can be called if @p scip is in one of the following stages:
34702  * - \ref SCIP_STAGE_SOLVING
34703  *
34704  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34705  */
34707  SCIP* scip, /**< SCIP data structure */
34708  SCIP_ROW* row /**< row to be added */
34709  )
34710 {
34711  SCIP_NODE* node;
34712  int depth;
34713 
34714  assert(scip != NULL);
34715  assert(row != NULL);
34716 
34717  SCIP_CALL( checkStage(scip, "SCIPaddRowDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34718 
34719  if( !SCIPlpDiving(scip->lp) )
34720  {
34721  SCIPerrorMessage("not in diving mode\n");
34722  return SCIP_INVALIDCALL;
34723  }
34724 
34725  /* get depth of current node */
34726  node = SCIPtreeGetCurrentNode(scip->tree);
34727  assert(node != NULL);
34728  depth = SCIPnodeGetDepth(node);
34729 
34730  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
34731 
34732  return SCIP_OKAY;
34733 }
34734 
34735 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
34736  *
34737  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34738  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34739  *
34740  * @pre This method can be called if @p scip is in one of the following stages:
34741  * - \ref SCIP_STAGE_SOLVING
34742  *
34743  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34744  */
34746  SCIP* scip, /**< SCIP data structure */
34747  SCIP_ROW* row, /**< row to change the lhs for */
34748  SCIP_Real newlhs /**< new value for lhs */
34749  )
34750 {
34751  assert(scip != NULL);
34752  assert(row != NULL);
34753 
34754  SCIP_CALL( checkStage(scip, "SCIPchgRowLhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34755 
34756  if( !SCIPlpDiving(scip->lp) )
34757  {
34758  SCIPerrorMessage("not in diving mode\n");
34759  return SCIP_INVALIDCALL;
34760  }
34761 
34763  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newlhs) );
34764 
34765  return SCIP_OKAY;
34766 }
34767 
34768 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
34769  *
34770  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34771  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34772  *
34773  * @pre This method can be called if @p scip is in one of the following stages:
34774  * - \ref SCIP_STAGE_SOLVING
34775  *
34776  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34777  */
34779  SCIP* scip, /**< SCIP data structure */
34780  SCIP_ROW* row, /**< row to change the lhs for */
34781  SCIP_Real newrhs /**< new value for rhs */
34782  )
34783 {
34784  assert(scip != NULL);
34785  assert(row != NULL);
34786 
34787  SCIP_CALL( checkStage(scip, "SCIPchgRowRhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34788 
34789  if( !SCIPlpDiving(scip->lp) )
34790  {
34791  SCIPerrorMessage("not in diving mode\n");
34792  return SCIP_INVALIDCALL;
34793  }
34794 
34796  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newrhs) );
34797 
34798  return SCIP_OKAY;
34799 }
34800 
34801 /** gets variable's objective value in current dive
34802  *
34803  * @return the variable's objective value in current dive.
34804  *
34805  * @pre This method can be called if @p scip is in one of the following stages:
34806  * - \ref SCIP_STAGE_SOLVING
34807  *
34808  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34809  */
34811  SCIP* scip, /**< SCIP data structure */
34812  SCIP_VAR* var /**< variable to get the bound for */
34813  )
34814 {
34815  assert(scip != NULL);
34816  assert(var != NULL);
34817 
34818  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34819 
34820  if( !SCIPlpDiving(scip->lp) )
34821  {
34822  SCIPerrorMessage("not in diving mode\n");
34823  SCIPABORT();
34824  return SCIP_INVALID; /*lint !e527*/
34825  }
34826 
34827  return SCIPvarGetObjLP(var);
34828 }
34829 
34830 /** gets variable's lower bound in current dive
34831  *
34832  * @return the variable's lower bound in current dive.
34833  *
34834  * @pre This method can be called if @p scip is in one of the following stages:
34835  * - \ref SCIP_STAGE_SOLVING
34836  *
34837  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34838  */
34840  SCIP* scip, /**< SCIP data structure */
34841  SCIP_VAR* var /**< variable to get the bound for */
34842  )
34843 {
34844  assert(scip != NULL);
34845  assert(var != NULL);
34846 
34847  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34848 
34849  if( !SCIPlpDiving(scip->lp) )
34850  {
34851  SCIPerrorMessage("not in diving mode\n");
34852  SCIPABORT();
34853  return SCIP_INVALID; /*lint !e527*/
34854  }
34855 
34856  return SCIPvarGetLbLP(var, scip->set);
34857 }
34858 
34859 /** gets variable's upper bound in current dive
34860  *
34861  * @return the variable's upper bound in current dive.
34862  *
34863  * @pre This method can be called if @p scip is in one of the following stages:
34864  * - \ref SCIP_STAGE_SOLVING
34865  *
34866  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34867  */
34869  SCIP* scip, /**< SCIP data structure */
34870  SCIP_VAR* var /**< variable to get the bound for */
34871  )
34872 {
34873  assert(scip != NULL);
34874  assert(var != NULL);
34875 
34876  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34877 
34878  if( !SCIPlpDiving(scip->lp) )
34879  {
34880  SCIPerrorMessage("not in diving mode\n");
34881  SCIPABORT();
34882  return SCIP_INVALID; /*lint !e527*/
34883  }
34884 
34885  return SCIPvarGetUbLP(var, scip->set);
34886 }
34887 
34888 /** solves the LP of the current dive; no separation or pricing is applied
34889  *
34890  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
34891  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
34892  *
34893  * @pre This method can be called if @p scip is in one of the following stages:
34894  * - \ref SCIP_STAGE_SOLVING
34895  *
34896  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34897  *
34898  * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
34899  * compare the explanation of SCIPstartDive()
34900  */
34902  SCIP* scip, /**< SCIP data structure */
34903  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
34904  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
34905  SCIP_Bool* cutoff /**< pointer to store whether the diving LP was infeasible or the objective
34906  * limit was reached (or NULL, if not needed) */
34907  )
34908 {
34909  assert(scip != NULL);
34910 
34911  SCIP_CALL( checkStage(scip, "SCIPsolveDiveLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
34912 
34913  if( !SCIPlpDiving(scip->lp) )
34914  {
34915  SCIPerrorMessage("not in diving mode\n");
34916  return SCIP_INVALIDCALL;
34917  }
34918 
34919  if( cutoff != NULL )
34920  *cutoff = FALSE;
34921 
34922  /* solve diving LP */
34923  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
34924  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
34925 
34926  /* the LP is infeasible or the objective limit was reached */
34928  || (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_OPTIMAL &&
34929  SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip))) )
34930  {
34931  /* analyze the infeasible LP (only if the objective was not changed, all columns are in the LP, and no external
34932  * pricers exist)
34933  */
34934  if( !scip->set->misc_exactsolve && !(SCIPlpDivingObjChanged(scip->lp) || SCIPlpDivingRowsChanged(scip->lp))
34935  && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) )
34936  {
34937  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
34938  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
34939  }
34940 
34941  if( cutoff != NULL )
34942  *cutoff = TRUE;
34943  }
34944 
34945  return SCIP_OKAY;
34946 }
34947 
34948 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
34949  * or probing mode
34950  *
34951  * @return the number of the node in the current branch and bound run, where the last LP was solved in diving
34952  * or probing mode.
34953  *
34954  * @pre This method can be called if @p scip is in one of the following stages:
34955  * - \ref SCIP_STAGE_TRANSFORMING
34956  * - \ref SCIP_STAGE_TRANSFORMED
34957  * - \ref SCIP_STAGE_INITPRESOLVE
34958  * - \ref SCIP_STAGE_PRESOLVING
34959  * - \ref SCIP_STAGE_EXITPRESOLVE
34960  * - \ref SCIP_STAGE_PRESOLVED
34961  * - \ref SCIP_STAGE_INITSOLVE
34962  * - \ref SCIP_STAGE_SOLVING
34963  * - \ref SCIP_STAGE_SOLVED
34964  * - \ref SCIP_STAGE_EXITSOLVE
34965  * - \ref SCIP_STAGE_FREETRANS
34966  *
34967  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34968  */
34970  SCIP* scip /**< SCIP data structure */
34971  )
34972 {
34973  assert(scip != NULL);
34974 
34975  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLastDivenode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
34976 
34977  return scip->stat->lastdivenode;
34978 }
34979 
34980 /** returns whether we are in diving mode
34981  *
34982  * @return whether we are in diving mode.
34983  *
34984  * @pre This method can be called if @p scip is in one of the following stages:
34985  * - \ref SCIP_STAGE_TRANSFORMING
34986  * - \ref SCIP_STAGE_TRANSFORMED
34987  * - \ref SCIP_STAGE_INITPRESOLVE
34988  * - \ref SCIP_STAGE_PRESOLVING
34989  * - \ref SCIP_STAGE_EXITPRESOLVE
34990  * - \ref SCIP_STAGE_PRESOLVED
34991  * - \ref SCIP_STAGE_INITSOLVE
34992  * - \ref SCIP_STAGE_SOLVING
34993  * - \ref SCIP_STAGE_SOLVED
34994  * - \ref SCIP_STAGE_EXITSOLVE
34995  * - \ref SCIP_STAGE_FREETRANS
34996  *
34997  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
34998  */
35000  SCIP* scip /**< SCIP data structure */
35001  )
35002 {
35003  assert(scip != NULL);
35004 
35005  SCIP_CALL_ABORT( checkStage(scip, "SCIPinDive", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
35006 
35007  return SCIPlpDiving(scip->lp);
35008 }
35009 
35010 
35011 
35012 
35013 /*
35014  * probing methods
35015  */
35016 
35017 /** returns whether we are in probing mode; probing mode is activated via SCIPstartProbing() and stopped
35018  * via SCIPendProbing()
35019  *
35020  * @return TRUE, if SCIP is currently in probing mode, otherwise FALSE
35021  *
35022  * @pre This method can be called if @p scip is in one of the following stages:
35023  * - \ref SCIP_STAGE_TRANSFORMED
35024  * - \ref SCIP_STAGE_INITPRESOLVE
35025  * - \ref SCIP_STAGE_PRESOLVING
35026  * - \ref SCIP_STAGE_EXITPRESOLVE
35027  * - \ref SCIP_STAGE_PRESOLVED
35028  * - \ref SCIP_STAGE_INITSOLVE
35029  * - \ref SCIP_STAGE_SOLVING
35030  * - \ref SCIP_STAGE_SOLVED
35031  * - \ref SCIP_STAGE_EXITSOLVE
35032  */
35034  SCIP* scip /**< SCIP data structure */
35035  )
35036 {
35037  SCIP_CALL_ABORT( checkStage(scip, "SCIPinProbing", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
35038 
35039  return SCIPtreeProbing(scip->tree);
35040 }
35041 
35042 /** initiates probing, making methods SCIPnewProbingNode(), SCIPbacktrackProbing(), SCIPchgVarLbProbing(),
35043  * SCIPchgVarUbProbing(), SCIPfixVarProbing(), SCIPpropagateProbing(), and SCIPsolveProbingLP() available
35044  *
35045  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35046  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35047  *
35048  * @pre This method can be called if @p scip is in one of the following stages:
35049  * - \ref SCIP_STAGE_PRESOLVING
35050  * - \ref SCIP_STAGE_SOLVING
35051  *
35052  * @note The collection of variable statistics is turned off during probing. If these statistics should be collected
35053  * during probing use the method SCIPenableVarHistory() to turn the collection explicitly on.
35054  */
35056  SCIP* scip /**< SCIP data structure */
35057  )
35058 {
35059  SCIP_CALL( checkStage(scip, "SCIPstartProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35060 
35061  if( SCIPtreeProbing(scip->tree) )
35062  {
35063  SCIPerrorMessage("already in probing mode\n");
35064  return SCIP_INVALIDCALL;
35065  }
35066 
35067  if( scip->lp != NULL && SCIPlpDiving(scip->lp) )
35068  {
35069  SCIPerrorMessage("cannot start probing while in diving mode\n");
35070  return SCIP_INVALIDCALL;
35071  }
35072 
35073  SCIP_CALL( SCIPtreeStartProbing(scip->tree, scip->mem->probmem, scip->set, scip->lp, FALSE) );
35074 
35075  /* disables the collection of any statistic for a variable */
35077 
35078  return SCIP_OKAY;
35079 }
35080 
35081 /** creates a new probing sub node, whose changes can be undone by backtracking to a higher node in the probing path
35082  * with a call to SCIPbacktrackProbing();
35083  * using a sub node for each set of probing bound changes can improve conflict analysis
35084  *
35085  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35086  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35087  *
35088  * @pre This method can be called if @p scip is in one of the following stages:
35089  * - \ref SCIP_STAGE_PRESOLVING
35090  * - \ref SCIP_STAGE_SOLVING
35091  */
35093  SCIP* scip /**< SCIP data structure */
35094  )
35095 {
35096  SCIP_RETCODE retcode;
35097 
35098  SCIP_CALL( checkStage(scip, "SCIPnewProbingNode", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35099 
35100  if( !SCIPtreeProbing(scip->tree) )
35101  {
35102  SCIPerrorMessage("not in probing mode\n");
35103  return SCIP_INVALIDCALL;
35104  }
35105 
35106  retcode = SCIPtreeCreateProbingNode(scip->tree, scip->mem->probmem, scip->set, scip->lp);
35107 
35108  if( retcode == SCIP_MAXDEPTHLEVEL )
35109  {
35110  SCIPwarningMessage(scip, "probing reached maximal depth; it should be stopped\n");
35111  }
35112  SCIP_CALL( retcode );
35113 
35114  return SCIP_OKAY;
35115 }
35116 
35117 /** returns the current probing depth
35118  *
35119  * @return the probing depth, i.e. the number of probing sub nodes existing in the probing path
35120  *
35121  * @pre This method can be called if @p scip is in one of the following stages:
35122  * - \ref SCIP_STAGE_PRESOLVING
35123  * - \ref SCIP_STAGE_SOLVING
35124  */
35126  SCIP* scip /**< SCIP data structure */
35127  )
35128 {
35129  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetProbingDepth", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35130 
35131  if( !SCIPtreeProbing(scip->tree) )
35132  {
35133  SCIPerrorMessage("not in probing mode\n");
35134  SCIPABORT();
35135  return -1; /*lint !e527*/
35136  }
35137 
35138  return SCIPtreeGetProbingDepth(scip->tree);
35139 }
35140 
35141 /** undoes all changes to the problem applied in probing up to the given probing depth;
35142  * the changes of the probing node of the given probing depth are the last ones that remain active;
35143  * changes that were applied before calling SCIPnewProbingNode() cannot be undone
35144  *
35145  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35146  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35147  *
35148  * @pre This method can be called if @p scip is in one of the following stages:
35149  * - \ref SCIP_STAGE_PRESOLVING
35150  * - \ref SCIP_STAGE_SOLVING
35151  */
35153  SCIP* scip, /**< SCIP data structure */
35154  int probingdepth /**< probing depth of the node in the probing path that should be reactivated */
35155  )
35156 {
35157  SCIP_CALL( checkStage(scip, "SCIPbacktrackProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35158 
35159  if( !SCIPtreeProbing(scip->tree) )
35160  {
35161  SCIPerrorMessage("not in probing mode\n");
35162  return SCIP_INVALIDCALL;
35163  }
35164  if( probingdepth < 0 || probingdepth > SCIPtreeGetProbingDepth(scip->tree) )
35165  {
35166  SCIPerrorMessage("backtracking probing depth %d out of current probing range [0,%d]\n",
35167  probingdepth, SCIPtreeGetProbingDepth(scip->tree));
35168  return SCIP_INVALIDDATA;
35169  }
35170 
35171  SCIP_CALL( SCIPtreeBacktrackProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
35172  scip->origprob, scip->lp, scip->relaxation, scip->primal, scip->branchcand, scip->eventqueue, scip->eventfilter,
35173  scip->cliquetable, probingdepth) );
35174 
35175  return SCIP_OKAY;
35176 }
35177 
35178 /** quits probing and resets bounds and constraints to the focus node's environment
35179  *
35180  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35181  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35182  *
35183  * @pre This method can be called if @p scip is in one of the following stages:
35184  * - \ref SCIP_STAGE_PRESOLVING
35185  * - \ref SCIP_STAGE_SOLVING
35186  */
35188  SCIP* scip /**< SCIP data structure */
35189  )
35190 {
35191  SCIP_CALL( checkStage(scip, "SCIPendProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35192 
35193  if( !SCIPtreeProbing(scip->tree) )
35194  {
35195  SCIPerrorMessage("not in probing mode\n");
35196  return SCIP_INVALIDCALL;
35197  }
35198 
35199  /* switch back from probing to normal operation mode and restore variables and constraints to focus node */
35200  SCIP_CALL( SCIPtreeEndProbing(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
35201  scip->transprob, scip->origprob, scip->lp, scip->relaxation, scip->primal,
35202  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable) );
35203 
35204  /* enables the collection of statistics for a variable */
35206 
35207  return SCIP_OKAY;
35208 }
35209 
35210 /** injects a change of variable's lower bound into current probing node; the same can also be achieved with a call to
35211  * SCIPchgVarLb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
35212  *
35213  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35214  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35215  *
35216  * @pre This method can be called if @p scip is in one of the following stages:
35217  * - \ref SCIP_STAGE_PRESOLVING
35218  * - \ref SCIP_STAGE_SOLVING
35219  */
35221  SCIP* scip, /**< SCIP data structure */
35222  SCIP_VAR* var, /**< variable to change the bound for */
35223  SCIP_Real newbound /**< new value for bound */
35224  )
35225 {
35226  SCIP_CALL( checkStage(scip, "SCIPchgVarLbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35227 
35228  if( !SCIPtreeProbing(scip->tree) )
35229  {
35230  SCIPerrorMessage("not in probing mode\n");
35231  return SCIP_INVALIDCALL;
35232  }
35234 
35235  SCIPvarAdjustLb(var, scip->set, &newbound);
35236 
35237  /* ignore tightenings of lower bounds to +infinity during solving process */
35238  if( SCIPisInfinity(scip, newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
35239  {
35240 #ifndef NDEBUG
35241  SCIPwarningMessage(scip, "ignore lower bound tightening for %s from %e to +infinity\n", SCIPvarGetName(var),
35242  SCIPvarGetLbLocal(var));
35243 #endif
35244  return SCIP_OKAY;
35245  }
35246 
35248  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
35249  var, newbound, SCIP_BOUNDTYPE_LOWER, TRUE) );
35250 
35251  return SCIP_OKAY;
35252 }
35253 
35254 /** injects a change of variable's upper bound into current probing node; the same can also be achieved with a call to
35255  * SCIPchgVarUb(), but in this case, the bound change would be treated like a deduction instead of a branching decision
35256  *
35257  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35258  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35259  *
35260  * @pre This method can be called if @p scip is in one of the following stages:
35261  * - \ref SCIP_STAGE_PRESOLVING
35262  * - \ref SCIP_STAGE_SOLVING
35263  */
35265  SCIP* scip, /**< SCIP data structure */
35266  SCIP_VAR* var, /**< variable to change the bound for */
35267  SCIP_Real newbound /**< new value for bound */
35268  )
35269 {
35270  SCIP_CALL( checkStage(scip, "SCIPchgVarUbProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35271 
35272  if( !SCIPtreeProbing(scip->tree) )
35273  {
35274  SCIPerrorMessage("not in probing mode\n");
35275  return SCIP_INVALIDCALL;
35276  }
35278 
35279  SCIPvarAdjustUb(var, scip->set, &newbound);
35280 
35281  /* ignore tightenings of upper bounds to -infinity during solving process */
35282  if( SCIPisInfinity(scip, -newbound) && SCIPgetStage(scip) == SCIP_STAGE_SOLVING )
35283  {
35284 #ifndef NDEBUG
35285  SCIPwarningMessage(scip, "ignore upper bound tightening for %s from %e to -infinity\n", SCIPvarGetName(var),
35286  SCIPvarGetUbLocal(var));
35287 #endif
35288  return SCIP_OKAY;
35289  }
35290 
35292  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
35293  var, newbound, SCIP_BOUNDTYPE_UPPER, TRUE) );
35294 
35295  return SCIP_OKAY;
35296 }
35297 
35298 /** gets variable's objective value in current probing
35299  *
35300  * @return the variable's objective value in current probing.
35301  *
35302  * @pre This method can be called if @p scip is in one of the following stages:
35303  * - \ref SCIP_STAGE_SOLVING
35304  *
35305  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35306  */
35308  SCIP* scip, /**< SCIP data structure */
35309  SCIP_VAR* var /**< variable to get the bound for */
35310  )
35311 {
35312  assert(scip != NULL);
35313  assert(var != NULL);
35314 
35315  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35316 
35317  if( !SCIPtreeProbing(scip->tree) )
35318  {
35319  SCIPerrorMessage("not in probing mode\n");
35320  return SCIP_INVALID;
35321  }
35322 
35323  return SCIPvarGetObjLP(var);
35324 }
35325 
35326 /** injects a change of variable's bounds into current probing node to fix the variable to the specified value;
35327  * the same can also be achieved with a call to SCIPfixVar(), but in this case, the bound changes would be treated
35328  * like deductions instead of branching decisions
35329  *
35330  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35331  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35332  *
35333  * @pre This method can be called if @p scip is in one of the following stages:
35334  * - \ref SCIP_STAGE_PRESOLVING
35335  * - \ref SCIP_STAGE_SOLVING
35336  */
35338  SCIP* scip, /**< SCIP data structure */
35339  SCIP_VAR* var, /**< variable to change the bound for */
35340  SCIP_Real fixedval /**< value to fix variable to */
35341  )
35342 {
35343  SCIP_Real fixlb;
35344  SCIP_Real fixub;
35345 
35346  SCIP_CALL( checkStage(scip, "SCIPfixVarProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35347 
35348  if( !SCIPtreeProbing(scip->tree) )
35349  {
35350  SCIPerrorMessage("not in probing mode\n");
35351  return SCIP_INVALIDCALL;
35352  }
35354 
35355  /* we adjust the fixing value here and compare the old bound with the adjusted values because otherwise,
35356  * it might happen that the unadjusted value is better and we add the boundchange,
35357  * but within SCIPnodeAddBoundchg() the bounds are adjusted - using the feasibility epsilon for integer variables -
35358  * and it is asserted, that the bound is still better than the old one which might then be incorrect.
35359  */
35360  fixlb = fixedval;
35361  fixub = fixedval;
35362  SCIPvarAdjustLb(var, scip->set, &fixlb);
35363  SCIPvarAdjustUb(var, scip->set, &fixub);
35364  assert(SCIPsetIsEQ(scip->set, fixlb, fixub));
35365 
35366  if( SCIPsetIsGT(scip->set, fixlb, SCIPvarGetLbLocal(var)) )
35367  {
35369  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue,
35370  scip->cliquetable, var, fixlb, SCIP_BOUNDTYPE_LOWER, TRUE) );
35371  }
35372  if( SCIPsetIsLT(scip->set, fixub, SCIPvarGetUbLocal(var)) )
35373  {
35375  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable,
35376  var, fixub, SCIP_BOUNDTYPE_UPPER, TRUE) );
35377  }
35378 
35379  return SCIP_OKAY;
35380 }
35381 
35382 /** changes (column) variable's objective value during probing mode
35383  *
35384  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35385  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35386  *
35387  * @pre This method can be called if @p scip is in one of the following stages:
35388  * - \ref SCIP_STAGE_PRESOLVING
35389  * - \ref SCIP_STAGE_SOLVING
35390  *
35391  * @pre The variable needs to be a column variable.
35392  */
35394  SCIP* scip, /**< SCIP data structure */
35395  SCIP_VAR* var, /**< variable to change the objective for */
35396  SCIP_Real newobj /**< new objective function value */
35397  )
35398 {
35399  SCIP_NODE* node;
35400  SCIP_Real oldobj;
35401 
35402  SCIP_CALL( checkStage(scip, "SCIPchgVarObjProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35403 
35404  if( !SCIPtreeProbing(scip->tree) )
35405  {
35406  SCIPerrorMessage("not in probing mode\n");
35407  return SCIP_INVALIDCALL;
35408  }
35409 
35411  {
35412  SCIPerrorMessage("variable is not a column variable\n");
35413  return SCIP_INVALIDCALL;
35414  }
35415 
35416  /* get current probing node */
35417  node = SCIPtreeGetCurrentNode(scip->tree);
35418  assert(SCIPnodeGetType(node) == SCIP_NODETYPE_PROBINGNODE);
35419 
35420  /* get old objective function value */
35421  oldobj = SCIPvarGetObj(var);
35422 
35423  if( SCIPisEQ(scip, oldobj, newobj) )
35424  return SCIP_OKAY;
35425 
35426  if( node->data.probingnode->nchgdobjs == 0 )
35427  {
35428  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvars, 1) ); /*lint !e506*/
35429  SCIP_CALL( SCIPallocMemoryArray(scip, &node->data.probingnode->origobjvals, 1) ); /*lint !e506*/
35430  }
35431  else
35432  {
35433  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvars, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
35434  SCIP_CALL( SCIPreallocMemoryArray(scip, &node->data.probingnode->origobjvals, node->data.probingnode->nchgdobjs + 1) ); /*lint !e776*/
35435  }
35436 
35437  node->data.probingnode->origobjvars[node->data.probingnode->nchgdobjs] = var;
35438  node->data.probingnode->origobjvals[node->data.probingnode->nchgdobjs] = oldobj;
35439  ++node->data.probingnode->nchgdobjs;
35440  ++scip->tree->probingsumchgdobjs;
35441 
35442  assert(SCIPtreeProbingObjChanged(scip->tree) == SCIPlpDivingObjChanged(scip->lp));
35443 
35444  /* inform tree and LP that the objective was changed and invalidate the LP's cutoff bound, since this has nothing to
35445  * do with the current objective value anymore; the cutoff bound is reset in SCIPendProbing()
35446  */
35447  if( !SCIPtreeProbingObjChanged(scip->tree) )
35448  {
35449  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
35450 
35453  }
35454  assert(SCIPisInfinity(scip, scip->lp->cutoffbound));
35455 
35456  /* inform relaxation and update objective value of relaxation solution accordingly */
35457  SCIPrelaxationUpdateVarObj(scip->relaxation, scip->set, var, oldobj, newobj);
35458 
35459  /* perform the objective change */
35460  SCIP_CALL( SCIPvarChgObj(var, scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp, scip->eventqueue, newobj) );
35461 
35462  return SCIP_OKAY;
35463 }
35464 
35465 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
35466  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
35467  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
35468  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
35469  *
35470  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35471  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35472  *
35473  * @pre This method can be called if @p scip is in one of the following stages:
35474  * - \ref SCIP_STAGE_PRESOLVING
35475  * - \ref SCIP_STAGE_SOLVING
35476  */
35478  SCIP* scip, /**< SCIP data structure */
35479  int maxproprounds, /**< maximal number of propagation rounds (-1: no limit, 0: parameter settings) */
35480  SCIP_Bool* cutoff, /**< pointer to store whether the probing node can be cut off */
35481  SCIP_Longint* ndomredsfound /**< pointer to store the number of domain reductions found, or NULL */
35482  )
35483 {
35484  SCIP_VAR** objchgvars;
35485  SCIP_Real* objchgvals;
35486  SCIP_Bool changedobj;
35487  int nobjchg;
35488 
35489  SCIP_CALL( checkStage(scip, "SCIPpropagateProbing", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35490 
35491  if( !SCIPtreeProbing(scip->tree) )
35492  {
35493  SCIPerrorMessage("not in probing mode\n");
35494  return SCIP_INVALIDCALL;
35495  }
35496 
35497  objchgvars = NULL;
35498  objchgvals = NULL;
35499  changedobj = FALSE;
35500  nobjchg = 0;
35501 
35502  /* undo objective changes if we want to propagate during probing */
35503  if( scip->tree->probingobjchanged )
35504  {
35505  SCIP_VAR** vars;
35506  int nvars;
35507  int i;
35508 
35509  vars = SCIPgetVars(scip);
35510  nvars = SCIPgetNVars(scip);
35511 
35512  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvals, MIN(nvars, scip->tree->probingsumchgdobjs)) );
35513  SCIP_CALL( SCIPallocBufferArray(scip, &objchgvars, MIN(nvars, scip->tree->probingsumchgdobjs)) );
35514  nobjchg = 0;
35515 
35516  for( i = 0; i < nvars; ++i )
35517  {
35518  if( !SCIPisEQ(scip, vars[i]->unchangedobj, SCIPgetVarObjProbing(scip, vars[i])) )
35519  {
35520  objchgvars[nobjchg] = vars[i];
35521  objchgvals[nobjchg] = SCIPgetVarObjProbing(scip, vars[i]);
35522  ++nobjchg;
35523 
35524  SCIP_CALL( SCIPvarChgObj(vars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal, scip->lp,
35525  scip->eventqueue, vars[i]->unchangedobj) );
35526  }
35527  }
35528  assert(nobjchg <= scip->tree->probingsumchgdobjs);
35529 
35531  scip->tree->probingobjchanged = FALSE;
35532  changedobj = TRUE;
35533  }
35534 
35535  if( ndomredsfound != NULL )
35536  *ndomredsfound = -(scip->stat->nprobboundchgs + scip->stat->nprobholechgs);
35537 
35538  SCIP_CALL( SCIPpropagateDomains(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
35539  scip->primal, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->conflict, scip->cliquetable,
35540  SCIPgetDepth(scip), maxproprounds, SCIP_PROPTIMING_ALWAYS, cutoff) );
35541 
35542  if( ndomredsfound != NULL )
35543  *ndomredsfound += scip->stat->nprobboundchgs + scip->stat->nprobholechgs;
35544 
35545  /* restore old objective function */
35546  if( changedobj )
35547  {
35548  int i;
35549 
35550  assert(objchgvars != NULL);
35551  assert(objchgvals != NULL);
35552 
35554  scip->tree->probingobjchanged = TRUE;
35555 
35556  for( i = 0; i < nobjchg; ++i )
35557  {
35558  SCIP_CALL( SCIPvarChgObj(objchgvars[i], scip->mem->probmem, scip->set, scip->transprob, scip->primal,
35559  scip->lp, scip->eventqueue, objchgvals[i]) );
35560  }
35561 
35562  SCIPfreeBufferArray(scip, &objchgvars);
35563  SCIPfreeBufferArray(scip, &objchgvals);
35564  }
35565 
35566  return SCIP_OKAY;
35567 }
35568 
35569 /** applies domain propagation on the probing sub problem, that was changed after SCIPstartProbing() was called;
35570  * only propagations of the binary variables fixed at the current probing node that are triggered by the implication
35571  * graph and the clique table are applied;
35572  * the propagated domains of the variables can be accessed with the usual bound accessing calls SCIPvarGetLbLocal()
35573  * and SCIPvarGetUbLocal(); the propagation is only valid locally, i.e. the local bounds as well as the changed
35574  * bounds due to SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), and SCIPfixVarProbing() are used for propagation
35575  *
35576  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35577  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35578  *
35579  * @pre This method can be called if @p scip is in one of the following stages:
35580  * - \ref SCIP_STAGE_PRESOLVING
35581  * - \ref SCIP_STAGE_SOLVING
35582  */
35584  SCIP* scip, /**< SCIP data structure */
35585  SCIP_Bool* cutoff /**< pointer to store whether the probing node can be cut off */
35586  )
35587 {
35588  SCIP_CALL( checkStage(scip, "SCIPpropagateProbingImplications", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35589 
35590  if( !SCIPtreeProbing(scip->tree) )
35591  {
35592  SCIPerrorMessage("not in probing mode\n");
35593  return SCIP_INVALIDCALL;
35594  }
35595 
35597  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, cutoff) );
35598 
35599  return SCIP_OKAY;
35600 }
35601 
35602 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) with or without pricing */
35603 static
35605  SCIP* scip, /**< SCIP data structure */
35606  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
35607  SCIP_Bool pricing, /**< should pricing be applied? */
35608  SCIP_Bool pretendroot, /**< should the pricers be called as if we are at the root node? */
35609  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
35610  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit) */
35611  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
35612  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
35613  * limit was reached (or NULL, if not needed) */
35614  )
35615 {
35616  SCIP_Bool initcutoff;
35617 
35618  assert(lperror != NULL);
35619  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
35620 
35621  if( !SCIPtreeProbing(scip->tree) )
35622  {
35623  SCIPerrorMessage("not in probing mode\n");
35624  return SCIP_INVALIDCALL;
35625  }
35626  assert(SCIPtreeGetCurrentDepth(scip->tree) > 0);
35627 
35628  SCIP_CALL( SCIPinitConssLP(scip->mem->probmem, scip->set, scip->sepastore, scip->cutpool, scip->stat, scip->transprob,
35629  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
35630  scip->cliquetable, FALSE, FALSE, &initcutoff) );
35631 
35632  if( initcutoff )
35633  {
35634  if( cutoff != NULL )
35635  *cutoff = TRUE;
35636 
35637  return SCIP_OKAY;
35638  }
35639  else if( cutoff != NULL )
35640  *cutoff = FALSE;
35641 
35642  /* load the LP state (if necessary) */
35643  SCIP_CALL( SCIPtreeLoadProbingLPState(scip->tree, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp) );
35644 
35645  SCIPlpSetIsRelax(scip->lp, TRUE);
35646 
35647  /* solve probing LP */
35648  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
35649  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
35650 
35651  assert((*lperror) || SCIPlpGetSolstat(scip->lp) != SCIP_LPSOLSTAT_NOTSOLVED);
35652 
35653  /* mark the probing node to have a solved LP */
35654  if( !(*lperror) )
35655  {
35656  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
35657 
35658  /* call pricing */
35659  if( pricing )
35660  {
35661  SCIP_Bool mustsepa;
35662  int npricedcolvars;
35663  SCIP_Bool result;
35664 
35665  mustsepa = FALSE;
35666  SCIP_CALL( SCIPpriceLoop(scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->transprob,
35667  scip->origprob, scip->primal, scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool,
35668  scip->branchcand, scip->eventqueue, scip->eventfilter, scip->cliquetable, pretendroot, displayinfo,
35669  maxpricerounds, &npricedcolvars, &mustsepa, lperror, &result) );
35670 
35671  /* mark the probing node again to update the LP size in the node and the tree path */
35672  if( !(*lperror) )
35673  {
35674  SCIP_CALL( SCIPtreeMarkProbingNodeHasLP(scip->tree, scip->mem->probmem, scip->lp) );
35675  }
35676  }
35677  }
35678 
35679  /* remember that probing might have changed the LPi state; this holds even if solving returned with an LP error */
35680  scip->tree->probingsolvedlp = TRUE;
35681 
35682  /* the LP is infeasible or the objective limit was reached */
35683  if( !(*lperror) && (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_INFEASIBLE
35686  && SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip)))) )
35687  {
35688  /* analyze the infeasible LP (only if all columns are in the LP and no external pricers exist) */
35689  if( !scip->set->misc_exactsolve && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) && !scip->tree->probingobjchanged )
35690  {
35691  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
35692  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
35693  }
35694 
35695  if( cutoff != NULL )
35696  *cutoff = TRUE;
35697  }
35698 
35699  return SCIP_OKAY;
35700 }
35701 
35702 /** solves the LP at the current probing node (cannot be applied at preprocessing stage);
35703  * no separation or pricing is applied
35704  *
35705  * The LP has to be constructed before (you can use SCIPisLPConstructed() or SCIPconstructLP()).
35706  *
35707  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35708  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35709  *
35710  * @pre This method can be called if @p scip is in one of the following stages:
35711  * - \ref SCIP_STAGE_SOLVING
35712  */
35714  SCIP* scip, /**< SCIP data structure */
35715  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
35716  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
35717  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
35718  * limit was reached (or NULL, if not needed) */
35719  )
35720 {
35721  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35722 
35723  SCIP_CALL( solveProbingLP(scip, itlim, FALSE, FALSE, FALSE, -1, lperror, cutoff) );
35724 
35725  return SCIP_OKAY;
35726 }
35727 
35728 /** solves the LP at the current probing node (cannot be applied at preprocessing stage) and applies pricing
35729  * until the LP is solved to optimality; no separation is applied
35730  *
35731  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35732  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35733  *
35734  * @pre This method can be called if @p scip is in one of the following stages:
35735  * - \ref SCIP_STAGE_SOLVING
35736  */
35738  SCIP* scip, /**< SCIP data structure */
35739  SCIP_Bool pretendroot, /**< should the pricers be called as if we were at the root node? */
35740  SCIP_Bool displayinfo, /**< should info lines be displayed after each pricing round? */
35741  int maxpricerounds, /**< maximal number of pricing rounds (-1: no limit);
35742  * a finite limit means that the LP might not be solved to optimality! */
35743  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
35744  SCIP_Bool* cutoff /**< pointer to store whether the probing LP was infeasible or the objective
35745  * limit was reached (or NULL, if not needed) */
35746  )
35747 {
35748  SCIP_CALL( checkStage(scip, "SCIPsolveProbingLPWithPricing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35749 
35750  SCIP_CALL( solveProbingLP(scip, -1, TRUE, pretendroot, displayinfo, maxpricerounds, lperror, cutoff) );
35751 
35752  return SCIP_OKAY;
35753 }
35754 
35755 /** adds a row to the LP in the current probing node
35756  *
35757  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35758  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35759  *
35760  * @pre This method can be called if @p scip is in one of the following stages:
35761  * - \ref SCIP_STAGE_SOLVING
35762  *
35763  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35764  */
35766  SCIP* scip, /**< SCIP data structure */
35767  SCIP_ROW* row /**< row to be added */
35768  )
35769 {
35770  SCIP_NODE* node;
35771  int depth;
35772 
35773  assert(scip != NULL);
35774  assert(row != NULL);
35775 
35776  SCIP_CALL( checkStage(scip, "SCIPaddRowProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35777 
35778  if( !SCIPtreeProbing(scip->tree) )
35779  {
35780  SCIPerrorMessage("not in probing mode\n");
35781  return SCIP_INVALIDCALL;
35782  }
35783 
35784  /* get depth of current node */
35785  node = SCIPtreeGetCurrentNode(scip->tree);
35786  assert(node != NULL);
35787  depth = SCIPnodeGetDepth(node);
35788 
35789  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
35790 
35791  return SCIP_OKAY;
35792 }
35793 
35794 
35795 /** applies the cuts in the separation storage to the LP and clears the storage afterwards;
35796  * this method can only be applied during probing; the user should resolve the probing LP afterwards
35797  * in order to get a new solution
35798  *
35799  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35800  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35801  *
35802  * @pre This method can be called if @p scip is in one of the following stages:
35803  * - \ref SCIP_STAGE_SOLVING
35804  */
35806  SCIP* scip, /**< SCIP data structure */
35807  SCIP_Bool* cutoff /**< pointer to store whether an empty domain was created */
35808  )
35809 {
35810  SCIP_CALL( checkStage(scip, "SCIPapplyCutsProbing", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35811 
35812  if( !SCIPtreeProbing(scip->tree) )
35813  {
35814  SCIPerrorMessage("not in probing mode\n");
35815  return SCIP_INVALIDCALL;
35816  }
35817 
35818  SCIP_CALL( SCIPsepastoreApplyCuts(scip->sepastore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
35819  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->eventfilter,
35820  scip->cliquetable, FALSE, SCIP_EFFICIACYCHOICE_LP, cutoff) );
35821 
35822  return SCIP_OKAY;
35823 }
35824 
35825 /** solves relaxation(s) at the current probing node (cannot be applied at preprocessing stage);
35826  * no separation or pricing is applied
35827  *
35828  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35829  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35830  *
35831  * @pre This method can be called if @p scip is in one of the following stages:
35832  * - \ref SCIP_STAGE_SOLVING
35833  */
35835  SCIP* scip, /**< SCIP data structure */
35836  SCIP_Bool* cutoff /**< pointer to store whether a relaxation was infeasible or the objective
35837  * limit was reached (or NULL, if not needed) */
35838  )
35839 {
35840  SCIP_SET* set;
35841  int r;
35842 
35843  SCIP_CALL( checkStage(scip, "SCIPsolveProbingRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35844 
35845  if ( ! SCIPtreeProbing(scip->tree) )
35846  {
35847  SCIPerrorMessage("not in probing mode\n");
35848  return SCIP_INVALIDCALL;
35849  }
35850  assert( SCIPtreeGetCurrentDepth(scip->tree) > 0 );
35851 
35852  assert( cutoff != NULL );
35853  *cutoff = FALSE;
35854 
35855  set = scip->set;
35856 
35857  /* sort relaxators by priority */
35858  SCIPsetSortRelaxs(set);
35859 
35860  /* solve relaxations */
35861  for (r = 0; r < set->nrelaxs && !(*cutoff); ++r)
35862  {
35863  SCIP_RELAX* relax;
35864  SCIP_Real lowerbound;
35865  SCIP_RESULT result;
35866 
35867  lowerbound = -SCIPinfinity(scip);
35868 
35869  relax = set->relaxs[r];
35870  assert( relax != NULL );
35871 
35872  SCIP_CALL( SCIPrelaxExec(relax, set, scip->stat, SCIPtreeGetCurrentDepth(scip->tree), &lowerbound, &result) );
35873 
35874  switch( result )
35875  {
35876  case SCIP_CUTOFF:
35877  *cutoff = TRUE;
35878  SCIPdebugMsg(scip, " -> relaxator <%s> detected cutoff\n", SCIPrelaxGetName(relax));
35879  break;
35880 
35881  case SCIP_CONSADDED:
35882  case SCIP_REDUCEDDOM:
35883  case SCIP_SEPARATED:
35884  case SCIP_SUSPENDED:
35885  SCIPerrorMessage("The relaxator should not return <%d> within probing mode.\n", result);
35886  break;
35887 
35888  case SCIP_SUCCESS:
35889  case SCIP_DIDNOTRUN:
35890  break;
35891 
35892  default:
35893  SCIPerrorMessage("Invalid result code <%d> of relaxator <%s>\n", result, SCIPrelaxGetName(relax));
35894  return SCIP_INVALIDRESULT;
35895  } /*lint !e788*/
35896  }
35897 
35898  return SCIP_OKAY;
35899 }
35900 
35901 /** gets the candidate score and preferred rounding direction for a candidate variable */
35903  SCIP* scip, /**< SCIP data structure */
35904  SCIP_DIVESET* diveset, /**< general diving settings */
35905  SCIP_DIVETYPE divetype, /**< represents different methods for a dive set to explore the next children */
35906  SCIP_VAR* divecand, /**< the candidate for which the branching direction is requested */
35907  SCIP_Real divecandsol, /**< LP solution value of the candidate */
35908  SCIP_Real divecandfrac, /**< fractionality of the candidate */
35909  SCIP_Real* candscore, /**< pointer to store the candidate score */
35910  SCIP_Bool* roundup /**< pointer to store whether preferred direction for diving is upwards */
35911  )
35912 {
35913  assert(scip != NULL);
35914  assert(candscore != NULL);
35915  assert(roundup != NULL);
35916  assert(divecand != NULL);
35917 
35918  SCIP_CALL( checkStage(scip, "SCIPgetDivesetScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35919 
35920  SCIP_CALL( SCIPdivesetGetScore(diveset, scip->set, divetype, divecand, divecandsol, divecandfrac, candscore,
35921  roundup) );
35922 
35923  return SCIP_OKAY;
35924 }
35925 
35926 /** update diveset LP statistics, should be called after every LP solved by this diving heuristic */
35928  SCIP* scip, /**< SCIP data structure */
35929  SCIP_DIVESET* diveset, /**< diving settings */
35930  SCIP_Longint niterstoadd /**< additional number of LP iterations to be added */
35931  )
35932 {
35933  assert(scip != NULL);
35934  assert(diveset != NULL);
35935 
35936  SCIPdivesetUpdateLPStats(diveset, scip->stat, niterstoadd);
35937 }
35938 
35939 /** update diveset statistics and global diveset statistics */
35941  SCIP* scip, /**< SCIP data structure */
35942  SCIP_DIVESET* diveset, /**< diveset to be reset */
35943  int nprobingnodes, /**< the number of probing nodes explored this time */
35944  int nbacktracks, /**< the number of backtracks during probing this time */
35945  SCIP_Longint nsolsfound, /**< the number of solutions found */
35946  SCIP_Longint nbestsolsfound, /**< the number of best solutions found */
35947  SCIP_Bool leavewassol /**< was a solution found at the leaf? */
35948  )
35949 {
35950  assert(scip != NULL);
35951  assert(diveset != NULL);
35952  assert(SCIPinProbing(scip));
35953 
35954  SCIPdivesetUpdateStats(diveset, scip->stat, SCIPgetDepth(scip), nprobingnodes, nbacktracks, nsolsfound, nbestsolsfound, leavewassol);
35955 }
35956 
35957 /** enforces a probing/diving solution by suggesting bound changes that maximize the score w.r.t. the current diving settings
35958  *
35959  * the process is guided by the enforcement priorities of the constraint handlers and the scoring mechanism provided by
35960  * the dive set.
35961  * Constraint handlers may suggest diving bound changes in decreasing order of their enforcement priority, based on the
35962  * solution values in the solution @p sol and the current local bounds of the variables. A diving bound change
35963  * is a triple (variable,branching direction,value) and is used inside SCIPperformGenericDivingAlgorithm().
35964  *
35965  * After a successful call, SCIP holds two arrays of suggested dive bound changes, one for the preferred child
35966  * and one for the alternative.
35967  *
35968  * @see SCIPgetDiveBoundChangeData() for retrieving the dive bound change suggestions.
35969  *
35970  * The method stops after the first constraint handler was successful
35971  *
35972  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
35973  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
35974  *
35975  * @pre This method can be called if @p scip is in one of the following stages:
35976  * - \ref SCIP_STAGE_SOLVING
35977  *
35978  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
35979  */
35981  SCIP* scip, /**< SCIP data structure */
35982  SCIP_DIVESET* diveset, /**< diving settings to control scoring */
35983  SCIP_SOL* sol, /**< current solution of diving mode */
35984  SCIP_Bool* success, /**< pointer to store whether constraint handler successfully found a variable */
35985  SCIP_Bool* infeasible /**< pointer to store whether the current node was detected to be infeasible */
35986  )
35987 {
35988  int i;
35989 
35990  assert(scip != NULL);
35991  assert(diveset != NULL);
35992  assert(SCIPinProbing(scip));
35993  assert(infeasible != NULL);
35994  assert(success != NULL);
35995 
35996  SCIP_CALL( checkStage(scip, "SCIPgetDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
35997 
35998  *success = FALSE;
35999  *infeasible = FALSE;
36000 
36001  /* we invalidate the previously stored bound changes */
36003 
36004  /* loop over constraint handlers until a constraint handler successfully found a variable/value assignment for proceeding
36005  * or a constraint handler detected the infeasibility of the local node
36006  */
36007  for( i = 0; i < scip->set->nconshdlrs && !(*success || *infeasible); ++i )
36008  {
36009  SCIP_CALL( SCIPconshdlrGetDiveBoundChanges(scip->set->conshdlrs_enfo[i], scip->set, diveset, sol,
36010  success, infeasible) );
36011 
36012  }
36013 #ifndef NDEBUG
36014  /* check if the constraint handler correctly assigned values to the dive set */
36015  if( *success )
36016  {
36017  SCIP_VAR** bdchgvars;
36018  SCIP_BRANCHDIR* bdchgdirs;
36019  SCIP_Real* values;
36020  int nbdchanges;
36021  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, TRUE);
36022  assert(nbdchanges > 0);
36023  SCIPtreeGetDiveBoundChangeData(scip->tree, &bdchgvars, &bdchgdirs, &values, &nbdchanges, FALSE);
36024  assert(nbdchanges > 0);
36025  }
36026 #endif
36027 
36028  return SCIP_OKAY;
36029 }
36030 
36031 /** adds a diving bound change to the diving bound change storage of SCIP together with the information if this is a
36032  * bound change for the preferred direction or not
36033  *
36034  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36035  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36036  *
36037  * @pre This method can be called if @p scip is in one of the following stages:
36038  * - \ref SCIP_STAGE_SOLVING
36039  *
36040  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36041  */
36043  SCIP* scip, /**< SCIP data structure */
36044  SCIP_VAR* var, /**< variable to apply the bound change to */
36045  SCIP_BRANCHDIR dir, /**< direction of the bound change */
36046  SCIP_Real value, /**< value to adjust this variable bound to */
36047  SCIP_Bool preferred /**< is this a bound change for the preferred child? */
36048  )
36049 {
36050  assert(scip->tree != NULL);
36051  assert(scip->mem->probmem != NULL);
36052  assert(SCIPinProbing(scip));
36053 
36054  SCIP_CALL( checkStage(scip, "SCIPaddDiveBoundChange", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36055 
36056  SCIP_CALL( SCIPtreeAddDiveBoundChange(scip->tree, scip->mem->probmem, var, dir, value, preferred) );
36057 
36058  return SCIP_OKAY;
36059 }
36060 
36061 /** get the dive bound change data for the preferred or the alternative direction
36062  *
36063  * @pre This method can be called if @p scip is in one of the following stages:
36064  * - \ref SCIP_STAGE_SOLVING
36065  *
36066  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36067  */
36069  SCIP* scip, /**< SCIP data structure */
36070  SCIP_VAR*** variables, /**< pointer to store variables for the specified direction */
36071  SCIP_BRANCHDIR** directions, /**< pointer to store the branching directions */
36072  SCIP_Real** values, /**< pointer to store bound change values */
36073  int* ndivebdchgs, /**< pointer to store the number of dive bound changes */
36074  SCIP_Bool preferred /**< should the dive bound changes for the preferred child be output? */
36075  )
36076 {
36077  assert(variables != NULL);
36078  assert(directions != NULL);
36079  assert(values != NULL);
36080  assert(ndivebdchgs != NULL);
36081  assert(SCIPinProbing(scip));
36082 
36083  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDiveBoundChangeData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36084 
36085  SCIPtreeGetDiveBoundChangeData(scip->tree, variables, directions, values, ndivebdchgs, preferred);
36086 }
36087 
36088 /** clear the dive bound change data structures
36089  *
36090  * @pre This method can be called if @p scip is in one of the following stages:
36091  * - \ref SCIP_STAGE_SOLVING
36092  *
36093  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36094  */
36096  SCIP* scip /**< SCIP data structure */
36097  )
36098 {
36099  assert(scip->tree != NULL);
36100 
36101  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearDiveBoundChanges", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36102 
36104 }
36105 
36106 
36107 /*
36108  * branching methods
36109  */
36110 
36111 /** gets branching candidates for LP solution branching (fractional variables) along with solution values,
36112  * fractionalities, and number of branching candidates; The number of branching candidates does NOT
36113  * account for fractional implicit integer variables which should not be used for branching decisions.
36114  *
36115  * Fractional implicit integer variables are stored at the positions *nlpcands to *nlpcands + *nfracimplvars - 1
36116  *
36117  * branching rules should always select the branching candidate among the first npriolpcands of the candidate
36118  * list
36119  *
36120  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36121  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36122  *
36123  * @pre This method can be called if @p scip is in one of the following stages:
36124  * - \ref SCIP_STAGE_SOLVING
36125  *
36126  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36127  */
36129  SCIP* scip, /**< SCIP data structure */
36130  SCIP_VAR*** lpcands, /**< pointer to store the array of LP branching candidates, or NULL */
36131  SCIP_Real** lpcandssol, /**< pointer to store the array of LP candidate solution values, or NULL */
36132  SCIP_Real** lpcandsfrac, /**< pointer to store the array of LP candidate fractionalities, or NULL */
36133  int* nlpcands, /**< pointer to store the number of LP branching candidates, or NULL */
36134  int* npriolpcands, /**< pointer to store the number of candidates with maximal priority, or NULL */
36135  int* nfracimplvars /**< pointer to store the number of fractional implicit integer variables, or NULL */
36136  )
36137 {
36138  SCIP_CALL( checkStage(scip, "SCIPgetLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36139 
36141  {
36142  SCIPerrorMessage("LP not solved to optimality - solstat=%d\n", SCIPlpGetSolstat(scip->lp));
36143  return SCIP_INVALIDDATA;
36144  }
36145 
36146  SCIP_CALL( SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
36147  lpcands, lpcandssol, lpcandsfrac, nlpcands, npriolpcands, nfracimplvars) );
36148 
36149  return SCIP_OKAY;
36150 }
36151 
36152 /** gets number of branching candidates for LP solution branching (number of fractional variables)
36153  *
36154  * @return the number of branching candidates for LP solution branching (number of fractional variables).
36155  *
36156  * @pre This method can be called if @p scip is in one of the following stages:
36157  * - \ref SCIP_STAGE_SOLVING
36158  *
36159  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36160  */
36162  SCIP* scip /**< SCIP data structure */
36163  )
36164 {
36165  SCIP_RETCODE retcode;
36166  int nlpcands;
36167 
36168  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36169 
36171  {
36172  SCIPerrorMessage("LP not solved to optimality\n");
36173  SCIPABORT();
36174  return 0; /*lint !e527*/
36175  }
36176 
36177  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
36178  NULL, NULL, NULL, &nlpcands, NULL, NULL);
36179 
36180  if( retcode != SCIP_OKAY )
36181  {
36182  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates\n", retcode);
36183  SCIPABORT();
36184  return 0; /*lint !e527*/
36185  }
36186 
36187  return nlpcands;
36188 }
36189 
36190 /** gets number of branching candidates with maximal priority for LP solution branching
36191  *
36192  * @return the number of branching candidates with maximal priority for LP solution branching.
36193  *
36194  * @pre This method can be called if @p scip is in one of the following stages:
36195  * - \ref SCIP_STAGE_SOLVING
36196  *
36197  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36198  */
36200  SCIP* scip /**< SCIP data structure */
36201  )
36202 {
36203  SCIP_RETCODE retcode;
36204  int npriolpcands;
36205 
36206  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioLPBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36207 
36209  {
36210  SCIPerrorMessage("LP not solved to optimality\n");
36211  SCIPABORT();
36212  return 0; /*lint !e527*/
36213  }
36214 
36215  retcode = SCIPbranchcandGetLPCands(scip->branchcand, scip->set, scip->stat, scip->lp,
36216  NULL, NULL, NULL, NULL, &npriolpcands, NULL);
36217 
36218  if( retcode != SCIP_OKAY )
36219  {
36220  SCIPerrorMessage("Error <%u> during computation of the number of LP branching candidates with maximal priority\n", retcode);
36221  SCIPABORT();
36222  return 0; /*lint !e527*/
36223  }
36224 
36225  return npriolpcands;
36226 }
36227 
36228 /** gets external branching candidates along with solution values, scores, and number of branching candidates;
36229  * these branching candidates can be used by relaxations or nonlinear constraint handlers;
36230  * branching rules should always select the branching candidate among the first nprioexterncands of the candidate
36231  * list
36232  *
36233  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36234  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36235  *
36236  * @pre This method can be called if @p scip is in one of the following stages:
36237  * - \ref SCIP_STAGE_SOLVING
36238  *
36239  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36240  *
36241  * @note Candidate variables with maximal priority are ordered: binaries first, then integers, implicit integers and
36242  * continuous last.
36243  */
36245  SCIP* scip, /**< SCIP data structure */
36246  SCIP_VAR*** externcands, /**< pointer to store the array of extern branching candidates, or NULL */
36247  SCIP_Real** externcandssol, /**< pointer to store the array of extern candidate solution values, or NULL */
36248  SCIP_Real** externcandsscore, /**< pointer to store the array of extern candidate scores, or NULL */
36249  int* nexterncands, /**< pointer to store the number of extern branching candidates, or NULL */
36250  int* nprioexterncands, /**< pointer to store the number of candidates with maximal priority, or NULL */
36251  int* nprioexternbins, /**< pointer to store the number of binary candidates with maximal priority, or NULL */
36252  int* nprioexternints, /**< pointer to store the number of integer candidates with maximal priority, or NULL */
36253  int* nprioexternimpls /**< pointer to store the number of implicit integer candidates with maximal priority,
36254  * or NULL */
36255  )
36256 {
36257  assert(scip != NULL);
36258 
36259  SCIP_CALL( checkStage(scip, "SCIPgetExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36260 
36261  SCIP_CALL( SCIPbranchcandGetExternCands(scip->branchcand, externcands, externcandssol, externcandsscore, nexterncands,
36262  nprioexterncands, nprioexternbins, nprioexternints, nprioexternimpls) );
36263 
36264  return SCIP_OKAY;
36265 }
36266 
36267 /** gets number of external branching candidates
36268  *
36269  * @return the number of external branching candidates.
36270  *
36271  * @pre This method can be called if @p scip is in one of the following stages:
36272  * - \ref SCIP_STAGE_SOLVING
36273  *
36274  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36275  */
36277  SCIP* scip /**< SCIP data structure */
36278  )
36279 {
36280  assert(scip != NULL);
36281 
36282  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36283 
36285 }
36286 
36287 /** gets number of external branching candidates with maximal branch priority
36288  *
36289  * @return the number of external branching candidates with maximal branch priority.
36290  *
36291  * @pre This method can be called if @p scip is in one of the following stages:
36292  * - \ref SCIP_STAGE_SOLVING
36293  *
36294  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36295  */
36297  SCIP* scip /**< SCIP data structure */
36298  )
36299 {
36300  assert(scip != NULL);
36301 
36302  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36303 
36305 }
36306 
36307 /** gets number of binary external branching candidates with maximal branch priority
36308  *
36309  * @return the number of binary external branching candidates with maximal branch priority.
36310  *
36311  * @pre This method can be called if @p scip is in one of the following stages:
36312  * - \ref SCIP_STAGE_SOLVING
36313  *
36314  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36315  */
36317  SCIP* scip /**< SCIP data structure */
36318  )
36319 {
36320  assert(scip != NULL);
36321 
36322  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36323 
36325 }
36326 
36327 
36328 /** gets number of integer external branching candidates with maximal branch priority
36329  *
36330  * @return the number of integer external branching candidates with maximal branch priority.
36331  *
36332  * @pre This method can be called if @p scip is in one of the following stages:
36333  * - \ref SCIP_STAGE_SOLVING
36334  *
36335  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36336  */
36338  SCIP* scip /**< SCIP data structure */
36339  )
36340 {
36341  assert(scip != NULL);
36342 
36343  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36344 
36346 }
36347 
36348 /** gets number of implicit integer external branching candidates with maximal branch priority
36349  *
36350  * @return the number of implicit integer external branching candidates with maximal branch priority.
36351  *
36352  * @pre This method can be called if @p scip is in one of the following stages:
36353  * - \ref SCIP_STAGE_SOLVING
36354  *
36355  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36356  */
36358  SCIP* scip /**< SCIP data structure */
36359  )
36360 {
36361  assert(scip != NULL);
36362 
36363  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36364 
36366 }
36367 
36368 /** gets number of continuous external branching candidates with maximal branch priority
36369  *
36370  * @return the number of continuous external branching candidates with maximal branch priority.
36371  *
36372  * @pre This method can be called if @p scip is in one of the following stages:
36373  * - \ref SCIP_STAGE_SOLVING
36374  *
36375  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36376  */
36378  SCIP* scip /**< SCIP data structure */
36379  )
36380 {
36381  assert(scip != NULL);
36382 
36383  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioExternBranchConts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36384 
36386 }
36387 
36388 /** insert variable, its score and its solution value into the external branching candidate storage
36389  * the relative difference of the current lower and upper bounds of a continuous variable must be at least epsilon
36390  *
36391  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36392  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36393  *
36394  * @pre This method can be called if @p scip is in one of the following stages:
36395  * - \ref SCIP_STAGE_SOLVING
36396  *
36397  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36398  */
36400  SCIP* scip, /**< SCIP data structure */
36401  SCIP_VAR* var, /**< variable to insert */
36402  SCIP_Real score, /**< score of external candidate, e.g. infeasibility */
36403  SCIP_Real solval /**< value of the variable in the current solution */
36404  )
36405 {
36406  assert(scip != NULL);
36407  assert(var->scip == scip);
36408 
36409  SCIP_CALL( checkStage(scip, "SCIPaddExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36410 
36411  SCIP_CALL( SCIPbranchcandAddExternCand(scip->branchcand, scip->set, var, score, solval) );
36412 
36413  return SCIP_OKAY;
36414 }
36415 
36416 /** removes all external candidates from the storage for external branching
36417  *
36418  * @pre This method can be called if @p scip is in one of the following stages:
36419  * - \ref SCIP_STAGE_SOLVING
36420  *
36421  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36422  */
36424  SCIP* scip /**< SCIP data structure */
36425  )
36426 {
36427  assert(scip != NULL);
36428 
36429  SCIP_CALL_ABORT( checkStage(scip, "SCIPclearExternBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36430 
36432 }
36433 
36434 /** checks whether the given variable is contained in the candidate storage for external branching
36435  *
36436  * @return whether the given variable is contained in the candidate storage for external branching.
36437  *
36438  * @pre This method can be called if @p scip is in one of the following stages:
36439  * - \ref SCIP_STAGE_SOLVING
36440  *
36441  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36442  */
36444  SCIP* scip, /**< SCIP data structure */
36445  SCIP_VAR* var /**< variable to look for */
36446  )
36447 {
36448  assert(scip != NULL);
36449  assert(var->scip == scip);
36450 
36451  SCIP_CALL_ABORT( checkStage(scip, "SCIPcontainsExternBranchCand", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36452 
36453  return SCIPbranchcandContainsExternCand(scip->branchcand, var);
36454 }
36455 
36456 /** gets branching candidates for pseudo solution branching (non-fixed variables) along with the number of candidates
36457  *
36458  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36459  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36460  *
36461  * @pre This method can be called if @p scip is in one of the following stages:
36462  * - \ref SCIP_STAGE_PRESOLVING
36463  * - \ref SCIP_STAGE_SOLVING
36464  *
36465  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36466  */
36468  SCIP* scip, /**< SCIP data structure */
36469  SCIP_VAR*** pseudocands, /**< pointer to store the array of pseudo branching candidates, or NULL */
36470  int* npseudocands, /**< pointer to store the number of pseudo branching candidates, or NULL */
36471  int* npriopseudocands /**< pointer to store the number of candidates with maximal priority, or NULL */
36472  )
36473 {
36474  SCIP_CALL( checkStage(scip, "SCIPgetPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36475 
36477  pseudocands, npseudocands, npriopseudocands) );
36478 
36479  return SCIP_OKAY;
36480 }
36481 
36482 /** gets number of branching candidates for pseudo solution branching (non-fixed variables)
36483  *
36484  * @return the number branching candidates for pseudo solution branching (non-fixed variables).
36485  *
36486  * @pre This method can be called if @p scip is in one of the following stages:
36487  * - \ref SCIP_STAGE_PRESOLVING
36488  * - \ref SCIP_STAGE_SOLVING
36489  *
36490  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36491  */
36493  SCIP* scip /**< SCIP data structure */
36494  )
36495 {
36496  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36497 
36499 }
36500 
36501 /** gets number of branching candidates with maximal branch priority for pseudo solution branching
36502  *
36503  * @return the number of branching candidates with maximal branch priority for pseudo solution branching.
36504  *
36505  * @pre This method can be called if @p scip is in one of the following stages:
36506  * - \ref SCIP_STAGE_PRESOLVING
36507  * - \ref SCIP_STAGE_SOLVING
36508  *
36509  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36510  */
36512  SCIP* scip /**< SCIP data structure */
36513  )
36514 {
36515  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchCands", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36516 
36518 }
36519 
36520 /** gets number of binary branching candidates with maximal branch priority for pseudo solution branching
36521  *
36522  * @return the number of binary branching candidates with maximal branch priority for pseudo solution branching.
36523  *
36524  * @pre This method can be called if @p scip is in one of the following stages:
36525  * - \ref SCIP_STAGE_SOLVING
36526  *
36527  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36528  */
36530  SCIP* scip /**< SCIP data structure */
36531  )
36532 {
36533  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchBins", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36534 
36536 }
36537 
36538 /** gets number of integer branching candidates with maximal branch priority for pseudo solution branching
36539  *
36540  * @return the number of integer branching candidates with maximal branch priority for pseudo solution branching.
36541  *
36542  * @pre This method can be called if @p scip is in one of the following stages:
36543  * - \ref SCIP_STAGE_SOLVING
36544  *
36545  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36546  */
36548  SCIP* scip /**< SCIP data structure */
36549  )
36550 {
36551  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchInts", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36552 
36554 }
36555 
36556 /** gets number of implicit integer branching candidates with maximal branch priority for pseudo solution branching
36557  *
36558  * @return the number of implicit integer branching candidates with maximal branch priority for pseudo solution branching.
36559  *
36560  * @pre This method can be called if @p scip is in one of the following stages:
36561  * - \ref SCIP_STAGE_SOLVING
36562  *
36563  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36564  */
36566  SCIP* scip /**< SCIP data structure */
36567  )
36568 {
36569  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrioPseudoBranchImpls", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36570 
36572 }
36573 
36574 /** calculates the branching score out of the gain predictions for a binary branching
36575  *
36576  * @return the branching score out of the gain predictions for a binary branching.
36577  *
36578  * @pre This method can be called if @p scip is in one of the following stages:
36579  * - \ref SCIP_STAGE_SOLVING
36580  *
36581  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36582  */
36584  SCIP* scip, /**< SCIP data structure */
36585  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
36586  SCIP_Real downgain, /**< prediction of objective gain for rounding downwards */
36587  SCIP_Real upgain /**< prediction of objective gain for rounding upwards */
36588  )
36589 {
36590  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36591 
36592  assert( var == NULL || var->scip == scip );
36593 
36594  return SCIPbranchGetScore(scip->set, var, downgain, upgain);
36595 }
36596 
36597 /** calculates the branching score out of the gain predictions for a branching with arbitrary many children
36598  *
36599  * @return the branching score out of the gain predictions for a branching with arbitrary many children.
36600  *
36601  * @pre This method can be called if @p scip is in one of the following stages:
36602  * - \ref SCIP_STAGE_SOLVING
36603  *
36604  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36605  */
36607  SCIP* scip, /**< SCIP data structure */
36608  SCIP_VAR* var, /**< variable, of which the branching factor should be applied, or NULL */
36609  int nchildren, /**< number of children that the branching will create */
36610  SCIP_Real* gains /**< prediction of objective gain for each child */
36611  )
36612 {
36613  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchScoreMultiple", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36614 
36615  assert( var->scip == scip );
36616 
36617  return SCIPbranchGetScoreMultiple(scip->set, var, nchildren, gains);
36618 }
36619 
36620 /** computes a branching point for a continuous or discrete variable
36621  *
36622  * @see SCIPbranchGetBranchingPoint
36623  *
36624  * @return the branching point for a continuous or discrete variable.
36625  *
36626  * @pre This method can be called if @p scip is in one of the following stages:
36627  * - \ref SCIP_STAGE_SOLVING
36628  *
36629  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36630  */
36632  SCIP* scip, /**< SCIP data structure */
36633  SCIP_VAR* var, /**< variable, of which the branching point should be computed */
36634  SCIP_Real suggestion /**< suggestion for branching point, or SCIP_INVALID if no suggestion */
36635  )
36636 {
36637  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBranchingPoint", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36638 
36639  assert( var->scip == scip );
36640 
36641  return SCIPbranchGetBranchingPoint(scip->set, scip->tree, var, suggestion);
36642 }
36643 
36644 /** calculates the node selection priority for moving the given variable's LP value to the given target value;
36645  * this node selection priority can be given to the SCIPcreateChild() call
36646  *
36647  * @return the node selection priority for moving the given variable's LP value to the given target value.
36648  *
36649  * @pre This method can be called if @p scip is in one of the following stages:
36650  * - \ref SCIP_STAGE_SOLVING
36651  *
36652  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36653  */
36655  SCIP* scip, /**< SCIP data structure */
36656  SCIP_VAR* var, /**< variable on which the branching is applied */
36657  SCIP_BRANCHDIR branchdir, /**< type of branching that was performed: upwards, downwards, or fixed;
36658  * fixed should only be used, when both bounds changed
36659  */
36660  SCIP_Real targetvalue /**< new value of the variable in the child node */
36661  )
36662 {
36663  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcNodeselPriority", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36664 
36665  assert( var->scip == scip );
36666 
36667  return SCIPtreeCalcNodeselPriority(scip->tree, scip->set, scip->stat, var, branchdir, targetvalue);
36668 }
36669 
36670 /** calculates an estimate for the objective of the best feasible solution contained in the subtree after applying the given
36671  * branching; this estimate can be given to the SCIPcreateChild() call
36672  *
36673  * @return the estimate for the objective of the best feasible solution contained in the subtree after applying the given
36674  * branching.
36675  *
36676  * @pre This method can be called if @p scip is in one of the following stages:
36677  * - \ref SCIP_STAGE_SOLVING
36678  *
36679  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36680  */
36682  SCIP* scip, /**< SCIP data structure */
36683  SCIP_VAR* var, /**< variable on which the branching is applied */
36684  SCIP_Real targetvalue /**< new value of the variable in the child node */
36685  )
36686 {
36687  SCIP_CALL_ABORT( checkStage(scip, "SCIPcalcChildEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36688 
36689  assert( var->scip == scip );
36690 
36691  return SCIPtreeCalcChildEstimate(scip->tree, scip->set, scip->stat, var, targetvalue);
36692 }
36693 
36694 /** creates a child node of the focus node
36695  *
36696  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36697  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36698  *
36699  * @pre This method can be called if @p scip is in one of the following stages:
36700  * - \ref SCIP_STAGE_SOLVING
36701  *
36702  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36703  */
36705  SCIP* scip, /**< SCIP data structure */
36706  SCIP_NODE** node, /**< pointer to node data structure */
36707  SCIP_Real nodeselprio, /**< node selection priority of new node */
36708  SCIP_Real estimate /**< estimate for(transformed) objective value of best feasible solution in subtree */
36709  )
36710 {
36711  assert(node != NULL);
36712 
36713  SCIP_CALL( checkStage(scip, "SCIPcreateChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36714 
36715  SCIP_CALL( SCIPnodeCreateChild(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, nodeselprio, estimate) );
36716 
36717  return SCIP_OKAY;
36718 }
36719 
36720 /** branches on a non-continuous variable v using the current LP or pseudo solution;
36721  * if solution value x' is fractional, two child nodes will be created
36722  * (x <= floor(x'), x >= ceil(x')),
36723  * if solution value is integral, the x' is equal to lower or upper bound of the branching
36724  * variable and the bounds of v are finite, then two child nodes will be created
36725  * (x <= x'', x >= x''+1 with x'' = floor((lb + ub)/2)),
36726  * otherwise (up to) three child nodes will be created
36727  * (x <= x'-1, x == x', x >= x'+1)
36728  *
36729  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36730  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36731  *
36732  * @pre This method can be called if @p scip is in one of the following stages:
36733  * - \ref SCIP_STAGE_SOLVING
36734  *
36735  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36736  */
36738  SCIP* scip, /**< SCIP data structure */
36739  SCIP_VAR* var, /**< variable to branch on */
36740  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
36741  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
36742  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
36743  )
36744 {
36745  SCIP_CALL( checkStage(scip, "SCIPbranchVar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36746 
36747  assert( var->scip == scip );
36748 
36750  {
36751  SCIPerrorMessage("cannot branch on continuous variable <%s>\n", SCIPvarGetName(var));
36752  return SCIP_INVALIDDATA;
36753  }
36754 
36755  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
36756  {
36757  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
36759  return SCIP_INVALIDDATA;
36760  }
36761 
36762  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
36763  scip->lp, scip->branchcand, scip->eventqueue, var, SCIP_INVALID, downchild, eqchild, upchild) );
36764 
36765  return SCIP_OKAY;
36766 }
36767 
36768 /** branches a variable x using a given domain hole; two child nodes (x <= left, x >= right) are created
36769  *
36770  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36771  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36772  *
36773  * @pre This method can be called if @p scip is in one of the following stages:
36774  * - \ref SCIP_STAGE_SOLVING
36775  *
36776  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36777  */
36779  SCIP* scip, /**< SCIP data structure */
36780  SCIP_VAR* var, /**< variable to branch on */
36781  SCIP_Real left, /**< left side of the domain hole */
36782  SCIP_Real right, /**< right side of the domain hole */
36783  SCIP_NODE** downchild, /**< pointer to return the left child (x <= left), or NULL */
36784  SCIP_NODE** upchild /**< pointer to return the right child (x >= right), or NULL */
36785  )
36786 {
36787  SCIP_CALL( checkStage(scip, "SCIPbranchVarHole", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36788 
36789  assert( var->scip == scip );
36790 
36791  SCIP_CALL( SCIPtreeBranchVarHole(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
36792  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, left, right, downchild, upchild) );
36793 
36794  return SCIP_OKAY;
36795 }
36796 
36797 /** branches on a variable x using a given value x';
36798  * for continuous variables with relative domain width larger epsilon, x' must not be one of the bounds;
36799  * two child nodes (x <= x', x >= x') are created;
36800  * for integer variables, if solution value x' is fractional, two child nodes are created
36801  * (x <= floor(x'), x >= ceil(x')),
36802  * if x' is integral, three child nodes are created
36803  * (x <= x'-1, x == x', x >= x'+1)
36804  *
36805  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36806  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36807  *
36808  * @pre This method can be called if @p scip is in one of the following stages:
36809  * - \ref SCIP_STAGE_SOLVING
36810  *
36811  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36812  */
36814  SCIP* scip, /**< SCIP data structure */
36815  SCIP_VAR* var, /**< variable to branch on */
36816  SCIP_Real val, /**< value to branch on */
36817  SCIP_NODE** downchild, /**< pointer to return the left child with variable rounded down, or NULL */
36818  SCIP_NODE** eqchild, /**< pointer to return the middle child with variable fixed, or NULL */
36819  SCIP_NODE** upchild /**< pointer to return the right child with variable rounded up, or NULL */
36820  )
36821 {
36822  SCIP_CALL( checkStage(scip, "SCIPbranchVarVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36823 
36824  assert( var->scip == scip );
36825 
36826  /* A continuous variable will be fixed if SCIPisRelEQ(lb,ub) is true. Otherwise, the given branching value should be
36827  * 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
36828  * 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
36829  * branching value that is at least eps away from both bounds. However, if the variable bounds are below/above
36830  * -/+infinity * 2.1, then SCIPisLT will give an assert, so we omit the check in this case.
36831  */
36832  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
36833  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
36834  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
36835  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
36836 
36837  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
36838  {
36839  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
36841  return SCIP_INVALIDDATA;
36842  }
36843 
36844  SCIP_CALL( SCIPtreeBranchVar(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
36845  scip->lp, scip->branchcand, scip->eventqueue, var, val, downchild, eqchild, upchild) );
36846 
36847  return SCIP_OKAY;
36848 }
36849 
36850 /** n-ary branching on a variable x using a given value
36851  *
36852  * Branches on variable x such that up to n/2 children are created on each side of the usual branching value.
36853  * The branching value is selected as in SCIPbranchVarVal().
36854  * The parameters minwidth and widthfactor determine the domain width of the branching variable in the child nodes.
36855  * If n is odd, one child with domain width 'width' and having the branching value in the middle is created.
36856  * Otherwise, two children with domain width 'width' and being left and right of the branching value are created.
36857  * Next further nodes to the left and right are created, where width is multiplied by widthfactor with increasing distance
36858  * from the first nodes.
36859  * The initial width is calculated such that n/2 nodes are created to the left and to the right of the branching value.
36860  * If this value is below minwidth, the initial width is set to minwidth, which may result in creating less than n nodes.
36861  *
36862  * Giving a large value for widthfactor results in creating children with small domain when close to the branching value
36863  * and large domain when closer to the current variable bounds. That is, setting widthfactor to a very large value and n to 3
36864  * results in a ternary branching where the branching variable is mostly fixed in the middle child.
36865  * Setting widthfactor to 1.0 results in children where the branching variable always has the same domain width
36866  * (except for one child if the branching value is not in the middle).
36867  *
36868  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36869  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36870  *
36871  * @pre This method can be called if @p scip is in one of the following stages:
36872  * - \ref SCIP_STAGE_SOLVING
36873  *
36874  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36875  */
36877  SCIP* scip, /**< SCIP data structure */
36878  SCIP_VAR* var, /**< variable to branch on */
36879  SCIP_Real val, /**< value to branch on */
36880  int n, /**< attempted number of children to be created, must be >= 2 */
36881  SCIP_Real minwidth, /**< minimal domain width in children */
36882  SCIP_Real widthfactor, /**< multiplier for children domain width with increasing distance from val, must be >= 1.0 */
36883  int* nchildren /**< pointer to store number of created children, or NULL */
36884  )
36885 {
36886  SCIP_CALL( checkStage(scip, "SCIPbranchVarValNary", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36887 
36888  assert( var->scip == scip );
36889 
36890  /* see comment in SCIPbranchVarVal */
36891  assert(SCIPvarGetType(var) != SCIP_VARTYPE_CONTINUOUS ||
36892  SCIPisRelEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) ||
36893  SCIPisInfinity(scip, -2.1*SCIPvarGetLbLocal(var)) || SCIPisInfinity(scip, 2.1*SCIPvarGetUbLocal(var)) ||
36894  (SCIPisLT(scip, 2.1*SCIPvarGetLbLocal(var), 2.1*val) && SCIPisLT(scip, 2.1*val, 2.1*SCIPvarGetUbLocal(var)) ) );
36895 
36896  if( SCIPsetIsEQ(scip->set, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
36897  {
36898  SCIPerrorMessage("cannot branch on variable <%s> with fixed domain [%.15g,%.15g]\n",
36900  return SCIP_INVALIDDATA;
36901  }
36902 
36903  SCIP_CALL( SCIPtreeBranchVarNary(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
36904  scip->origprob, scip->lp, scip->branchcand, scip->eventqueue, var, val, n, minwidth, widthfactor, nchildren) );
36905 
36906  return SCIP_OKAY;
36907 }
36908 
36909 /** calls branching rules to branch on an LP solution; if no fractional variables exist, the result is SCIP_DIDNOTRUN;
36910  * if the branch priority of an unfixed variable is larger than the maximal branch priority of the fractional
36911  * variables, pseudo solution branching is applied on the unfixed variables with maximal branch priority
36912  *
36913  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36914  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36915  *
36916  * @pre This method can be called if @p scip is in one of the following stages:
36917  * - \ref SCIP_STAGE_SOLVING
36918  *
36919  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36920  */
36922  SCIP* scip, /**< SCIP data structure */
36923  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
36924  )
36925 {
36926  SCIP_CALL( checkStage(scip, "SCIPbranchLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36927 
36928  SCIP_CALL( SCIPbranchExecLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
36929  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
36930  TRUE, result) );
36931 
36932  return SCIP_OKAY;
36933 }
36934 
36935 /** calls branching rules to branch on a external candidates; if no such candidates exist, the result is SCIP_DIDNOTRUN
36936  *
36937  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36938  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36939  *
36940  * @pre This method can be called if @p scip is in one of the following stages:
36941  * - \ref SCIP_STAGE_SOLVING
36942  *
36943  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36944  */
36946  SCIP* scip, /**< SCIP data structure */
36947  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
36948  )
36949 {
36950  SCIP_CALL( checkStage(scip, "SCIPbranchExtern", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36951 
36952  SCIP_CALL( SCIPbranchExecExtern(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
36953  scip->tree, scip->reopt, scip->lp, scip->sepastore, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound,
36954  TRUE, result) );
36955 
36956  return SCIP_OKAY;
36957 }
36958 
36959 /** calls branching rules to branch on a pseudo solution; if no unfixed variables exist, the result is SCIP_DIDNOTRUN
36960  *
36961  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36962  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36963  *
36964  * @pre This method can be called if @p scip is in one of the following stages:
36965  * - \ref SCIP_STAGE_SOLVING
36966  *
36967  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
36968  */
36970  SCIP* scip, /**< SCIP data structure */
36971  SCIP_RESULT* result /**< pointer to store the result of the branching (s. branch.h) */
36972  )
36973 {
36974  SCIP_CALL( checkStage(scip, "SCIPbranchPseudo", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
36975 
36976  SCIP_CALL( SCIPbranchExecPseudo(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
36977  scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->primal->cutoffbound, TRUE, result) );
36978 
36979  return SCIP_OKAY;
36980 }
36981 
36982 
36983 
36984 
36985 /*
36986  * primal solutions
36987  */
36988 
36989 /** creates a primal solution, initialized to zero
36990  *
36991  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
36992  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
36993  *
36994  * @pre This method can be called if SCIP is in one of the following stages:
36995  * - \ref SCIP_STAGE_PROBLEM
36996  * - \ref SCIP_STAGE_TRANSFORMING
36997  * - \ref SCIP_STAGE_TRANSFORMED
36998  * - \ref SCIP_STAGE_INITPRESOLVE
36999  * - \ref SCIP_STAGE_PRESOLVING
37000  * - \ref SCIP_STAGE_EXITPRESOLVE
37001  * - \ref SCIP_STAGE_PRESOLVED
37002  * - \ref SCIP_STAGE_INITSOLVE
37003  * - \ref SCIP_STAGE_SOLVING
37004  */
37006  SCIP* scip, /**< SCIP data structure */
37007  SCIP_SOL** sol, /**< pointer to store the solution */
37008  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37009  )
37010 {
37011  SCIP_CALL( checkStage(scip, "SCIPcreateSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37012 
37013  switch( scip->set->stage )
37014  {
37015  case SCIP_STAGE_PROBLEM:
37016  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
37017  return SCIP_OKAY;
37018 
37022  case SCIP_STAGE_PRESOLVING:
37024  case SCIP_STAGE_PRESOLVED:
37025  case SCIP_STAGE_INITSOLVE:
37026  case SCIP_STAGE_SOLVING:
37027  SCIP_CALL( SCIPsolCreate(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
37028  return SCIP_OKAY;
37029 
37030  case SCIP_STAGE_SOLVED:
37031  case SCIP_STAGE_EXITSOLVE:
37032  case SCIP_STAGE_FREETRANS:
37033  default:
37034  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
37035  return SCIP_INVALIDDATA;
37036  } /*lint !e788*/
37037 }
37038 
37039 /** creates a primal solution, initialized to the current LP solution
37040  *
37041  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37042  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37043  *
37044  * @pre This method can be called if SCIP is in one of the following stages:
37045  * - \ref SCIP_STAGE_SOLVING
37046  */
37048  SCIP* scip, /**< SCIP data structure */
37049  SCIP_SOL** sol, /**< pointer to store the solution */
37050  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37051  )
37052 {
37053  SCIP_CALL( checkStage(scip, "SCIPcreateLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37054 
37055  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
37056  {
37057  SCIPerrorMessage("LP solution does not exist\n");
37058  return SCIP_INVALIDCALL;
37059  }
37060 
37061  SCIP_CALL( SCIPsolCreateLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
37062  scip->tree, scip->lp, heur) );
37063 
37064  return SCIP_OKAY;
37065 }
37066 
37067 /** creates a primal solution, initialized to the current NLP solution
37068  *
37069  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37070  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37071  *
37072  * @pre This method can be called if SCIP is in one of the following stages:
37073  * - \ref SCIP_STAGE_SOLVING
37074  */
37076  SCIP* scip, /**< SCIP data structure */
37077  SCIP_SOL** sol, /**< pointer to store the solution */
37078  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37079  )
37080 {
37081  SCIP_CALL( checkStage(scip, "SCIPcreateNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37082 
37083  if( !SCIPisNLPConstructed(scip) )
37084  {
37085  SCIPerrorMessage("NLP does not exist\n");
37086  return SCIP_INVALIDCALL;
37087  }
37088  assert(scip->nlp != NULL);
37089 
37090  if( !SCIPnlpHasSolution(scip->nlp) )
37091  {
37092  SCIPerrorMessage("NLP solution does not exist\n");
37093  return SCIP_INVALIDCALL;
37094  }
37095 
37096  SCIP_CALL( SCIPsolCreateNLPSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->nlp,
37097  heur) );
37098 
37099  return SCIP_OKAY;
37100 }
37101 
37102 /** creates a primal solution, initialized to the current relaxation solution
37103  *
37104  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37105  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37106  *
37107  * @pre This method can be called if SCIP is in one of the following stages:
37108  * - \ref SCIP_STAGE_SOLVING
37109  */
37111  SCIP* scip, /**< SCIP data structure */
37112  SCIP_SOL** sol, /**< pointer to store the solution */
37113  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37114  )
37115 {
37116  SCIP_CALL( checkStage(scip, "SCIPcreateRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37117 
37118  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
37119  {
37120  SCIPerrorMessage("relaxation solution is not valid\n");
37121  return SCIP_INVALIDCALL;
37122  }
37123 
37124  SCIP_CALL( SCIPsolCreateRelaxSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, scip->relaxation, heur) );
37125 
37126  return SCIP_OKAY;
37127 }
37128 
37129 /** creates a primal solution, initialized to the current pseudo solution
37130  *
37131  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37132  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37133  *
37134  * @pre This method can be called if SCIP is in one of the following stages:
37135  * - \ref SCIP_STAGE_SOLVING
37136  */
37138  SCIP* scip, /**< SCIP data structure */
37139  SCIP_SOL** sol, /**< pointer to store the solution */
37140  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37141  )
37142 {
37143  SCIP_CALL( checkStage(scip, "SCIPcreatePseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37144 
37145  SCIP_CALL( SCIPsolCreatePseudoSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
37146  scip->tree, scip->lp, heur) );
37147 
37148  return SCIP_OKAY;
37149 }
37150 
37151 /** creates a primal solution, initialized to the current LP or pseudo solution, depending on whether the LP was solved
37152  * at the current node
37153  *
37154  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37155  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37156  *
37157  * @pre This method can be called if SCIP is in one of the following stages:
37158  * - \ref SCIP_STAGE_SOLVING
37159  */
37161  SCIP* scip, /**< SCIP data structure */
37162  SCIP_SOL** sol, /**< pointer to store the solution */
37163  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37164  )
37165 {
37166  SCIP_CALL( checkStage(scip, "SCIPcreateCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37167 
37168  SCIP_CALL( SCIPsolCreateCurrentSol(sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
37169  scip->tree, scip->lp, heur) );
37170 
37171  return SCIP_OKAY;
37172 }
37173 
37174 /** creates a partial primal solution, initialized to unknown values
37175  *
37176  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37177  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37178  *
37179  * @pre This method can be called if SCIP is in one of the following stages:
37180  * - \ref SCIP_STAGE_PROBLEM
37181  */
37183  SCIP* scip, /**< SCIP data structure */
37184  SCIP_SOL** sol, /**< pointer to store the solution */
37185  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37186  )
37187 {
37188  SCIP_CALL( checkStage(scip, "SCIPcreatePartialSol", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
37189 
37190  SCIP_CALL( SCIPsolCreatePartial(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal, heur) );
37191 
37192  return SCIP_OKAY;
37193 }
37194 
37195 /** creates a primal solution, initialized to unknown values
37196  *
37197  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37198  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37199  *
37200  * @pre This method can be called if SCIP is in one of the following stages:
37201  * - \ref SCIP_STAGE_TRANSFORMING
37202  * - \ref SCIP_STAGE_TRANSFORMED
37203  * - \ref SCIP_STAGE_INITPRESOLVE
37204  * - \ref SCIP_STAGE_PRESOLVING
37205  * - \ref SCIP_STAGE_EXITPRESOLVE
37206  * - \ref SCIP_STAGE_PRESOLVED
37207  * - \ref SCIP_STAGE_INITSOLVE
37208  * - \ref SCIP_STAGE_SOLVING
37209  */
37211  SCIP* scip, /**< SCIP data structure */
37212  SCIP_SOL** sol, /**< pointer to store the solution */
37213  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37214  )
37215 {
37216  SCIP_CALL( checkStage(scip, "SCIPcreateUnknownSol", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37217 
37218  SCIP_CALL( SCIPsolCreateUnknown(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, scip->tree, heur) );
37219 
37220  return SCIP_OKAY;
37221 }
37222 
37223 /** creates a primal solution living in the original problem space, initialized to zero;
37224  * a solution in original space allows to set original variables to values that would be invalid in the
37225  * transformed problem due to preprocessing fixings or aggregations
37226  *
37227  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37228  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37229  *
37230  * @pre This method can be called if SCIP is in one of the following stages:
37231  * - \ref SCIP_STAGE_PROBLEM
37232  * - \ref SCIP_STAGE_TRANSFORMING
37233  * - \ref SCIP_STAGE_TRANSFORMED
37234  * - \ref SCIP_STAGE_INITPRESOLVE
37235  * - \ref SCIP_STAGE_PRESOLVING
37236  * - \ref SCIP_STAGE_EXITPRESOLVE
37237  * - \ref SCIP_STAGE_PRESOLVED
37238  * - \ref SCIP_STAGE_INITSOLVE
37239  * - \ref SCIP_STAGE_SOLVING
37240  * - \ref SCIP_STAGE_SOLVED
37241  */
37243  SCIP* scip, /**< SCIP data structure */
37244  SCIP_SOL** sol, /**< pointer to store the solution */
37245  SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */
37246  )
37247 {
37248  SCIP_CALL( checkStage(scip, "SCIPcreateOrigSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37249 
37250  switch( scip->set->stage )
37251  {
37252  case SCIP_STAGE_PROBLEM:
37253  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->origprimal, NULL, heur) );
37254  return SCIP_OKAY;
37255 
37259  case SCIP_STAGE_PRESOLVING:
37261  case SCIP_STAGE_PRESOLVED:
37262  case SCIP_STAGE_INITSOLVE:
37263  case SCIP_STAGE_SOLVING:
37264  case SCIP_STAGE_SOLVED:
37265  SCIP_CALL( SCIPsolCreateOriginal(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->primal, scip->tree, heur) );
37266  return SCIP_OKAY;
37267 
37268  case SCIP_STAGE_EXITSOLVE:
37269  case SCIP_STAGE_FREETRANS:
37270  default:
37271  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
37272  return SCIP_INVALIDCALL;
37273  } /*lint !e788*/
37274 }
37275 
37276 /** creates a copy of a primal solution; note that a copy of a linked solution is also linked and needs to be unlinked
37277  * if it should stay unaffected from changes in the LP or pseudo solution
37278  *
37279  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37280  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37281  *
37282  * @pre This method can be called if SCIP is in one of the following stages:
37283  * - \ref SCIP_STAGE_PROBLEM
37284  * - \ref SCIP_STAGE_FREETRANS
37285  * - \ref SCIP_STAGE_TRANSFORMING
37286  * - \ref SCIP_STAGE_TRANSFORMED
37287  * - \ref SCIP_STAGE_INITPRESOLVE
37288  * - \ref SCIP_STAGE_PRESOLVING
37289  * - \ref SCIP_STAGE_EXITPRESOLVE
37290  * - \ref SCIP_STAGE_PRESOLVED
37291  * - \ref SCIP_STAGE_INITSOLVE
37292  * - \ref SCIP_STAGE_SOLVING
37293  * - \ref SCIP_STAGE_SOLVED
37294  */
37296  SCIP* scip, /**< SCIP data structure */
37297  SCIP_SOL** sol, /**< pointer to store the solution */
37298  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
37299  )
37300 {
37301  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
37302 
37303  /* check if we want to copy the current solution, which is the same as creating a current solution */
37304  if( sourcesol == NULL )
37305  {
37306  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
37307  }
37308  else
37309  {
37310  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->primal, sourcesol) );
37311  }
37312 
37313  return SCIP_OKAY;
37314 }
37315 
37316 /** creates a copy of a solution in the original primal solution space
37317  *
37318  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37319  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37320  *
37321  * @pre This method can be called if SCIP is in one of the following stages:
37322  * - \ref SCIP_STAGE_PROBLEM
37323  * - \ref SCIP_STAGE_TRANSFORMING
37324  * - \ref SCIP_STAGE_TRANSFORMED
37325  * - \ref SCIP_STAGE_INITPRESOLVE
37326  * - \ref SCIP_STAGE_PRESOLVING
37327  * - \ref SCIP_STAGE_EXITPRESOLVE
37328  * - \ref SCIP_STAGE_PRESOLVED
37329  * - \ref SCIP_STAGE_INITSOLVE
37330  * - \ref SCIP_STAGE_SOLVING
37331  * - \ref SCIP_STAGE_SOLVED
37332  * - \ref SCIP_STAGE_EXITSOLVE
37333  * - \ref SCIP_STAGE_FREETRANS
37334  */
37336  SCIP* scip, /**< SCIP data structure */
37337  SCIP_SOL** sol, /**< pointer to store the solution */
37338  SCIP_SOL* sourcesol /**< primal CIP solution to copy */
37339  )
37340 {
37341  SCIP_CALL( checkStage(scip, "SCIPcreateSolCopyOrig", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37342 
37343  /* check if we want to copy the current solution, which is the same as creating a current solution */
37344  if( sourcesol == NULL )
37345  {
37346  SCIP_CALL( SCIPcreateCurrentSol(scip, sol, NULL) );
37347  }
37348  else
37349  {
37350  switch( scip->set->stage )
37351  {
37352  case SCIP_STAGE_PROBLEM:
37353  case SCIP_STAGE_FREETRANS:
37354  case SCIP_STAGE_SOLVED:
37358  case SCIP_STAGE_PRESOLVING:
37360  case SCIP_STAGE_PRESOLVED:
37361  case SCIP_STAGE_INITSOLVE:
37362  case SCIP_STAGE_SOLVING:
37363  SCIP_CALL( SCIPsolCopy(sol, scip->mem->probmem, scip->set, scip->stat, scip->origprimal, sourcesol) );
37364  break;
37365  default:
37366  assert(FALSE);
37367  } /*lint !e788*/
37368  }
37369 
37370  return SCIP_OKAY;
37371 }
37372 
37373 /** creates a copy of a primal solution, thereby replacing infinite fixings of variables by finite values;
37374  * the copy is always defined in the original variable space;
37375  * success indicates whether the objective value of the solution was changed by removing infinite values
37376  *
37377  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37378  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37379  *
37380  * @pre This method can be called if SCIP is in one of the following stages:
37381  * - \ref SCIP_STAGE_PROBLEM
37382  * - \ref SCIP_STAGE_TRANSFORMING
37383  * - \ref SCIP_STAGE_TRANSFORMED
37384  * - \ref SCIP_STAGE_INITPRESOLVE
37385  * - \ref SCIP_STAGE_PRESOLVING
37386  * - \ref SCIP_STAGE_EXITPRESOLVE
37387  * - \ref SCIP_STAGE_PRESOLVED
37388  * - \ref SCIP_STAGE_INITSOLVE
37389  * - \ref SCIP_STAGE_SOLVING
37390  * - \ref SCIP_STAGE_SOLVED
37391  * - \ref SCIP_STAGE_EXITSOLVE
37392  */
37394  SCIP* scip, /**< SCIP data structure */
37395  SCIP_SOL** sol, /**< pointer to store the solution */
37396  SCIP_SOL* sourcesol, /**< primal CIP solution to copy */
37397  SCIP_Bool* success /**< does the finite solution have the same objective value? */
37398  )
37399 {
37400  SCIP_VAR** fixedvars;
37401  SCIP_VAR** origvars;
37402  SCIP_Real* solvals;
37403  SCIP_VAR* var;
37404  int nfixedvars;
37405  int norigvars;
37406  int v;
37407 
37408  SCIP_CALL( checkStage(scip, "SCIPcreateFiniteSolCopy", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
37409 
37410  assert(scip != NULL);
37411  assert(sol != NULL);
37412  assert(sourcesol != NULL);
37413  assert(success != NULL);
37414 
37415  *success = TRUE;
37416  *sol = NULL;
37417 
37418  fixedvars = SCIPgetFixedVars(scip);
37419  nfixedvars = SCIPgetNFixedVars(scip);
37420  assert(fixedvars != NULL || nfixedvars == 0);
37421 
37422  /* get original variables and their values in the optimal solution */
37423  SCIP_CALL( SCIPgetOrigVarsData(scip, &origvars, &norigvars, NULL, NULL, NULL, NULL) );
37424  SCIP_CALL( SCIPallocBufferArray(scip, &solvals, norigvars) );
37425  SCIP_CALL( SCIPgetSolVals(scip, sourcesol, norigvars, origvars, solvals) );
37426 
37427  /* check whether there are variables fixed to an infinite value */
37428  for( v = 0; v < nfixedvars; ++v )
37429  {
37430  var = fixedvars[v]; /*lint !e613*/
37431 
37432  /* skip (multi-)aggregated variables */
37434  continue;
37435 
37436  assert(SCIPisEQ(scip, SCIPvarGetLbGlobal(var), SCIPvarGetUbGlobal(var)));
37437 
37438  if( (SCIPisInfinity(scip, SCIPvarGetLbGlobal(var)) || SCIPisInfinity(scip, -SCIPvarGetLbGlobal(var))) )
37439  {
37440  SCIPdebugMsg(scip, "var <%s> is fixed to infinite value %g\n", SCIPvarGetName(var), SCIPvarGetLbGlobal(var));
37441  break;
37442  }
37443  }
37444 
37445  /* there were variables fixed to infinite values */
37446  if( v < nfixedvars )
37447  {
37448  SCIP_HASHMAP* varmap;
37449  SCIP* subscip;
37450  SCIP_VAR* varcopy;
37451  SCIP_Real fixval;
37452  SCIP_Bool valid;
37453  SCIP_SOL* bestsol;
37454 
37455  /* if one of the variables was fixed to infinity in the original problem, we stop here */
37456  for( v = 0; v < norigvars; ++v )
37457  {
37458  var = origvars[v];
37459 
37461  {
37462  assert(SCIPisEQ(scip, SCIPvarGetLbOriginal(var), SCIPvarGetUbOriginal(var)));
37463 
37464  SCIPdebugMsg(scip, "--> var <%s> is fixed to infinite value %g in the original problem, stop making solution finite\n",
37466 
37467  goto TERMINATE;
37468  }
37469  }
37470 
37471  /* create sub-SCIP */
37472  SCIP_CALL( SCIPcreate(&subscip) );
37473 
37474  /* copy the original problem to the sub-SCIP */
37475  SCIP_CALL( SCIPhashmapCreate(&varmap, SCIPblkmem(scip), norigvars) );
37476  SCIP_CALL( SCIPcopyOrig(scip, subscip, varmap, NULL, "removeinffixings", TRUE, TRUE, &valid) );
37477 
37478  SCIP_CALL( SCIPsetIntParam(subscip, "display/verblevel", (int)SCIP_VERBLEVEL_NONE) );
37479 
37480  /* in the sub-SCIP, we try to minimize the absolute values of all variables with infinite values in the solution
37481  * and fix all other variables to the value they have in the solution
37482  */
37483  for( v = 0; v < norigvars; ++v )
37484  {
37485  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
37486  assert(varcopy != NULL);
37487 
37488  fixval = solvals[v];
37489 
37490  if( SCIPisInfinity(scip, fixval) || SCIPisInfinity(scip, -fixval) )
37491  {
37492  /* If a variable with a finite finite lower bound was set to +infinity, we just change its objective to 1.0
37493  * to minimize its value; if a variable with a finite finite upper bound was set to -infinity, we just
37494  * change its objective to -1.0 to maximize its value; if a variable is free, we split the variable into
37495  * positive and negative part by creating two new non-negative variables and one constraint linking those
37496  * variables.
37497  */
37498  if( SCIPisInfinity(scip, fixval) && !SCIPisInfinity(scip, -SCIPvarGetLbLocal(varcopy)) )
37499  {
37500  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 1.0) );
37501  }
37502  else if( SCIPisInfinity(scip, -fixval) && !SCIPisInfinity(scip, SCIPvarGetUbLocal(varcopy)) )
37503  {
37504  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, -1.0) );
37505  }
37506  else
37507  {
37508  char name[SCIP_MAXSTRLEN];
37509  SCIP_VAR* posvar;
37510  SCIP_VAR* negvar;
37511  SCIP_CONS* linkcons;
37512 
37513  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "run");
37514  SCIP_CALL( SCIPcreateVar(subscip, &posvar, name, 0.0, SCIPinfinity(scip), 1.0,
37516  SCIP_CALL( SCIPaddVar(subscip, posvar) );
37517 
37518  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "neg");
37519  SCIP_CALL( SCIPcreateVar(subscip, &negvar, name, 0.0, SCIPinfinity(scip), 1.0,
37521  SCIP_CALL( SCIPaddVar(subscip, negvar) );
37522 
37523  (void) SCIPsnprintf(name, SCIP_MAXSTRLEN, "%s_%s", SCIPvarGetName(varcopy), "linkcons");
37524  SCIP_CALL( SCIPcreateConsBasicLinear(subscip, &linkcons, name, 0, NULL, NULL, 0.0, 0.0 ) );
37525  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, varcopy, 1.0) );
37526  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, posvar, -1.0) );
37527  SCIP_CALL( SCIPaddCoefLinear(subscip, linkcons, negvar, 1.0) );
37528  SCIP_CALL( SCIPaddCons(subscip, linkcons) );
37529 
37530  SCIP_CALL( SCIPreleaseCons(subscip, &linkcons) );
37531  SCIP_CALL( SCIPreleaseVar(subscip, &posvar) );
37532  SCIP_CALL( SCIPreleaseVar(subscip, &negvar) );
37533 
37534  SCIP_CALL( SCIPchgVarObj(subscip, varcopy, 0.0) );
37535  }
37536  }
37537  else
37538  {
37539  SCIP_Bool infeasible;
37540  SCIP_Bool fixed;
37541 
37542  if( SCIPisFeasLT(scip, solvals[v], SCIPvarGetLbLocal(varcopy)) || SCIPisFeasGT(scip, solvals[v], SCIPvarGetUbLocal(varcopy)) )
37543  {
37544  SCIP_CALL( SCIPchgVarType(subscip, varcopy, SCIP_VARTYPE_CONTINUOUS, &infeasible) );
37545  assert(!infeasible);
37546  }
37547 
37548  /* fix variable to its value in the solution */
37549  SCIP_CALL( SCIPfixVar(subscip, varcopy, fixval, &infeasible, &fixed) );
37550  assert(!infeasible);
37551  }
37552  }
37553 
37554  SCIP_CALL( SCIPsolve(subscip) );
37555 
37556  bestsol = SCIPgetBestSol(subscip);
37557 
37558  if( bestsol != NULL )
37559  {
37560  /* change the stored solution values for variables fixed to infinite values */
37561  for( v = 0; v < norigvars; ++v )
37562  {
37563  varcopy = (SCIP_VAR*) SCIPhashmapGetImage(varmap, (void*)origvars[v]);
37564  assert(varcopy != NULL);
37565 
37566  if( (SCIPisInfinity(scip, solvals[v]) || SCIPisInfinity(scip, -solvals[v])) )
37567  {
37568  solvals[v] = SCIPgetSolVal(subscip, bestsol, varcopy);
37569  }
37570  }
37571  }
37572  else
37573  {
37574  *success = FALSE;
37575  }
37576 
37577  /* free sub-SCIP */
37578  SCIP_CALL( SCIPfree(&subscip) );
37579  SCIPhashmapFree(&varmap);
37580  }
37581 
37582  /* create original solution and set the solution values */
37583  if( *success )
37584  {
37585  SCIP_CALL( SCIPcreateOrigSol(scip, sol, NULL) );
37586  for( v = 0; v < norigvars; ++v )
37587  {
37588  SCIP_CALL( SCIPsetSolVal(scip, *sol, origvars[v], solvals[v]) );
37589  }
37590  }
37591 
37592 #ifdef SCIP_DEBUG
37593  SCIPdebugMsg(scip, "created finites solution copy:\n");
37594  SCIP_CALL( SCIPprintSol(scip, *sol, NULL, FALSE) );
37595 #endif
37596 
37597  /* the solution of the sub-SCIP should have the same objective value */
37598  if( *success && !SCIPisEQ(scip, SCIPgetSolOrigObj(scip, *sol), SCIPgetSolOrigObj(scip, sourcesol)) )
37599  {
37600  /* @todo how should we avoid numerical trobles here for large objective values? */
37601  if( (SCIPgetSolOrigObj(scip, *sol) / SCIPepsilon(scip)) < 1e+15 ||
37602  REALABS(SCIPgetSolOrigObj(scip, *sol) - SCIPgetSolOrigObj(scip, sourcesol)) > 1e-12 * SCIPgetSolOrigObj(scip, *sol) )
37603  *success = FALSE;
37604  }
37605 
37606  TERMINATE:
37607  SCIPfreeBufferArray(scip, &solvals);
37608 
37609  return SCIP_OKAY;
37610 }
37611 
37612 /** frees primal CIP solution
37613  *
37614  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37615  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37616  *
37617  * @pre This method can be called if SCIP is in one of the following stages:
37618  * - \ref SCIP_STAGE_PROBLEM
37619  * - \ref SCIP_STAGE_TRANSFORMING
37620  * - \ref SCIP_STAGE_TRANSFORMED
37621  * - \ref SCIP_STAGE_INITPRESOLVE
37622  * - \ref SCIP_STAGE_PRESOLVING
37623  * - \ref SCIP_STAGE_EXITPRESOLVE
37624  * - \ref SCIP_STAGE_PRESOLVED
37625  * - \ref SCIP_STAGE_INITSOLVE
37626  * - \ref SCIP_STAGE_SOLVING
37627  * - \ref SCIP_STAGE_SOLVED
37628  * - \ref SCIP_STAGE_EXITSOLVE
37629  * - \ref SCIP_STAGE_FREETRANS
37630  */
37632  SCIP* scip, /**< SCIP data structure */
37633  SCIP_SOL** sol /**< pointer to the solution */
37634  )
37635 {
37636  SCIP_CALL( checkStage(scip, "SCIPfreeSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37637 
37638  switch( scip->set->stage )
37639  {
37640  case SCIP_STAGE_PROBLEM:
37641  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->origprimal) );
37642  break;
37643  case SCIP_STAGE_FREETRANS:
37646  case SCIP_STAGE_PRESOLVING:
37648  case SCIP_STAGE_PRESOLVED:
37649  case SCIP_STAGE_SOLVING:
37651  case SCIP_STAGE_INITSOLVE:
37652  case SCIP_STAGE_SOLVED:
37653  case SCIP_STAGE_EXITSOLVE:
37654  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
37655  break;
37656  default:
37657  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
37658  return SCIP_INVALIDCALL;
37659  } /*lint !e788*/
37660 
37661  return SCIP_OKAY;
37662 }
37663 
37664 /** links a primal solution to the current LP solution
37665  *
37666  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37667  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37668  *
37669  * @pre This method can be called if SCIP is in one of the following stages:
37670  * - \ref SCIP_STAGE_SOLVING
37671  */
37673  SCIP* scip, /**< SCIP data structure */
37674  SCIP_SOL* sol /**< primal solution */
37675  )
37676 {
37677  SCIP_CALL( checkStage(scip, "SCIPlinkLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37678 
37679  if( !SCIPlpIsSolved(scip->lp) )
37680  {
37681  SCIPerrorMessage("LP solution does not exist\n");
37682  return SCIP_INVALIDCALL;
37683  }
37684 
37685  SCIP_CALL( SCIPsolLinkLPSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
37686 
37687  return SCIP_OKAY;
37688 }
37689 
37690 /** links a primal solution to the current NLP solution
37691  *
37692  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37693  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37694  *
37695  * @pre This method can be called if SCIP is in one of the following stages:
37696  * - \ref SCIP_STAGE_SOLVING
37697  */
37699  SCIP* scip, /**< SCIP data structure */
37700  SCIP_SOL* sol /**< primal solution */
37701  )
37702 {
37703  SCIP_CALL( checkStage(scip, "SCIPlinkNLPSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37704 
37705  if( scip->nlp == NULL )
37706  {
37707  SCIPerrorMessage("NLP does not exist\n");
37708  return SCIP_INVALIDCALL;
37709  }
37710 
37712  {
37713  SCIPerrorMessage("NLP solution does not exist\n");
37714  return SCIP_INVALIDCALL;
37715  }
37716 
37717  SCIP_CALL( SCIPsolLinkNLPSol(sol, scip->stat, scip->tree, scip->nlp) );
37718 
37719  return SCIP_OKAY;
37720 }
37721 
37722 /** links a primal solution to the current relaxation solution
37723  *
37724  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37725  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37726  *
37727  * @pre This method can be called if SCIP is in one of the following stages:
37728  * - \ref SCIP_STAGE_SOLVING
37729  */
37731  SCIP* scip, /**< SCIP data structure */
37732  SCIP_SOL* sol /**< primal solution */
37733  )
37734 {
37735  SCIP_CALL( checkStage(scip, "SCIPlinkRelaxSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37736 
37737  if( !SCIPrelaxationIsSolValid(scip->relaxation) )
37738  {
37739  SCIPerrorMessage("relaxation solution is not valid\n");
37740  return SCIP_INVALIDCALL;
37741  }
37742 
37743  SCIP_CALL( SCIPsolLinkRelaxSol(sol, scip->set, scip->stat, scip->tree, scip->relaxation) );
37744 
37745  return SCIP_OKAY;
37746 }
37747 
37748 /** links a primal solution to the current pseudo solution
37749  *
37750  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37751  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37752  *
37753  * @pre This method can be called if SCIP is in one of the following stages:
37754  * - \ref SCIP_STAGE_PRESOLVING
37755  * - \ref SCIP_STAGE_SOLVING
37756  */
37758  SCIP* scip, /**< SCIP data structure */
37759  SCIP_SOL* sol /**< primal solution */
37760  )
37761 {
37762  SCIP_CALL( checkStage(scip, "SCIPlinkPseudoSol", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37763 
37764  SCIP_CALL( SCIPsolLinkPseudoSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
37765 
37766  return SCIP_OKAY;
37767 }
37768 
37769 /** links a primal solution to the current LP or pseudo solution
37770  *
37771  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37772  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37773  *
37774  * @pre This method can be called if SCIP is in one of the following stages:
37775  * - \ref SCIP_STAGE_SOLVING
37776  */
37778  SCIP* scip, /**< SCIP data structure */
37779  SCIP_SOL* sol /**< primal solution */
37780  )
37781 {
37782  SCIP_CALL( checkStage(scip, "SCIPlinkCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
37783 
37784  SCIP_CALL( SCIPsolLinkCurrentSol(sol, scip->set, scip->stat, scip->transprob, scip->tree, scip->lp) );
37785 
37786  return SCIP_OKAY;
37787 }
37788 
37789 /** clears a primal solution
37790  *
37791  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37792  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37793  *
37794  * @pre This method can be called if SCIP is in one of the following stages:
37795  * - \ref SCIP_STAGE_PROBLEM
37796  * - \ref SCIP_STAGE_TRANSFORMING
37797  * - \ref SCIP_STAGE_TRANSFORMED
37798  * - \ref SCIP_STAGE_INITPRESOLVE
37799  * - \ref SCIP_STAGE_PRESOLVING
37800  * - \ref SCIP_STAGE_EXITPRESOLVE
37801  * - \ref SCIP_STAGE_PRESOLVED
37802  * - \ref SCIP_STAGE_INITSOLVE
37803  * - \ref SCIP_STAGE_SOLVING
37804  * - \ref SCIP_STAGE_SOLVED
37805  * - \ref SCIP_STAGE_EXITSOLVE
37806  * - \ref SCIP_STAGE_FREETRANS
37807  */
37809  SCIP* scip, /**< SCIP data structure */
37810  SCIP_SOL* sol /**< primal solution */
37811  )
37812 {
37813  SCIP_CALL( checkStage(scip, "SCIPclearSol", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37814 
37815  SCIP_CALL( SCIPsolClear(sol, scip->stat, scip->tree) );
37816 
37817  return SCIP_OKAY;
37818 }
37819 
37820 /** stores solution values of variables in solution's own array
37821  *
37822  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37823  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37824  *
37825  * @pre This method can be called if SCIP is in one of the following stages:
37826  * - \ref SCIP_STAGE_TRANSFORMING
37827  * - \ref SCIP_STAGE_TRANSFORMED
37828  * - \ref SCIP_STAGE_PRESOLVING
37829  * - \ref SCIP_STAGE_PRESOLVED
37830  * - \ref SCIP_STAGE_INITSOLVE
37831  * - \ref SCIP_STAGE_SOLVING
37832  * - \ref SCIP_STAGE_SOLVED
37833  * - \ref SCIP_STAGE_EXITSOLVE
37834  * - \ref SCIP_STAGE_FREETRANS
37835  */
37837  SCIP* scip, /**< SCIP data structure */
37838  SCIP_SOL* sol /**< primal solution */
37839  )
37840 {
37841  SCIP_CALL( checkStage(scip, "SCIPunlinkSol", FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37842 
37843  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
37844 
37845  return SCIP_OKAY;
37846 }
37847 
37848 /** sets value of variable in primal CIP solution
37849  *
37850  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37851  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37852  *
37853  * @pre This method can be called if SCIP is in one of the following stages:
37854  * - \ref SCIP_STAGE_PROBLEM
37855  * - \ref SCIP_STAGE_TRANSFORMING
37856  * - \ref SCIP_STAGE_TRANSFORMED
37857  * - \ref SCIP_STAGE_INITPRESOLVE
37858  * - \ref SCIP_STAGE_PRESOLVING
37859  * - \ref SCIP_STAGE_EXITPRESOLVE
37860  * - \ref SCIP_STAGE_PRESOLVED
37861  * - \ref SCIP_STAGE_INITSOLVE
37862  * - \ref SCIP_STAGE_SOLVING
37863  * - \ref SCIP_STAGE_SOLVED
37864  * - \ref SCIP_STAGE_EXITSOLVE
37865  * - \ref SCIP_STAGE_FREETRANS
37866  */
37868  SCIP* scip, /**< SCIP data structure */
37869  SCIP_SOL* sol, /**< primal solution */
37870  SCIP_VAR* var, /**< variable to add to solution */
37871  SCIP_Real val /**< solution value of variable */
37872  )
37873 {
37874  SCIP_CALL( checkStage(scip, "SCIPsetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37875 
37876  assert( var->scip == scip );
37877 
37878  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
37879  {
37880  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
37881  SCIPvarGetName(var));
37882  return SCIP_INVALIDCALL;
37883  }
37884 
37885  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, var, val) );
37886 
37887  return SCIP_OKAY;
37888 }
37889 
37890 /** sets values of multiple variables in primal CIP solution
37891  *
37892  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37893  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37894  *
37895  * @pre This method can be called if SCIP is in one of the following stages:
37896  * - \ref SCIP_STAGE_PROBLEM
37897  * - \ref SCIP_STAGE_TRANSFORMING
37898  * - \ref SCIP_STAGE_TRANSFORMED
37899  * - \ref SCIP_STAGE_INITPRESOLVE
37900  * - \ref SCIP_STAGE_PRESOLVING
37901  * - \ref SCIP_STAGE_EXITPRESOLVE
37902  * - \ref SCIP_STAGE_PRESOLVED
37903  * - \ref SCIP_STAGE_INITSOLVE
37904  * - \ref SCIP_STAGE_SOLVING
37905  * - \ref SCIP_STAGE_SOLVED
37906  * - \ref SCIP_STAGE_EXITSOLVE
37907  * - \ref SCIP_STAGE_FREETRANS
37908  */
37910  SCIP* scip, /**< SCIP data structure */
37911  SCIP_SOL* sol, /**< primal solution */
37912  int nvars, /**< number of variables to set solution value for */
37913  SCIP_VAR** vars, /**< array with variables to add to solution */
37914  SCIP_Real* vals /**< array with solution values of variables */
37915  )
37916 {
37917  int v;
37918 
37919  assert(nvars == 0 || vars != NULL);
37920  assert(nvars == 0 || vals != NULL);
37921 
37922  SCIP_CALL( checkStage(scip, "SCIPsetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37923 
37924  if( SCIPsolIsOriginal(sol) )
37925  {
37926  for( v = 0; v < nvars; ++v )
37927  {
37928  if( SCIPvarIsTransformed(vars[v]) )
37929  {
37930  SCIPerrorMessage("cannot set value of transformed variable <%s> in original space solution\n",
37931  SCIPvarGetName(vars[v]));
37932  return SCIP_INVALIDCALL;
37933  }
37934  }
37935  }
37936 
37937  for( v = 0; v < nvars; ++v )
37938  {
37939  SCIP_CALL( SCIPsolSetVal(sol, scip->set, scip->stat, scip->tree, vars[v], vals[v]) );
37940  }
37941 
37942  return SCIP_OKAY;
37943 }
37944 
37945 /** increases value of variable in primal CIP solution
37946  *
37947  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
37948  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
37949  *
37950  * @pre This method can be called if SCIP is in one of the following stages:
37951  * - \ref SCIP_STAGE_PROBLEM
37952  * - \ref SCIP_STAGE_TRANSFORMING
37953  * - \ref SCIP_STAGE_TRANSFORMED
37954  * - \ref SCIP_STAGE_INITPRESOLVE
37955  * - \ref SCIP_STAGE_PRESOLVING
37956  * - \ref SCIP_STAGE_EXITPRESOLVE
37957  * - \ref SCIP_STAGE_PRESOLVED
37958  * - \ref SCIP_STAGE_INITSOLVE
37959  * - \ref SCIP_STAGE_SOLVING
37960  * - \ref SCIP_STAGE_SOLVED
37961  * - \ref SCIP_STAGE_EXITSOLVE
37962  * - \ref SCIP_STAGE_FREETRANS
37963  */
37965  SCIP* scip, /**< SCIP data structure */
37966  SCIP_SOL* sol, /**< primal solution */
37967  SCIP_VAR* var, /**< variable to increase solution value for */
37968  SCIP_Real incval /**< increment for solution value of variable */
37969  )
37970 {
37971  SCIP_CALL( checkStage(scip, "SCIPincSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
37972 
37973  assert( var->scip == scip );
37974 
37975  if( SCIPsolIsOriginal(sol) && SCIPvarIsTransformed(var) )
37976  {
37977  SCIPerrorMessage("cannot increase value of transformed variable <%s> in original space solution\n",
37978  SCIPvarGetName(var));
37979  return SCIP_INVALIDCALL;
37980  }
37981 
37982  SCIP_CALL( SCIPsolIncVal(sol, scip->set, scip->stat, scip->tree, var, incval) );
37983 
37984  return SCIP_OKAY;
37985 }
37986 
37987 /** returns value of variable in primal CIP solution, or in current LP/pseudo solution
37988  *
37989  * @return value of variable in primal CIP solution, or in current LP/pseudo solution
37990  *
37991  * @pre In case the solution pointer @p sol is @b NULL, that means it is asked for the LP or pseudo solution, this method
37992  * can only be called if @p scip is in the solving stage \ref SCIP_STAGE_SOLVING. In any other case, this method
37993  * can be called if @p scip is in one of the following stages:
37994  * - \ref SCIP_STAGE_PROBLEM
37995  * - \ref SCIP_STAGE_TRANSFORMING
37996  * - \ref SCIP_STAGE_TRANSFORMED
37997  * - \ref SCIP_STAGE_INITPRESOLVE
37998  * - \ref SCIP_STAGE_PRESOLVING
37999  * - \ref SCIP_STAGE_EXITPRESOLVE
38000  * - \ref SCIP_STAGE_PRESOLVED
38001  * - \ref SCIP_STAGE_INITSOLVE
38002  * - \ref SCIP_STAGE_SOLVING
38003  * - \ref SCIP_STAGE_SOLVED
38004  * - \ref SCIP_STAGE_EXITSOLVE
38005  * - \ref SCIP_STAGE_FREETRANS
38006  */
38008  SCIP* scip, /**< SCIP data structure */
38009  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38010  SCIP_VAR* var /**< variable to get value for */
38011  )
38012 {
38013  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38014 
38015  assert( var->scip == scip );
38016 
38017  if( sol != NULL )
38018  return SCIPsolGetVal(sol, scip->set, scip->stat, var);
38019 
38020  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolVal(sol==NULL)", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38021 
38022  return SCIPvarGetSol(var, SCIPtreeHasCurrentNodeLP(scip->tree));
38023 }
38024 
38025 /** gets values of multiple variables in primal CIP solution
38026  *
38027  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38028  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38029  *
38030  * @pre This method can be called if SCIP is in one of the following stages:
38031  * - \ref SCIP_STAGE_PROBLEM
38032  * - \ref SCIP_STAGE_TRANSFORMING
38033  * - \ref SCIP_STAGE_TRANSFORMED
38034  * - \ref SCIP_STAGE_INITPRESOLVE
38035  * - \ref SCIP_STAGE_PRESOLVING
38036  * - \ref SCIP_STAGE_EXITPRESOLVE
38037  * - \ref SCIP_STAGE_PRESOLVED
38038  * - \ref SCIP_STAGE_INITSOLVE
38039  * - \ref SCIP_STAGE_SOLVING
38040  * - \ref SCIP_STAGE_SOLVED
38041  * - \ref SCIP_STAGE_EXITSOLVE
38042  * - \ref SCIP_STAGE_FREETRANS
38043  */
38045  SCIP* scip, /**< SCIP data structure */
38046  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38047  int nvars, /**< number of variables to get solution value for */
38048  SCIP_VAR** vars, /**< array with variables to get value for */
38049  SCIP_Real* vals /**< array to store solution values of variables */
38050  )
38051 {
38052  assert(nvars == 0 || vars != NULL);
38053  assert(nvars == 0 || vals != NULL);
38054 
38055  SCIP_CALL( checkStage(scip, "SCIPgetSolVals", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38056 
38057  if( sol != NULL )
38058  {
38059  int v;
38060 
38061  for( v = 0; v < nvars; ++v )
38062  vals[v] = SCIPsolGetVal(sol, scip->set, scip->stat, vars[v]);
38063  }
38064  else
38065  {
38066  SCIP_CALL( SCIPgetVarSols(scip, nvars, vars, vals) );
38067  }
38068 
38069  return SCIP_OKAY;
38070 }
38071 
38072 /** returns objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
38073  *
38074  * @return objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value
38075  *
38076  * @pre This method can be called if SCIP is in one of the following stages:
38077  * - \ref SCIP_STAGE_PROBLEM
38078  * - \ref SCIP_STAGE_TRANSFORMING
38079  * - \ref SCIP_STAGE_TRANSFORMED
38080  * - \ref SCIP_STAGE_INITPRESOLVE
38081  * - \ref SCIP_STAGE_PRESOLVING
38082  * - \ref SCIP_STAGE_EXITPRESOLVE
38083  * - \ref SCIP_STAGE_PRESOLVED
38084  * - \ref SCIP_STAGE_INITSOLVE
38085  * - \ref SCIP_STAGE_SOLVING
38086  * - \ref SCIP_STAGE_SOLVED
38087  * - \ref SCIP_STAGE_EXITSOLVE
38088  * - \ref SCIP_STAGE_FREETRANS
38089  */
38091  SCIP* scip, /**< SCIP data structure */
38092  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
38093  )
38094 {
38095  /* for original solutions, an original objective value is already available in SCIP_STAGE_PROBLEM
38096  * for all other solutions, we should be at least in SCIP_STAGE_TRANSFORMING
38097  */
38098  if( sol != NULL && SCIPsolIsOriginal(sol) )
38099  {
38100  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38101 
38102  return SCIPsolGetOrigObj(sol);
38103  }
38104 
38105  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38106 
38107  if( sol != NULL )
38108  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
38109  else
38110  {
38111  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolOrigObj(sol==NULL)",
38113  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
38114  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetObjval(scip->lp, scip->set, scip->transprob));
38115  else
38116  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob));
38117  }
38118 }
38119 
38120 /** returns transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
38121  *
38122  * @return transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value
38123  *
38124  * @pre This method can be called if SCIP is in one of the following stages:
38125  * - \ref SCIP_STAGE_TRANSFORMING
38126  * - \ref SCIP_STAGE_TRANSFORMED
38127  * - \ref SCIP_STAGE_INITPRESOLVE
38128  * - \ref SCIP_STAGE_PRESOLVING
38129  * - \ref SCIP_STAGE_EXITPRESOLVE
38130  * - \ref SCIP_STAGE_PRESOLVED
38131  * - \ref SCIP_STAGE_INITSOLVE
38132  * - \ref SCIP_STAGE_SOLVING
38133  * - \ref SCIP_STAGE_SOLVED
38134  * - \ref SCIP_STAGE_EXITSOLVE
38135  * - \ref SCIP_STAGE_FREETRANS
38136  */
38138  SCIP* scip, /**< SCIP data structure */
38139  SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */
38140  )
38141 {
38142  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38143 
38144  if( sol != NULL )
38145  return SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob);
38146  else
38147  {
38148  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTransObj(sol==NULL)",
38150  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
38151  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
38152  else
38153  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
38154  }
38155 }
38156 
38157 /** recomputes the objective value of an original solution, e.g., when transferring solutions
38158  * from the solution pool (objective coefficients might have changed in the meantime)
38159  *
38160  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38161  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38162  *
38163  * @pre This method can be called if SCIP is in one of the following stages:
38164  * - \ref SCIP_STAGE_PRESOLVING
38165  * - \ref SCIP_STAGE_SOLVING
38166  *
38167  */
38169  SCIP* scip,
38170  SCIP_SOL* sol
38171  )
38172 {
38173  assert(scip != NULL);
38174 
38175  SCIP_CALL( checkStage(scip, "SCIPrecomputeSolObj", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38176 
38177  SCIPsolRecomputeObj(sol, scip->set, scip->stat, scip->origprob);
38178 
38179  return SCIP_OKAY;
38180 }
38181 
38182 /** maps original space objective value into transformed objective value
38183  *
38184  * @return transformed objective value
38185  *
38186  * @pre This method can be called if SCIP is in one of the following stages:
38187  * - \ref SCIP_STAGE_TRANSFORMING
38188  * - \ref SCIP_STAGE_TRANSFORMED
38189  * - \ref SCIP_STAGE_INITPRESOLVE
38190  * - \ref SCIP_STAGE_PRESOLVING
38191  * - \ref SCIP_STAGE_EXITPRESOLVE
38192  * - \ref SCIP_STAGE_PRESOLVED
38193  * - \ref SCIP_STAGE_INITSOLVE
38194  * - \ref SCIP_STAGE_SOLVING
38195  * - \ref SCIP_STAGE_SOLVED
38196  */
38198  SCIP* scip, /**< SCIP data structure */
38199  SCIP_Real obj /**< original space objective value to transform */
38200  )
38201 {
38202  SCIP_CALL_ABORT( checkStage(scip, "SCIPtransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38203 
38204  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, obj);
38205 }
38206 
38207 /** maps transformed objective value into original space
38208  *
38209  * @return objective value into original space
38210  *
38211  * @pre This method can be called if SCIP is in one of the following stages:
38212  * - \ref SCIP_STAGE_TRANSFORMING
38213  * - \ref SCIP_STAGE_TRANSFORMED
38214  * - \ref SCIP_STAGE_INITPRESOLVE
38215  * - \ref SCIP_STAGE_PRESOLVING
38216  * - \ref SCIP_STAGE_EXITPRESOLVE
38217  * - \ref SCIP_STAGE_PRESOLVED
38218  * - \ref SCIP_STAGE_INITSOLVE
38219  * - \ref SCIP_STAGE_SOLVING
38220  * - \ref SCIP_STAGE_SOLVED
38221  */
38223  SCIP* scip, /**< SCIP data structure */
38224  SCIP_Real obj /**< transformed objective value to retransform in original space */
38225  )
38226 {
38227  SCIP_CALL_ABORT( checkStage(scip, "SCIPretransformObj", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
38228 
38229  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, obj);
38230 }
38231 
38232 /** gets clock time, when this solution was found
38233  *
38234  * @return clock time, when this solution was found
38235  *
38236  * @pre This method can be called if SCIP is in one of the following stages:
38237  * - \ref SCIP_STAGE_TRANSFORMING
38238  * - \ref SCIP_STAGE_TRANSFORMED
38239  * - \ref SCIP_STAGE_INITPRESOLVE
38240  * - \ref SCIP_STAGE_PRESOLVING
38241  * - \ref SCIP_STAGE_EXITPRESOLVE
38242  * - \ref SCIP_STAGE_PRESOLVED
38243  * - \ref SCIP_STAGE_INITSOLVE
38244  * - \ref SCIP_STAGE_SOLVING
38245  * - \ref SCIP_STAGE_SOLVED
38246  * - \ref SCIP_STAGE_EXITSOLVE
38247  * - \ref SCIP_STAGE_FREETRANS
38248  */
38250  SCIP* scip, /**< SCIP data structure */
38251  SCIP_SOL* sol /**< primal solution */
38252  )
38253 {
38254  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38255 
38256  return SCIPsolGetTime(sol);
38257 }
38258 
38259 /** gets branch and bound run number, where this solution was found
38260  *
38261  * @return branch and bound run number, where this solution was found
38262  *
38263  * @pre This method can be called if SCIP is in one of the following stages:
38264  * - \ref SCIP_STAGE_TRANSFORMING
38265  * - \ref SCIP_STAGE_TRANSFORMED
38266  * - \ref SCIP_STAGE_INITPRESOLVE
38267  * - \ref SCIP_STAGE_PRESOLVING
38268  * - \ref SCIP_STAGE_EXITPRESOLVE
38269  * - \ref SCIP_STAGE_PRESOLVED
38270  * - \ref SCIP_STAGE_INITSOLVE
38271  * - \ref SCIP_STAGE_SOLVING
38272  * - \ref SCIP_STAGE_SOLVED
38273  * - \ref SCIP_STAGE_EXITSOLVE
38274  * - \ref SCIP_STAGE_FREETRANS
38275  */
38277  SCIP* scip, /**< SCIP data structure */
38278  SCIP_SOL* sol /**< primal solution */
38279  )
38280 {
38281  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolRunnum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38282 
38283  return SCIPsolGetRunnum(sol);
38284 }
38285 
38286 /** gets node number of the specific branch and bound run, where this solution was found
38287  *
38288  * @return node number of the specific branch and bound run, where this solution was found
38289  *
38290  * @pre This method can be called if SCIP is in one of the following stages:
38291  * - \ref SCIP_STAGE_TRANSFORMING
38292  * - \ref SCIP_STAGE_TRANSFORMED
38293  * - \ref SCIP_STAGE_INITPRESOLVE
38294  * - \ref SCIP_STAGE_PRESOLVING
38295  * - \ref SCIP_STAGE_EXITPRESOLVE
38296  * - \ref SCIP_STAGE_PRESOLVED
38297  * - \ref SCIP_STAGE_INITSOLVE
38298  * - \ref SCIP_STAGE_SOLVING
38299  * - \ref SCIP_STAGE_SOLVED
38300  * - \ref SCIP_STAGE_EXITSOLVE
38301  * - \ref SCIP_STAGE_FREETRANS
38302  */
38304  SCIP* scip, /**< SCIP data structure */
38305  SCIP_SOL* sol /**< primal solution */
38306  )
38307 {
38308  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolNodenum", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38309 
38310  return SCIPsolGetNodenum(sol);
38311 }
38312 
38313 /** gets heuristic, that found this solution (or NULL if it's from the tree)
38314  *
38315  * @return heuristic, that found this solution (or NULL if it's from the tree)
38316  *
38317  * @pre This method can be called if SCIP is in one of the following stages:
38318  * - \ref SCIP_STAGE_TRANSFORMING
38319  * - \ref SCIP_STAGE_TRANSFORMED
38320  * - \ref SCIP_STAGE_INITPRESOLVE
38321  * - \ref SCIP_STAGE_PRESOLVING
38322  * - \ref SCIP_STAGE_EXITPRESOLVE
38323  * - \ref SCIP_STAGE_PRESOLVED
38324  * - \ref SCIP_STAGE_INITSOLVE
38325  * - \ref SCIP_STAGE_SOLVING
38326  * - \ref SCIP_STAGE_SOLVED
38327  * - \ref SCIP_STAGE_EXITSOLVE
38328  * - \ref SCIP_STAGE_FREETRANS
38329  */
38331  SCIP* scip, /**< SCIP data structure */
38332  SCIP_SOL* sol /**< primal solution */
38333  )
38334 {
38335  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolHeur", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38336 
38337  return SCIPsolGetHeur(sol);
38338 }
38339 
38340 /** returns whether two given solutions are exactly equal
38341  *
38342  * @return returns whether two given solutions are exactly equal
38343  *
38344  * @pre This method can be called if SCIP is in one of the following stages:
38345  * - \ref SCIP_STAGE_PROBLEM
38346  * - \ref SCIP_STAGE_TRANSFORMING
38347  * - \ref SCIP_STAGE_TRANSFORMED
38348  * - \ref SCIP_STAGE_INITPRESOLVE
38349  * - \ref SCIP_STAGE_PRESOLVING
38350  * - \ref SCIP_STAGE_EXITPRESOLVE
38351  * - \ref SCIP_STAGE_PRESOLVED
38352  * - \ref SCIP_STAGE_INITSOLVE
38353  * - \ref SCIP_STAGE_SOLVING
38354  * - \ref SCIP_STAGE_SOLVED
38355  * - \ref SCIP_STAGE_EXITSOLVE
38356  * - \ref SCIP_STAGE_FREETRANS
38357  */
38359  SCIP* scip, /**< SCIP data structure */
38360  SCIP_SOL* sol1, /**< first primal CIP solution */
38361  SCIP_SOL* sol2 /**< second primal CIP solution */
38362  )
38363 {
38364  SCIP_CALL_ABORT( checkStage(scip, "SCIPareSolsEqual", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
38365 
38366  return SCIPsolsAreEqual(sol1, sol2, scip->set, scip->stat, scip->origprob, scip->transprob);
38367 }
38368 
38369 /** adjusts solution values of implicit integer variables in handed solution. Solution objective value is not
38370  * deteriorated by this method.
38371  *
38372  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38373  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38374  *
38375  * @pre This method can be called if SCIP is in one of the following stages:
38376  * - \ref SCIP_STAGE_SOLVING
38377  */
38379  SCIP* scip, /**< SCIP data structure */
38380  SCIP_SOL* sol, /**< primal CIP solution */
38381  SCIP_Bool uselprows /**< should LP row information be considered for none-objective variables */
38382  )
38383 {
38384  assert(scip != NULL);
38385  SCIP_CALL( checkStage(scip, "SCIPadjustImplicitSolVals", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
38386 
38387  assert(sol != NULL);
38388  SCIP_CALL( SCIPsolAdjustImplicitSolVals(sol, scip->set, scip->stat, scip->transprob, scip->tree, uselprows) );
38389 
38390  return SCIP_OKAY;
38391 }
38392 
38393 /** outputs non-zero variables of solution in original problem space to the given file stream
38394  *
38395  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38396  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38397  *
38398  * @pre In case the solution pointer @p sol is NULL (asking for the current LP/pseudo solution), this method can be
38399  * called if @p scip is in one of the following stages:
38400  * - \ref SCIP_STAGE_PRESOLVING
38401  * - \ref SCIP_STAGE_EXITPRESOLVE
38402  * - \ref SCIP_STAGE_PRESOLVED
38403  * - \ref SCIP_STAGE_INITSOLVE
38404  * - \ref SCIP_STAGE_SOLVING
38405  * - \ref SCIP_STAGE_SOLVED
38406  * - \ref SCIP_STAGE_EXITSOLVE
38407  *
38408  * @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
38409  * following stages:
38410  * - \ref SCIP_STAGE_PROBLEM
38411  * - \ref SCIP_STAGE_TRANSFORMED
38412  * - \ref SCIP_STAGE_INITPRESOLVE
38413  * - \ref SCIP_STAGE_PRESOLVING
38414  * - \ref SCIP_STAGE_EXITPRESOLVE
38415  * - \ref SCIP_STAGE_PRESOLVED
38416  * - \ref SCIP_STAGE_INITSOLVE
38417  * - \ref SCIP_STAGE_SOLVING
38418  * - \ref SCIP_STAGE_SOLVED
38419  * - \ref SCIP_STAGE_EXITSOLVE
38420  */
38422  SCIP* scip, /**< SCIP data structure */
38423  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38424  FILE* file, /**< output file (or NULL for standard output) */
38425  SCIP_Bool printzeros /**< should variables set to zero be printed? */
38426  )
38427 {
38428  SCIP_Real objvalue;
38429  SCIP_Bool currentsol;
38430  SCIP_Bool oldquiet = FALSE;
38431 
38432  assert(SCIPisTransformed(scip) || sol != NULL);
38433 
38434  SCIP_CALL( checkStage(scip, "SCIPprintSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38435 
38436  currentsol = (sol == NULL);
38437  if( currentsol )
38438  {
38439  SCIP_CALL( checkStage(scip, "SCIPprintSol(sol==NULL)",
38441 
38442  /* create a temporary solution that is linked to the current solution */
38443  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
38444  scip->tree, scip->lp, NULL) );
38445  }
38446 
38447  if( file != NULL && scip->messagehdlr != NULL )
38448  {
38449  oldquiet = SCIPmessagehdlrIsQuiet(scip->messagehdlr);
38451  }
38452 
38453  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
38454 
38455  if( SCIPsolIsPartial(sol) )
38456  {
38457  SCIPmessageFPrintInfo(scip->messagehdlr, file, "unknown\n");
38458  }
38459  else
38460  {
38461  if( SCIPsolIsOriginal(sol) )
38462  objvalue = SCIPsolGetOrigObj(sol);
38463  else
38464  objvalue = SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
38465 
38466  SCIPprintReal(scip, file, objvalue, 20, 15);
38467  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
38468  }
38469 
38470  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, FALSE,
38471  printzeros) );
38472 
38473  if( file != NULL && scip->messagehdlr != NULL )
38474  {
38475  SCIPmessagehdlrSetQuiet(scip->messagehdlr, oldquiet);
38476  }
38477 
38478  if( currentsol )
38479  {
38480  /* free temporary solution */
38481  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
38482  }
38483 
38484  return SCIP_OKAY;
38485 }
38486 
38487 /** outputs non-zero variables of solution in transformed problem space to file stream
38488  *
38489  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38490  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38491  *
38492  * @pre This method can be called if SCIP is in one of the following stages:
38493  * - \ref SCIP_STAGE_TRANSFORMED
38494  * - \ref SCIP_STAGE_INITPRESOLVE
38495  * - \ref SCIP_STAGE_PRESOLVING
38496  * - \ref SCIP_STAGE_EXITPRESOLVE
38497  * - \ref SCIP_STAGE_PRESOLVED
38498  * - \ref SCIP_STAGE_INITSOLVE
38499  * - \ref SCIP_STAGE_SOLVING
38500  * - \ref SCIP_STAGE_SOLVED
38501  * - \ref SCIP_STAGE_EXITSOLVE
38502  */
38504  SCIP* scip, /**< SCIP data structure */
38505  SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
38506  FILE* file, /**< output file (or NULL for standard output) */
38507  SCIP_Bool printzeros /**< should variables set to zero be printed? */
38508  )
38509 {
38510  SCIP_Bool currentsol;
38511 
38512  SCIP_CALL( checkStage(scip, "SCIPprintTransSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38513 
38514  currentsol = (sol == NULL);
38515  if( currentsol )
38516  {
38517  /* create a temporary solution that is linked to the current solution */
38518  SCIP_CALL( SCIPsolCreateCurrentSol(&sol, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->primal,
38519  scip->tree, scip->lp, NULL) );
38520  }
38521 
38522  if( SCIPsolIsOriginal(sol) )
38523  {
38524  SCIPerrorMessage("cannot print original space solution as transformed solution\n");
38525  return SCIP_INVALIDCALL;
38526  }
38527 
38528  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
38529  SCIPprintReal(scip, file, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob), 20, 9);
38530  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
38531 
38532  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->transprob, NULL, file, FALSE, printzeros) );
38533 
38534  if( currentsol )
38535  {
38536  /* free temporary solution */
38537  SCIP_CALL( SCIPsolFree(&sol, scip->mem->probmem, scip->primal) );
38538  }
38539 
38540  return SCIP_OKAY;
38541 }
38542 
38543 /** outputs discrete variables of solution in original problem space to the given file stream
38544  *
38545  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38546  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38547  *
38548  * @pre This method can be called if @p scip is in one of the following stages:
38549  * - \ref SCIP_STAGE_PROBLEM
38550  * - \ref SCIP_STAGE_TRANSFORMED
38551  * - \ref SCIP_STAGE_INITPRESOLVE
38552  * - \ref SCIP_STAGE_PRESOLVING
38553  * - \ref SCIP_STAGE_EXITPRESOLVE
38554  * - \ref SCIP_STAGE_PRESOLVED
38555  * - \ref SCIP_STAGE_INITSOLVE
38556  * - \ref SCIP_STAGE_SOLVING
38557  * - \ref SCIP_STAGE_SOLVED
38558  * - \ref SCIP_STAGE_EXITSOLVE
38559  */
38561  SCIP* scip, /**< SCIP data structure */
38562  SCIP_SOL* sol, /**< primal solution */
38563  FILE* file /**< output file (or NULL for standard output) */
38564  )
38565 {
38566  SCIP_Real objvalue;
38567  SCIP_Bool oldquiet = FALSE;
38568 
38569  assert(SCIPisTransformed(scip) || sol != NULL);
38570  assert(sol != NULL);
38571  assert(!SCIPsolIsPartial(sol));
38572 
38573  SCIP_CALL( checkStage(scip, "SCIPprintMIPStart", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38574 
38575  if( file != NULL && scip->messagehdlr != NULL )
38576  {
38577  oldquiet = SCIPmessagehdlrIsQuiet(scip->messagehdlr);
38579  }
38580 
38581  SCIPmessageFPrintInfo(scip->messagehdlr, file, "objective value: ");
38582 
38583  if( SCIPsolIsOriginal(sol) )
38584  objvalue = SCIPsolGetOrigObj(sol);
38585  else
38586  objvalue = SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPsolGetObj(sol, scip->set, scip->transprob, scip->origprob));
38587 
38588  SCIPprintReal(scip, file, objvalue, 20, 15);
38589  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
38590 
38591  SCIP_CALL( SCIPsolPrint(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, TRUE,
38592  TRUE) );
38593 
38594  if( file != NULL && scip->messagehdlr != NULL )
38595  {
38596  SCIPmessagehdlrSetQuiet(scip->messagehdlr, oldquiet);
38597  }
38598 
38599  return SCIP_OKAY;
38600 }
38601 
38602 /** outputs dual solution from LP solver to file stream */
38603 static
38605  SCIP* scip, /**< SCIP data structure */
38606  FILE* file, /**< output file (or NULL for standard output) */
38607  SCIP_Bool printzeros /**< should variables set to zero be printed? */
38608  )
38609 {
38610  SCIP_VAR** vars;
38611  int c;
38612 
38613  assert(scip->lp != NULL);
38614  assert(scip->lp->solved);
38615  assert(scip->lp->dualfeasible);
38616 
38617  /* allocate buffer memory */
38618  SCIP_CALL( SCIPallocBufferArray(scip, &vars, 1) );
38619 
38620  /* print dual solution values of all constraints */
38621  for( c = 0; c < scip->transprob->nconss; ++c )
38622  {
38623  SCIP_CONS* cons;
38624  SCIP_Real solval;
38625  SCIP_Bool success;
38626 
38627  int nvars;
38628 #ifndef NDEBUG
38629  SCIP_CONSHDLR* conshdlr;
38630 #endif
38631  cons = scip->transprob->conss[c];
38632  assert(cons != NULL);
38633 
38634 #ifndef NDEBUG
38635  conshdlr = SCIPconsGetHdlr(cons);
38636  assert(conshdlr != NULL);
38637  assert(strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) == 0);
38638 #endif
38639 
38640  SCIP_CALL( SCIPconsGetNVars(cons, scip->set, &nvars, &success) );
38641 
38642  if( nvars > 1 )
38643  solval = SCIPgetDualsolLinear(scip, cons);
38644  /* the constraint is a bound constraint */
38645  else
38646  {
38647  SCIP_Real varsolval;
38648 
38649  assert(vars != NULL);
38650  SCIP_CALL( SCIPconsGetVars(cons, scip->set, vars, 1, &success) );
38651 
38652  varsolval = SCIPvarGetLPSol(vars[0]);
38653 
38654  /* return the reduced cost of the variable if the constraint would be tight */
38655  if( SCIPsetIsEQ(scip->set, varsolval, SCIPgetRhsLinear(scip, cons))
38656  || SCIPsetIsEQ(scip->set, varsolval, SCIPgetLhsLinear(scip, cons)) )
38657  solval = SCIPgetVarRedcost(scip, vars[0]);
38658  else
38659  solval = 0.0;
38660 
38661  }
38662  assert(solval != SCIP_INVALID); /*lint !e777*/
38663 
38664  if( printzeros || !SCIPisZero(scip, solval) )
38665  {
38666  SCIP_MESSAGEHDLR* messagehdlr = scip->messagehdlr;
38667 
38668  SCIPmessageFPrintInfo(messagehdlr, file, "%-32s", SCIPconsGetName(cons));
38669 
38670  if( SCIPisInfinity(scip, solval) )
38671  SCIPmessageFPrintInfo(messagehdlr, file, " +infinity\n");
38672  else if( SCIPisInfinity(scip, -solval) )
38673  SCIPmessageFPrintInfo(messagehdlr, file, " -infinity\n");
38674  else
38675  {
38676  if( nvars > 1 )
38677  SCIPmessageFPrintInfo(messagehdlr, file, " %20.15g\n", solval);
38678  else
38679  SCIPmessageFPrintInfo(messagehdlr, file, " %20.15g*\n", solval);
38680  }
38681  }
38682 
38683  }
38684 
38685  /* free buffer memory */
38686  SCIPfreeBufferArray(scip, &vars);
38687 
38688  return SCIP_OKAY;
38689 }
38690 
38691 /** check whether the dual solution is available
38692  *
38693  * @note This is used when calling \ref SCIPprintDualSol()
38694  *
38695  * @return is dual solution available?
38696  *
38697  * @pre This method can be called if SCIP is in one of the following stages:
38698  * - \ref SCIP_STAGE_SOLVED
38699  */
38701  SCIP* scip, /**< SCIP data structure */
38702  SCIP_Bool printreason /**< print warning message if dualsol is not available? */
38703  )
38704 {
38705  int c;
38706 
38707  assert(scip != NULL);
38708 
38709  SCIP_CALL_ABORT( checkStage(scip, "SCIPisDualSolAvailable", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
38710 
38711  if( SCIPgetStage(scip) != SCIP_STAGE_SOLVED )
38712  {
38713  if( printreason )
38714  SCIPmessageFPrintInfo(scip->messagehdlr, NULL, "No dual solution available.\n");
38715  return FALSE;
38716  }
38717 
38718  assert(scip->stat != NULL);
38719  assert(scip->transprob != NULL);
38720 
38721  /* dual solution only useful when no presolving was performed */
38722  if( scip->stat->performpresol )
38723  {
38724  if( printreason )
38725  SCIPwarningMessage(scip, "No dual information available when presolving was performed.\n");
38726  return FALSE;
38727  }
38728 
38729  /* dual solution is created by LP solver and therefore only available for pure LPs */
38730  if( scip->transprob->nvars != scip->transprob->ncontvars )
38731  {
38732  if( printreason )
38733  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only continuous variables).\n");
38734  return FALSE;
38735  }
38736 
38737  /* dual solution is created by LP solver and therefore only available for linear constraints */
38738  for( c = scip->transprob->nconss - 1; c >= 0; --c )
38739  {
38740  SCIP_CONSHDLR* conshdlr;
38741 
38742  conshdlr = SCIPconsGetHdlr(scip->transprob->conss[c]);
38743  assert(conshdlr != NULL);
38744 
38745  if( strcmp(SCIPconshdlrGetName(conshdlr), "linear" ) != 0 )
38746  {
38747  if( printreason )
38748  SCIPwarningMessage(scip, "Dual information only available for pure LPs (only linear constraints).\n");
38749  return FALSE;
38750  }
38751  }
38752 
38753  return TRUE;
38754 }
38755 
38756 /** outputs dual solution from LP solver to file stream
38757  *
38758  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38759  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38760  *
38761  * @pre This method can be called in all stages but only prints dual information when called in \ref SCIP_STAGE_SOLVED
38762  */
38764  SCIP* scip, /**< SCIP data structure */
38765  FILE* file, /**< output file (or NULL for standard output) */
38766  SCIP_Bool printzeros /**< should variables set to zero be printed? */
38767  )
38768 {
38769  if( SCIPisDualSolAvailable(scip, TRUE) )
38770  {
38771  /* print dual solution */
38772  SCIP_CALL( printDualSol(scip, file, printzeros) );
38773  }
38774 
38775  return SCIP_OKAY;
38776 }
38777 
38778 
38779 /** outputs non-zero variables of solution representing a ray in original problem space to file stream
38780  *
38781  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38782  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38783  *
38784  * @pre This method can be called if SCIP is in one of the following stages:
38785  * - \ref SCIP_STAGE_PROBLEM
38786  * - \ref SCIP_STAGE_TRANSFORMED
38787  * - \ref SCIP_STAGE_INITPRESOLVE
38788  * - \ref SCIP_STAGE_PRESOLVING
38789  * - \ref SCIP_STAGE_EXITPRESOLVE
38790  * - \ref SCIP_STAGE_PRESOLVED
38791  * - \ref SCIP_STAGE_INITSOLVE
38792  * - \ref SCIP_STAGE_SOLVING
38793  * - \ref SCIP_STAGE_SOLVED
38794  * - \ref SCIP_STAGE_EXITSOLVE
38795  */
38797  SCIP* scip, /**< SCIP data structure */
38798  SCIP_SOL* sol, /**< primal solution representing ray */
38799  FILE* file, /**< output file (or NULL for standard output) */
38800  SCIP_Bool printzeros /**< should variables set to zero be printed? */
38801  )
38802 {
38803  assert(scip != NULL);
38804  assert(sol != NULL);
38805 
38806  SCIP_CALL( checkStage(scip, "SCIPprintRay", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38807 
38808  SCIP_CALL( SCIPsolPrintRay(sol, scip->set, scip->messagehdlr, scip->stat, scip->origprob, scip->transprob, file, printzeros) );
38809 
38810  return SCIP_OKAY;
38811 }
38812 
38813 /** gets number of feasible primal solutions stored in the solution storage in case the problem is transformed;
38814  * in case the problem stage is SCIP_STAGE_PROBLEM, the number of solution in the original solution candidate
38815  * storage is returned
38816  *
38817  * @return number of feasible primal solutions stored in the solution storage in case the problem is transformed; or
38818  * number of solution in the original solution candidate storage if the problem stage is SCIP_STAGE_PROBLEM
38819  *
38820  * @pre This method can be called if SCIP is in one of the following stages:
38821  * - \ref SCIP_STAGE_PROBLEM
38822  * - \ref SCIP_STAGE_TRANSFORMED
38823  * - \ref SCIP_STAGE_INITPRESOLVE
38824  * - \ref SCIP_STAGE_PRESOLVING
38825  * - \ref SCIP_STAGE_EXITPRESOLVE
38826  * - \ref SCIP_STAGE_PRESOLVED
38827  * - \ref SCIP_STAGE_INITSOLVE
38828  * - \ref SCIP_STAGE_SOLVING
38829  * - \ref SCIP_STAGE_SOLVED
38830  * - \ref SCIP_STAGE_EXITSOLVE
38831  */
38833  SCIP* scip /**< SCIP data structure */
38834  )
38835 {
38836  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38837 
38838  switch( scip->set->stage )
38839  {
38840  case SCIP_STAGE_PROBLEM:
38841  return scip->origprimal->nsols;
38842 
38845  case SCIP_STAGE_PRESOLVING:
38847  case SCIP_STAGE_PRESOLVED:
38848  case SCIP_STAGE_INITSOLVE:
38849  case SCIP_STAGE_SOLVING:
38850  case SCIP_STAGE_SOLVED:
38851  case SCIP_STAGE_EXITSOLVE:
38852  return scip->primal->nsols;
38853 
38854  case SCIP_STAGE_INIT:
38856  case SCIP_STAGE_FREETRANS:
38857  default:
38858  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
38859  SCIPABORT();
38860  return -1; /*lint !e527*/
38861  } /*lint !e788*/
38862 }
38863 
38864 /** gets array of feasible primal solutions stored in the solution storage in case the problem is transformed; in case
38865  * if the problem stage is in SCIP_STAGE_PROBLEM, it returns the number array of solution candidate stored
38866  *
38867  * @return array of feasible primal solutions
38868  *
38869  * @pre This method can be called if SCIP is in one of the following stages:
38870  * - \ref SCIP_STAGE_PROBLEM
38871  * - \ref SCIP_STAGE_TRANSFORMED
38872  * - \ref SCIP_STAGE_INITPRESOLVE
38873  * - \ref SCIP_STAGE_PRESOLVING
38874  * - \ref SCIP_STAGE_EXITPRESOLVE
38875  * - \ref SCIP_STAGE_PRESOLVED
38876  * - \ref SCIP_STAGE_INITSOLVE
38877  * - \ref SCIP_STAGE_SOLVING
38878  * - \ref SCIP_STAGE_SOLVED
38879  * - \ref SCIP_STAGE_EXITSOLVE
38880  */
38882  SCIP* scip /**< SCIP data structure */
38883  )
38884 {
38885  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSols", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38886 
38887  switch( scip->set->stage )
38888  {
38889  case SCIP_STAGE_PROBLEM:
38890  return scip->origprimal->sols;
38891 
38894  case SCIP_STAGE_PRESOLVING:
38896  case SCIP_STAGE_PRESOLVED:
38897  case SCIP_STAGE_INITSOLVE:
38898  case SCIP_STAGE_SOLVING:
38899  case SCIP_STAGE_SOLVED:
38900  case SCIP_STAGE_EXITSOLVE:
38901  return scip->primal->sols;
38902 
38903  case SCIP_STAGE_INIT:
38905  case SCIP_STAGE_FREETRANS:
38906  case SCIP_STAGE_FREE:
38907  default:
38908  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
38909  return NULL;
38910  } /*lint !e788*/
38911 }
38912 
38913 /** gets best feasible primal solution found so far if the problem is transformed; in case the problem is in
38914  * SCIP_STAGE_PROBLEM it returns the best solution candidate, or NULL if no solution has been found or the candidate
38915  * store is empty;
38916  *
38917  * @return best feasible primal solution so far
38918  *
38919  * @pre This method can be called if SCIP is in one of the following stages:
38920  * - \ref SCIP_STAGE_PROBLEM
38921  * - \ref SCIP_STAGE_TRANSFORMED
38922  * - \ref SCIP_STAGE_INITPRESOLVE
38923  * - \ref SCIP_STAGE_PRESOLVING
38924  * - \ref SCIP_STAGE_EXITPRESOLVE
38925  * - \ref SCIP_STAGE_PRESOLVED
38926  * - \ref SCIP_STAGE_INITSOLVE
38927  * - \ref SCIP_STAGE_SOLVING
38928  * - \ref SCIP_STAGE_SOLVED
38929  * - \ref SCIP_STAGE_EXITSOLVE
38930  */
38932  SCIP* scip /**< SCIP data structure */
38933  )
38934 {
38935  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
38936  switch( scip->set->stage )
38937  {
38938  case SCIP_STAGE_INIT:
38939  return NULL;
38940  case SCIP_STAGE_PROBLEM:
38941  assert(scip->origprimal != NULL);
38942  if( scip->origprimal->nsols > 0 )
38943  {
38944  assert(scip->origprimal->sols != NULL);
38945  assert(scip->origprimal->sols[0] != NULL);
38946  return scip->origprimal->sols[0];
38947  }
38948  break;
38949 
38952  case SCIP_STAGE_PRESOLVING:
38954  case SCIP_STAGE_PRESOLVED:
38955  case SCIP_STAGE_INITSOLVE:
38956  case SCIP_STAGE_SOLVING:
38957  case SCIP_STAGE_SOLVED:
38958  case SCIP_STAGE_EXITSOLVE:
38959  assert(scip->primal != NULL);
38960  if( scip->primal->nsols > 0 )
38961  {
38962  assert(scip->primal->sols != NULL);
38963  assert(scip->primal->sols[0] != NULL);
38964  return scip->primal->sols[0];
38965  }
38966  break;
38967 
38969  case SCIP_STAGE_FREETRANS:
38970  case SCIP_STAGE_FREE:
38971  default:
38972  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
38973  return NULL;
38974  }
38975 
38976  return NULL;
38977 }
38978 
38979 /** outputs best feasible primal solution found so far to file stream
38980  *
38981  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
38982  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
38983  *
38984  * @pre This method can be called if SCIP is in one of the following stages:
38985  * - \ref SCIP_STAGE_INIT
38986  * - \ref SCIP_STAGE_PROBLEM
38987  * - \ref SCIP_STAGE_TRANSFORMED
38988  * - \ref SCIP_STAGE_INITPRESOLVE
38989  * - \ref SCIP_STAGE_PRESOLVING
38990  * - \ref SCIP_STAGE_EXITPRESOLVE
38991  * - \ref SCIP_STAGE_PRESOLVED
38992  * - \ref SCIP_STAGE_INITSOLVE
38993  * - \ref SCIP_STAGE_SOLVING
38994  * - \ref SCIP_STAGE_SOLVED
38995  * - \ref SCIP_STAGE_EXITSOLVE
38996  */
38998  SCIP* scip, /**< SCIP data structure */
38999  FILE* file, /**< output file (or NULL for standard output) */
39000  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39001  )
39002 {
39003  SCIP_SOL* sol;
39004 
39005  SCIP_CALL( checkStage(scip, "SCIPprintBestSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39006 
39007  sol = SCIPgetBestSol(scip);
39008 
39009  if( sol == NULL )
39010  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
39011  else
39012  {
39013  SCIP_CALL( SCIPprintSol(scip, sol, file, printzeros) );
39014  }
39015 
39016  return SCIP_OKAY;
39017 }
39018 
39019 /** outputs best feasible primal solution found so far in transformed variables to file stream
39020  *
39021  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39022  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39023  *
39024  * @pre This method can be called if SCIP is in one of the following stages:
39025  * - \ref SCIP_STAGE_INIT
39026  * - \ref SCIP_STAGE_PROBLEM
39027  * - \ref SCIP_STAGE_TRANSFORMED
39028  * - \ref SCIP_STAGE_INITPRESOLVE
39029  * - \ref SCIP_STAGE_PRESOLVING
39030  * - \ref SCIP_STAGE_EXITPRESOLVE
39031  * - \ref SCIP_STAGE_PRESOLVED
39032  * - \ref SCIP_STAGE_INITSOLVE
39033  * - \ref SCIP_STAGE_SOLVING
39034  * - \ref SCIP_STAGE_SOLVED
39035  * - \ref SCIP_STAGE_EXITSOLVE
39036  */
39038  SCIP* scip, /**< SCIP data structure */
39039  FILE* file, /**< output file (or NULL for standard output) */
39040  SCIP_Bool printzeros /**< should variables set to zero be printed? */
39041  )
39042 {
39043  SCIP_SOL* sol;
39044 
39045  SCIP_CALL( checkStage(scip, "SCIPprintBestTransSol", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
39046 
39047  sol = SCIPgetBestSol(scip);
39048 
39049  if( sol != NULL && SCIPsolIsOriginal(sol) )
39050  {
39051  SCIPerrorMessage("best solution is defined in original space - cannot print it as transformed solution\n");
39052  return SCIP_INVALIDCALL;
39053  }
39054 
39055  if( sol == NULL )
39056  SCIPmessageFPrintInfo(scip->messagehdlr, file, "no solution available\n");
39057  else
39058  {
39059  SCIP_CALL( SCIPprintTransSol(scip, sol, file, printzeros) );
39060  }
39061 
39062  return SCIP_OKAY;
39063 }
39064 
39065 /** try to round given solution
39066  *
39067  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39068  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39069  *
39070  * @pre This method can be called if SCIP is in one of the following stages:
39071  * - \ref SCIP_STAGE_SOLVING
39072  */
39074  SCIP* scip, /**< SCIP data structure */
39075  SCIP_SOL* sol, /**< primal solution */
39076  SCIP_Bool* success /**< pointer to store whether rounding was successful */
39077  )
39078 {
39079  SCIP_CALL( checkStage(scip, "SCIProundSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39080 
39081  if( SCIPsolIsOriginal(sol) )
39082  {
39083  SCIPerrorMessage("cannot round original space solution\n");
39084  return SCIP_INVALIDCALL;
39085  }
39086 
39087  SCIP_CALL( SCIPsolRound(sol, scip->set, scip->stat, scip->transprob, scip->tree, success) );
39088 
39089  return SCIP_OKAY;
39090 }
39091 
39092 /** retransforms solution to original problem space
39093  *
39094  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39095  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39096  *
39097  * @pre This method can be called if SCIP is in one of the following stages:
39098  * - \ref SCIP_STAGE_TRANSFORMED
39099  * - \ref SCIP_STAGE_INITPRESOLVE
39100  * - \ref SCIP_STAGE_PRESOLVING
39101  * - \ref SCIP_STAGE_EXITPRESOLVE
39102  * - \ref SCIP_STAGE_PRESOLVED
39103  * - \ref SCIP_STAGE_INITSOLVE
39104  * - \ref SCIP_STAGE_SOLVING
39105  * - \ref SCIP_STAGE_SOLVED
39106  * - \ref SCIP_STAGE_EXITSOLVE
39107  * - \ref SCIP_STAGE_FREETRANS
39108  */
39110  SCIP* scip, /**< SCIP data structure */
39111  SCIP_SOL* sol /**< primal CIP solution */
39112  )
39113 {
39114  SCIP_CALL( checkStage(scip, "SCIPretransformSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
39115 
39116  switch ( SCIPsolGetOrigin(sol) )
39117  {
39119  /* nothing to do */
39120  return SCIP_OKAY;
39121 
39122  case SCIP_SOLORIGIN_LPSOL:
39123  case SCIP_SOLORIGIN_NLPSOL:
39126 
39127  /* first unlink solution */
39128  SCIP_CALL( SCIPunlinkSol(scip, sol) );
39129 
39130  /*lint -fallthrough*/
39131  case SCIP_SOLORIGIN_ZERO:
39132  {
39133  SCIP_Bool hasinfval;
39134 
39135  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
39136  break;
39137  }
39140  SCIPerrorMessage("unkown solution origin.\n");
39141  return SCIP_INVALIDCALL;
39142 
39143  default:
39144  /* note that this is in an internal SCIP error since all solution origins are covert in the switch above */
39145  SCIPerrorMessage("invalid solution origin <%d>\n", SCIPsolGetOrigin(sol));
39146  return SCIP_ERROR;
39147  }
39148 
39149  return SCIP_OKAY;
39150 }
39151 
39152 /** reads a given solution file, problem has to be transformed in advance
39153  *
39154  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39155  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39156  *
39157  * @pre This method can be called if SCIP is in one of the following stages:
39158  * - \ref SCIP_STAGE_PROBLEM
39159  * - \ref SCIP_STAGE_TRANSFORMED
39160  * - \ref SCIP_STAGE_INITPRESOLVE
39161  * - \ref SCIP_STAGE_PRESOLVING
39162  * - \ref SCIP_STAGE_EXITPRESOLVE
39163  * - \ref SCIP_STAGE_PRESOLVED
39164  * - \ref SCIP_STAGE_INITSOLVE
39165  * - \ref SCIP_STAGE_SOLVING
39166  */
39168  SCIP* scip, /**< SCIP data structure */
39169  const char* filename /**< name of the input file */
39170  )
39171 {
39172  SCIP_CALL( checkStage(scip, "SCIPreadSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39173 
39174  /* we pass the reading of the solution file on to reader_sol via the following call */
39175  SCIP_CALL( SCIPreadProb(scip, filename, "sol") );
39176 
39177  return SCIP_OKAY;
39178 }
39179 
39180 /** reads a given solution file and store the solution values in the given solution pointer */
39181 static
39183  SCIP* scip, /**< SCIP data structure */
39184  const char* filename, /**< name of the input file */
39185  SCIP_SOL* sol, /**< solution pointer */
39186  SCIP_Bool* partial, /**< pointer to store if the solution is partial (or NULL, if not needed) */
39187  SCIP_Bool* error /**< pointer store if an error occured */
39188  )
39189 {
39190  SCIP_FILE* file;
39191  SCIP_Bool unknownvariablemessage;
39192  SCIP_Bool localpartial;
39193  int lineno;
39194 
39195  assert(scip != NULL);
39196  assert(sol != NULL);
39197  assert(error != NULL);
39198 
39199  /* open input file */
39200  file = SCIPfopen(filename, "r");
39201  if( file == NULL )
39202  {
39203  SCIPerrorMessage("cannot open file <%s> for reading\n", filename);
39204  SCIPprintSysError(filename);
39205  return SCIP_NOFILE;
39206  }
39207 
39208  *error = FALSE;
39209  localpartial = SCIPsolIsPartial(sol);
39210 
39211  unknownvariablemessage = FALSE;
39212  lineno = 0;
39213 
39214  /* read the file */
39215  while( !SCIPfeof(file) && !(*error) )
39216  {
39217  char buffer[SCIP_MAXSTRLEN];
39218  char varname[SCIP_MAXSTRLEN];
39219  char valuestring[SCIP_MAXSTRLEN];
39220  char objstring[SCIP_MAXSTRLEN];
39221  SCIP_VAR* var;
39222  SCIP_Real value;
39223  int nread;
39224 
39225  /* get next line */
39226  if( SCIPfgets(buffer, (int) sizeof(buffer), file) == NULL )
39227  break;
39228  lineno++;
39229 
39230  /* there are some lines which may preceed the solution information */
39231  if( strncasecmp(buffer, "solution status:", 16) == 0 || strncasecmp(buffer, "objective value:", 16) == 0 ||
39232  strncasecmp(buffer, "Log started", 11) == 0 || strncasecmp(buffer, "Variable Name", 13) == 0 ||
39233  strncasecmp(buffer, "All other variables", 19) == 0 || strncasecmp(buffer, "\n", 1) == 0 ||
39234  strncasecmp(buffer, "NAME", 4) == 0 || strncasecmp(buffer, "ENDATA", 6) == 0 ) /* allow parsing of SOL-format on the MIPLIB 2003 pages */
39235  continue;
39236 
39237  /* parse the line */
39238  /* cppcheck-suppress invalidscanf */
39239  nread = sscanf(buffer, "%s %s %s\n", varname, valuestring, objstring);
39240  if( nread < 2 )
39241  {
39242  SCIPerrorMessage("Invalid input line %d in solution file <%s>: <%s>.\n", lineno, filename, buffer);
39243  *error = TRUE;
39244  break;
39245  }
39246 
39247  /* find the variable */
39248  var = SCIPfindVar(scip, varname);
39249  if( var == NULL )
39250  {
39251  if( !unknownvariablemessage )
39252  {
39253  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "unknown variable <%s> in line %d of solution file <%s>\n",
39254  varname, lineno, filename);
39255  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " (further unknown variables are ignored)\n");
39256  unknownvariablemessage = TRUE;
39257  }
39258  continue;
39259  }
39260 
39261  /* cast the value */
39262  if( strncasecmp(valuestring, "inv", 3) == 0 )
39263  continue;
39264  else if( strncasecmp(valuestring, "+inf", 4) == 0 || strncasecmp(valuestring, "inf", 3) == 0 )
39265  value = SCIPinfinity(scip);
39266  else if( strncasecmp(valuestring, "-inf", 4) == 0 )
39267  value = -SCIPinfinity(scip);
39268  else if( strncasecmp(valuestring, "unknown", 7) == 0 )
39269  {
39270  value = SCIP_UNKNOWN;
39271  localpartial = TRUE;
39272  }
39273  else
39274  {
39275  nread = sscanf(valuestring, "%lf", &value);
39276  if( nread != 1 )
39277  {
39278  SCIPerrorMessage("Invalid solution value <%s> for variable <%s> in line %d of solution file <%s>.\n",
39279  valuestring, varname, lineno, filename);
39280  *error = TRUE;
39281  break;
39282  }
39283  }
39284 
39285  /* set the solution value of the variable, if not multiaggregated */
39287  {
39288  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n", SCIPvarGetName(var));
39289  }
39290  else
39291  {
39292  SCIP_RETCODE retcode;
39293 
39294  retcode = SCIPsetSolVal(scip, sol, var, value);
39295 
39296  if( retcode == SCIP_INVALIDDATA )
39297  {
39299  {
39300  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored conflicting solution value for fixed variable <%s>\n",
39301  SCIPvarGetName(var));
39302  }
39303  else
39304  {
39305  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n",
39306  SCIPvarGetName(var));
39307  }
39308  }
39309  else
39310  {
39311  SCIP_CALL_FINALLY( retcode, SCIPfclose(file) );
39312  }
39313  }
39314  }
39315 
39316  /* close input file */
39317  SCIPfclose(file);
39318 
39319  if( localpartial && !SCIPsolIsPartial(sol) )
39320  {
39321  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
39322  {
39323  SCIP_CALL( SCIPsolMarkPartial(sol, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
39324  }
39325  else
39326  *error = TRUE;
39327  }
39328 
39329  if( partial != NULL )
39330  *partial = localpartial;
39331 
39332  return SCIP_OKAY;
39333 }
39334 
39335 /** reads a given xml solution file and store the solution values in the given solution pointer */
39336 static
39338  SCIP* scip, /**< SCIP data structure */
39339  const char* filename, /**< name of the input file */
39340  SCIP_SOL* sol, /**< solution pointer */
39341  SCIP_Bool* partial, /**< pointer to store if the solution is partial (or NULL if not needed) */
39342  SCIP_Bool* error /**< pointer store if an error occured */
39343  )
39344 {
39345  SCIP_Bool unknownvariablemessage;
39346  SCIP_Bool localpartial;
39347  XML_NODE* start;
39348  const XML_NODE* varsnode;
39349  const XML_NODE* varnode;
39350  const char* tag;
39351 
39352  assert(scip != NULL);
39353  assert(sol != NULL);
39354  assert(error != NULL);
39355 
39356  /* read xml file */
39357  start = xmlProcess(filename);
39358 
39359  if( start == NULL )
39360  {
39361  SCIPerrorMessage("Some error occured during parsing the XML solution file.\n");
39362  return SCIP_READERROR;
39363  }
39364 
39365  *error = FALSE;
39366  localpartial = SCIPsolIsPartial(sol);
39367 
39368  /* find variable sections */
39369  tag = "variables";
39370  varsnode = xmlFindNodeMaxdepth(start, tag, 0, 3);
39371  if( varsnode == NULL )
39372  {
39373  /* free xml data */
39374  xmlFreeNode(start);
39375 
39376  SCIPerrorMessage("Variable section not found.\n");
39377  return SCIP_READERROR;
39378  }
39379 
39380  /* loop through all variables */
39381  unknownvariablemessage = FALSE;
39382  for( varnode = xmlFirstChild(varsnode); varnode != NULL; varnode = xmlNextSibl(varnode) )
39383  {
39384  SCIP_VAR* var;
39385  const char* varname;
39386  const char* valuestring;
39387  SCIP_Real value;
39388  int nread;
39389 
39390  /* find variable name */
39391  varname = xmlGetAttrval(varnode, "name");
39392  if( varname == NULL )
39393  {
39394  SCIPerrorMessage("Attribute \"name\" of variable not found.\n");
39395  *error = TRUE;
39396  break;
39397  }
39398 
39399  /* find the variable */
39400  var = SCIPfindVar(scip, varname);
39401  if( var == NULL )
39402  {
39403  if( !unknownvariablemessage )
39404  {
39405  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "unknown variable <%s> of solution file <%s>\n",
39406  varname, filename);
39407  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, " (further unknown variables are ignored)\n");
39408  unknownvariablemessage = TRUE;
39409  }
39410  continue;
39411  }
39412 
39413  /* find value of variable */
39414  valuestring = xmlGetAttrval(varnode, "value");
39415  if( valuestring == NULL )
39416  {
39417  SCIPerrorMessage("Attribute \"value\" of variable not found.\n");
39418  *error = TRUE;
39419  break;
39420  }
39421 
39422  /* cast the value */
39423  if( strncasecmp(valuestring, "inv", 3) == 0 )
39424  continue;
39425  else if( strncasecmp(valuestring, "+inf", 4) == 0 || strncasecmp(valuestring, "inf", 3) == 0 )
39426  value = SCIPinfinity(scip);
39427  else if( strncasecmp(valuestring, "-inf", 4) == 0 )
39428  value = -SCIPinfinity(scip);
39429  else if( strncasecmp(valuestring, "unknown", 7) == 0 )
39430  {
39431  value = SCIP_UNKNOWN;
39432  localpartial = TRUE;
39433  }
39434  else
39435  {
39436  nread = sscanf(valuestring, "%lf", &value);
39437  if( nread != 1 )
39438  {
39439  SCIPwarningMessage(scip, "invalid solution value <%s> for variable <%s> in XML solution file <%s>\n", valuestring, varname, filename);
39440  *error = TRUE;
39441  break;
39442  }
39443  }
39444 
39445  /* set the solution value of the variable, if not multiaggregated */
39447  {
39448  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n", SCIPvarGetName(var));
39449  }
39450  else
39451  {
39452  SCIP_RETCODE retcode;
39453  retcode = SCIPsetSolVal(scip, sol, var, value);
39454 
39455  if( retcode == SCIP_INVALIDDATA )
39456  {
39458  {
39459  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored conflicting solution value for fixed variable <%s>\n",
39460  SCIPvarGetName(var));
39461  }
39462  else
39463  {
39464  SCIPverbMessage(scip, SCIP_VERBLEVEL_NORMAL, NULL, "ignored solution value for multiaggregated variable <%s>\n",
39465  SCIPvarGetName(var));
39466  }
39467  }
39468  else
39469  {
39470  SCIP_CALL( retcode );
39471  }
39472  }
39473  }
39474 
39475  /* free xml data */
39476  xmlFreeNode(start);
39477 
39478  if( localpartial && !SCIPsolIsPartial(sol) )
39479  {
39480  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
39481  {
39482  SCIP_CALL( SCIPsolMarkPartial(sol, scip->set, scip->stat, scip->origprob->vars, scip->origprob->nvars) );
39483  }
39484  else
39485  *error = TRUE;
39486  }
39487 
39488  if( partial != NULL )
39489  *partial = localpartial;
39490 
39491  return SCIP_OKAY;
39492 }
39493 
39494 /** reads a given solution file and store the solution values in the given solution pointer
39495  *
39496  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39497  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39498  *
39499  * @pre This method can be called if SCIP is in one of the following stages:
39500  * - \ref SCIP_STAGE_PROBLEM
39501  * - \ref SCIP_STAGE_TRANSFORMED
39502  * - \ref SCIP_STAGE_INITPRESOLVE
39503  * - \ref SCIP_STAGE_PRESOLVING
39504  * - \ref SCIP_STAGE_EXITPRESOLVE
39505  * - \ref SCIP_STAGE_PRESOLVED
39506  * - \ref SCIP_STAGE_INITSOLVE
39507  * - \ref SCIP_STAGE_SOLVING
39508  */
39510  SCIP* scip, /**< SCIP data structure */
39511  const char* filename, /**< name of the input file */
39512  SCIP_SOL* sol, /**< solution pointer */
39513  SCIP_Bool xml, /**< true, iff the given solution in written in XML */
39514  SCIP_Bool* partial, /**< pointer to store if the solution is partial */
39515  SCIP_Bool* error /**< pointer store if an error occured */
39516  )
39517 {
39518  SCIP_CALL( checkStage(scip, "SCIPreadSolFile", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39519 
39520  if( xml )
39521  {
39522  SCIP_CALL( readXmlSolFile(scip, filename, sol, partial, error) );
39523  }
39524  else
39525  {
39526  SCIP_CALL( readSolFile(scip, filename, sol, partial, error) );
39527  }
39528 
39529  return SCIP_OKAY;
39530 }
39531 
39532 /** adds feasible primal solution to solution storage by copying it
39533  *
39534  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39535  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39536  *
39537  * @pre This method can be called if SCIP is in one of the following stages:
39538  * - \ref SCIP_STAGE_PROBLEM
39539  * - \ref SCIP_STAGE_TRANSFORMED
39540  * - \ref SCIP_STAGE_INITPRESOLVE
39541  * - \ref SCIP_STAGE_PRESOLVING
39542  * - \ref SCIP_STAGE_EXITPRESOLVE
39543  * - \ref SCIP_STAGE_PRESOLVED
39544  * - \ref SCIP_STAGE_SOLVING
39545  * - \ref SCIP_STAGE_FREETRANS
39546  *
39547  * @note Do not call during propagation, use heur_trysol instead.
39548  */
39550  SCIP* scip, /**< SCIP data structure */
39551  SCIP_SOL* sol, /**< primal CIP solution */
39552  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
39553  )
39554 {
39555  SCIP_CALL( checkStage(scip, "SCIPaddSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
39556 
39557  switch( scip->set->stage )
39558  {
39559  case SCIP_STAGE_PROBLEM:
39560  case SCIP_STAGE_FREETRANS:
39561  assert(SCIPsolIsOriginal(sol));
39562  SCIP_CALL( SCIPprimalAddOrigSol(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
39563  return SCIP_OKAY;
39564 
39567  case SCIP_STAGE_PRESOLVING:
39569  /* if the solution is added during presolving and it is not defined on original variables,
39570  * presolving operations will destroy its validity, so we retransform it to the original space
39571  */
39572  if( !SCIPsolIsOriginal(sol) )
39573  {
39574  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
39575  SCIP_SOL* tmpsol = sol;
39576  SCIP_Bool hasinfval;
39577 
39578  SCIP_CALL( SCIPcreateSolCopy(scip, &tmpsol, sol) );
39579 
39580  SCIP_CALL( SCIPsolUnlink(tmpsol, scip->set, scip->transprob) );
39581  SCIP_CALL( SCIPsolRetransform(tmpsol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
39582 
39583  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39584  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
39585  &tmpsol, stored) );
39586 
39587  if( *stored && (bestsol != SCIPgetBestSol(scip)) )
39588  {
39589  SCIPstoreSolutionGap(scip);
39590  }
39591 
39592  return SCIP_OKAY;
39593  }
39594  /*lint -fallthrough*/
39595  case SCIP_STAGE_PRESOLVED:
39596  case SCIP_STAGE_SOLVING:
39597  {
39598  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
39599 
39600  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39601  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol,
39602  stored) );
39603 
39604  /* @todo use solution index rather than pointer */
39605  if( *stored && (bestsol != SCIPgetBestSol(scip)) )
39606  {
39607  SCIPstoreSolutionGap(scip);
39608  }
39609 
39610  return SCIP_OKAY;
39611  }
39613  case SCIP_STAGE_INITSOLVE:
39614  case SCIP_STAGE_SOLVED:
39615  case SCIP_STAGE_EXITSOLVE:
39616  default:
39617  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39618  return SCIP_INVALIDCALL;
39619  } /*lint !e788*/
39620 }
39621 
39622 /** adds primal solution to solution storage, frees the solution afterwards
39623  *
39624  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39625  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39626  *
39627  * @pre This method can be called if SCIP is in one of the following stages:
39628  * - \ref SCIP_STAGE_PROBLEM
39629  * - \ref SCIP_STAGE_TRANSFORMED
39630  * - \ref SCIP_STAGE_INITPRESOLVE
39631  * - \ref SCIP_STAGE_PRESOLVING
39632  * - \ref SCIP_STAGE_EXITPRESOLVE
39633  * - \ref SCIP_STAGE_PRESOLVED
39634  * - \ref SCIP_STAGE_SOLVING
39635  * - \ref SCIP_STAGE_FREETRANS
39636  *
39637  * @note Do not call during propagation, use heur_trysol instead.
39638  */
39640  SCIP* scip, /**< SCIP data structure */
39641  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
39642  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
39643  )
39644 {
39645  SCIP_CALL( checkStage(scip, "SCIPaddSolFree", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE) );
39646 
39647  switch( scip->set->stage )
39648  {
39649  case SCIP_STAGE_PROBLEM:
39650  case SCIP_STAGE_FREETRANS:
39651  assert(SCIPsolIsOriginal(*sol));
39652  SCIP_CALL( SCIPprimalAddOrigSolFree(scip->origprimal, scip->mem->probmem, scip->set, scip->stat, scip->origprob, sol, stored) );
39653  return SCIP_OKAY;
39654 
39657  case SCIP_STAGE_PRESOLVING:
39659  /* if the solution is added during presolving and it is not defined on original variables,
39660  * presolving operations will destroy its validity, so we retransform it to the original space
39661  */
39662  if( !SCIPsolIsOriginal(*sol) )
39663  {
39664  SCIP_Bool hasinfval;
39665 
39666  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
39667  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
39668  }
39669  /*lint -fallthrough*/
39670  case SCIP_STAGE_PRESOLVED:
39671  case SCIP_STAGE_SOLVING:
39672  {
39673  SCIP_SOL* bestsol = SCIPgetBestSol(scip);
39674 
39675  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39676  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
39677  sol, stored) );
39678 
39679  if( *stored )
39680  {
39681  if( bestsol != SCIPgetBestSol(scip) )
39682  {
39683  assert(SCIPgetBestSol(scip) != NULL);
39684  SCIPstoreSolutionGap(scip);
39685  }
39686  }
39687 
39688  return SCIP_OKAY;
39689  }
39691  case SCIP_STAGE_INITSOLVE:
39692  case SCIP_STAGE_SOLVED:
39693  case SCIP_STAGE_EXITSOLVE:
39694  default:
39695  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
39696  return SCIP_INVALIDCALL;
39697  } /*lint !e788*/
39698 }
39699 
39700 /** adds current LP/pseudo solution to solution storage
39701  *
39702  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39703  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39704  *
39705  * @pre This method can be called if SCIP is in one of the following stages:
39706  * - \ref SCIP_STAGE_PRESOLVED
39707  * - \ref SCIP_STAGE_SOLVING
39708  */
39710  SCIP* scip, /**< SCIP data structure */
39711  SCIP_HEUR* heur, /**< heuristic that found the solution */
39712  SCIP_Bool* stored /**< stores whether given solution was good enough to keep */
39713  )
39714 {
39715  SCIP_SOL* bestsol;
39716 
39717  SCIP_CALL( checkStage(scip, "SCIPaddCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39718 
39719  bestsol = SCIPgetBestSol(scip);
39720 
39721  SCIP_CALL( SCIPprimalAddCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39722  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
39723  stored) );
39724 
39725  if( *stored )
39726  {
39727  if( bestsol != SCIPgetBestSol(scip) )
39728  SCIPstoreSolutionGap(scip);
39729  }
39730 
39731  return SCIP_OKAY;
39732 }
39733 
39734 /** checks solution for feasibility; if possible, adds it to storage by copying
39735  *
39736  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39737  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39738  *
39739  * @pre This method can be called if SCIP is in one of the following stages:
39740  * - \ref SCIP_STAGE_TRANSFORMED
39741  * - \ref SCIP_STAGE_INITPRESOLVE
39742  * - \ref SCIP_STAGE_PRESOLVING
39743  * - \ref SCIP_STAGE_EXITPRESOLVE
39744  * - \ref SCIP_STAGE_PRESOLVED
39745  * - \ref SCIP_STAGE_SOLVING
39746  *
39747  * @note Do not call during propagation, use heur_trysol instead.
39748  */
39750  SCIP* scip, /**< SCIP data structure */
39751  SCIP_SOL* sol, /**< primal CIP solution */
39752  SCIP_Bool printreason, /**< Should all reasons of violation be printed? */
39753  SCIP_Bool completely, /**< Should all violations be checked? */
39754  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
39755  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
39756  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
39757  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
39758  )
39759 {
39760  SCIP_SOL* bestsol;
39761 
39762  assert(sol != NULL);
39763  assert(stored != NULL);
39764 
39765  SCIP_CALL( checkStage(scip, "SCIPtrySol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39766 
39767  bestsol = SCIPgetBestSol(scip);
39768 
39769  if( !printreason )
39770  completely = FALSE;
39771 
39772  /* we cannot check partial solutions */
39773  if( SCIPsolIsPartial(sol) )
39774  {
39775  SCIPerrorMessage("Cannot check feasibility of partial solutions.\n");
39776  return SCIP_INVALIDDATA;
39777  }
39778 
39779  /* if the solution is added during presolving and it is not defined on original variables,
39780  * presolving operations will destroy its validity, so we retransform it to the original space
39781  */
39782  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(sol) )
39783  {
39784  SCIP_Bool hasinfval;
39785 
39786  SCIP_CALL( SCIPsolUnlink(sol, scip->set, scip->transprob) );
39787  SCIP_CALL( SCIPsolRetransform(sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
39788  }
39789 
39790  if( SCIPsolIsOriginal(sol) )
39791  {
39792  SCIP_Bool feasible;
39793 
39794  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
39795  * including modifiable constraints */
39796  SCIP_CALL( checkSolOrig(scip, sol, &feasible, printreason, completely, checkbounds, checkintegrality, checklprows, TRUE) );
39797  if( feasible )
39798  {
39799  SCIP_CALL( SCIPprimalAddSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39800  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
39801  sol, stored) );
39802 
39803  if( *stored )
39804  {
39805  if( bestsol != SCIPgetBestSol(scip) )
39806  SCIPstoreSolutionGap(scip);
39807  }
39808  }
39809  else
39810  *stored = FALSE;
39811  }
39812  else
39813  {
39814  SCIP_CALL( SCIPprimalTrySol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->origprob,
39815  scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, sol, printreason,
39816  completely, checkbounds, checkintegrality, checklprows, stored) );
39817 
39818  if( *stored )
39819  {
39820  if( bestsol != SCIPgetBestSol(scip) )
39821  SCIPstoreSolutionGap(scip);
39822  }
39823  }
39824 
39825  return SCIP_OKAY;
39826 }
39827 
39828 /** checks primal solution; if feasible, adds it to storage; solution is freed afterwards
39829  *
39830  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39831  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39832  *
39833  * @pre This method can be called if SCIP is in one of the following stages:
39834  * - \ref SCIP_STAGE_TRANSFORMED
39835  * - \ref SCIP_STAGE_INITPRESOLVE
39836  * - \ref SCIP_STAGE_PRESOLVING
39837  * - \ref SCIP_STAGE_EXITPRESOLVE
39838  * - \ref SCIP_STAGE_PRESOLVED
39839  * - \ref SCIP_STAGE_SOLVING
39840  *
39841  * @note Do not call during propagation, use heur_trysol instead.
39842  */
39844  SCIP* scip, /**< SCIP data structure */
39845  SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */
39846  SCIP_Bool printreason, /**< Should all reasons of violations be printed */
39847  SCIP_Bool completely, /**< Should all violation be checked? */
39848  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
39849  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
39850  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
39851  SCIP_Bool* stored /**< stores whether solution was feasible and good enough to keep */
39852  )
39853 {
39854  SCIP_SOL* bestsol;
39855 
39856  assert(stored != NULL);
39857  assert(sol != NULL);
39858 
39859  SCIP_CALL( checkStage(scip, "SCIPtrySolFree", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39860 
39861  bestsol = SCIPgetBestSol(scip);
39862 
39863  if( !printreason )
39864  completely = FALSE;
39865 
39866  /* we cannot check partial solutions */
39867  if( SCIPsolIsPartial(*sol) )
39868  {
39869  SCIPerrorMessage("Cannot check feasibility of partial solutions.\n");
39870  return SCIP_INVALIDDATA;
39871  }
39872 
39873  /* if the solution is added during presolving and it is not defined on original variables,
39874  * presolving operations will destroy its validity, so we retransform it to the original space
39875  */
39876  if( scip->set->stage == SCIP_STAGE_PRESOLVING && !SCIPsolIsOriginal(*sol) )
39877  {
39878  SCIP_Bool hasinfval;
39879 
39880  SCIP_CALL( SCIPsolUnlink(*sol, scip->set, scip->transprob) );
39881  SCIP_CALL( SCIPsolRetransform(*sol, scip->set, scip->stat, scip->origprob, scip->transprob, &hasinfval) );
39882  }
39883 
39884  if( SCIPsolIsOriginal(*sol) )
39885  {
39886  SCIP_Bool feasible;
39887 
39888  /* SCIPprimalTrySol() can only be called on transformed solutions; therefore check solutions in original problem
39889  * including modifiable constraints
39890  */
39891  SCIP_CALL( checkSolOrig(scip, *sol, &feasible, printreason, completely, checkbounds, checkintegrality, checklprows, TRUE) );
39892 
39893  if( feasible )
39894  {
39895  SCIP_CALL( SCIPprimalAddSolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39896  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
39897  sol, stored) );
39898 
39899  if( *stored )
39900  {
39901  if( bestsol != SCIPgetBestSol(scip) )
39902  SCIPstoreSolutionGap(scip);
39903  }
39904  }
39905  else
39906  {
39907  SCIP_CALL( SCIPsolFree(sol, scip->mem->probmem, scip->primal) );
39908  *stored = FALSE;
39909  }
39910  }
39911  else
39912  {
39913  SCIP_CALL( SCIPprimalTrySolFree(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39914  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter,
39915  sol, printreason, completely, checkbounds, checkintegrality, checklprows, stored) );
39916 
39917  if( *stored )
39918  {
39919  if( bestsol != SCIPgetBestSol(scip) )
39920  SCIPstoreSolutionGap(scip);
39921  }
39922  }
39923 
39924  return SCIP_OKAY;
39925 }
39926 
39927 /** checks current LP/pseudo solution for feasibility; if possible, adds it to storage
39928  *
39929  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39930  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39931  *
39932  * @pre This method can be called if SCIP is in one of the following stages:
39933  * - \ref SCIP_STAGE_PRESOLVED
39934  * - \ref SCIP_STAGE_SOLVING
39935  */
39937  SCIP* scip, /**< SCIP data structure */
39938  SCIP_HEUR* heur, /**< heuristic that found the solution */
39939  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
39940  SCIP_Bool completely, /**< Should all violation be checked? */
39941  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
39942  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
39943  SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */
39944  )
39945 {
39946  SCIP_SOL* bestsol;
39947 
39948  SCIP_CALL( checkStage(scip, "SCIPtryCurrentSol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
39949 
39950  bestsol = SCIPgetBestSol(scip);
39951 
39952  if( !printreason )
39953  completely = FALSE;
39954 
39955  SCIP_CALL( SCIPprimalTryCurrentSol(scip->primal, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat,
39956  scip->origprob, scip->transprob, scip->tree, scip->reopt, scip->lp, scip->eventqueue, scip->eventfilter, heur,
39957  printreason, completely, checkintegrality, checklprows, stored) );
39958 
39959  if( *stored )
39960  {
39961  if( bestsol != SCIPgetBestSol(scip) )
39962  SCIPstoreSolutionGap(scip);
39963  }
39964 
39965  return SCIP_OKAY;
39966 }
39967 
39968 /** returns all partial solutions
39969  *
39970  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39971  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39972  *
39973  * @pre This method can be called if SCIP is in one of the following stages:
39974  * - \ref SCIP_STAGE_PROBLEM
39975  * - \ref SCIP_STAGE_PRESOLVING
39976  * - \ref SCIP_STAGE_SOLVING
39977  * - \ref SCIP_STAGE_SOLVED
39978  */
39980  SCIP* scip /**< SCIP data structure */
39981  )
39982 {
39983  assert(scip != NULL);
39984 
39985  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPartialSols", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
39986 
39987  return scip->origprimal->partialsols;
39988 
39989 }
39990 
39991 /** returns number of partial solutions
39992  *
39993  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
39994  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
39995  *
39996  * @pre This method can be called if SCIP is in one of the following stages:
39997  * - \ref SCIP_STAGE_PROBLEM
39998  * - \ref SCIP_STAGE_PRESOLVING
39999  * - \ref SCIP_STAGE_SOLVING
40000  * - \ref SCIP_STAGE_SOLVED
40001  */
40003  SCIP* scip /**< SCIP data structure */
40004  )
40005 {
40006  assert(scip != NULL);
40007 
40008  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPartialSols", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40009 
40010  return scip->origprimal->npartialsols;
40011 }
40012 
40013 /** checks solution for feasibility without adding it to the solution store
40014  *
40015  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40016  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40017  *
40018  * @pre This method can be called if SCIP is in one of the following stages:
40019  * - \ref SCIP_STAGE_PROBLEM
40020  * - \ref SCIP_STAGE_TRANSFORMED
40021  * - \ref SCIP_STAGE_INITPRESOLVE
40022  * - \ref SCIP_STAGE_PRESOLVING
40023  * - \ref SCIP_STAGE_EXITPRESOLVE
40024  * - \ref SCIP_STAGE_PRESOLVED
40025  * - \ref SCIP_STAGE_INITSOLVE
40026  * - \ref SCIP_STAGE_SOLVING
40027  * - \ref SCIP_STAGE_SOLVED
40028  */
40030  SCIP* scip, /**< SCIP data structure */
40031  SCIP_SOL* sol, /**< primal CIP solution */
40032  SCIP_Bool printreason, /**< Should all reasons of violations be printed? */
40033  SCIP_Bool completely, /**< Should all violation be checked? */
40034  SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */
40035  SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
40036  SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
40037  SCIP_Bool* feasible /**< stores whether given solution is feasible */
40038  )
40039 {
40040  SCIP_CALL( checkStage(scip, "SCIPcheckSol", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40041 
40042  /* return immediately if the solution is of type partial */
40043  if( SCIPsolIsPartial(sol) )
40044  {
40045  SCIPerrorMessage("Cannot check feasibility of partial solutions.");
40046  return SCIP_INVALIDDATA;
40047  }
40048 
40049  /* if we want to solve exactly, the constraint handlers cannot rely on the LP's feasibility */
40050  checklprows = checklprows || scip->set->misc_exactsolve;
40051 
40052  if( !printreason )
40053  completely = FALSE;
40054 
40055  if( SCIPsolIsOriginal(sol) )
40056  {
40057  /* SCIPsolCheck() can only be called on transformed solutions */
40058  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, completely, checkbounds, checkintegrality, checklprows, FALSE) );
40059  }
40060  else
40061  {
40062  SCIP_CALL( SCIPsolCheck(sol, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat, scip->transprob,
40063  printreason, completely, checkbounds, checkintegrality, checklprows, feasible) );
40064  }
40065 
40066  return SCIP_OKAY;
40067 }
40068 
40069 /** checks solution for feasibility in original problem without adding it to the solution store;
40070  * this method is used to double check a solution in order to validate the presolving process
40071  *
40072  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40073  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40074  *
40075  * @pre This method can be called if SCIP is in one of the following stages:
40076  * - \ref SCIP_STAGE_PROBLEM
40077  * - \ref SCIP_STAGE_TRANSFORMED
40078  * - \ref SCIP_STAGE_INITPRESOLVE
40079  * - \ref SCIP_STAGE_PRESOLVING
40080  * - \ref SCIP_STAGE_EXITPRESOLVE
40081  * - \ref SCIP_STAGE_PRESOLVED
40082  * - \ref SCIP_STAGE_INITSOLVE
40083  * - \ref SCIP_STAGE_SOLVING
40084  * - \ref SCIP_STAGE_SOLVED
40085  */
40087  SCIP* scip, /**< SCIP data structure */
40088  SCIP_SOL* sol, /**< primal CIP solution */
40089  SCIP_Bool* feasible, /**< stores whether given solution is feasible */
40090  SCIP_Bool printreason, /**< should the reason for the violation be printed? */
40091  SCIP_Bool completely /**< should all violation be checked? */
40092  )
40093 {
40094  assert(scip != NULL);
40095  assert(sol != NULL);
40096  assert(feasible != NULL);
40097 
40098  SCIP_CALL( checkStage(scip, "SCIPcheckSolOrig", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40099 
40100  /* return immediately if the solution is of type partial */
40101  if( SCIPsolIsPartial(sol) )
40102  {
40103  SCIPerrorMessage("Cannot check feasibility of partial solutions.");
40104  return SCIP_INVALIDDATA;
40105  }
40106 
40107  if( !printreason )
40108  completely = FALSE;
40109 
40110  /* check solution in original problem; that includes bounds, integrality, and non modifiable constraints */
40111  SCIP_CALL( checkSolOrig(scip, sol, feasible, printreason, completely, TRUE, TRUE, TRUE, FALSE) );
40112 
40113  return SCIP_OKAY;
40114 }
40115 
40116 /** return whether a primal ray is stored that proves unboundedness of the LP relaxation
40117  *
40118  * @return return whether a primal ray is stored that proves unboundedness of the LP relaxation
40119  *
40120  * @pre This method can be called if SCIP is in one of the following stages:
40121  * - \ref SCIP_STAGE_SOLVING
40122  * - \ref SCIP_STAGE_SOLVED
40123  */
40125  SCIP* scip /**< SCIP data structure */
40126  )
40127 {
40128  SCIP_CALL_ABORT( checkStage(scip, "SCIPhasPrimalRay", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40129 
40130  return scip->primal->primalray != NULL;
40131 }
40132 
40133 /** gets value of given variable in primal ray causing unboundedness of the LP relaxation;
40134  * should only be called if such a ray is stored (check with SCIPhasPrimalRay())
40135  *
40136  * @return value of given variable in primal ray causing unboundedness of the LP relaxation
40137  *
40138  * @pre This method can be called if SCIP is in one of the following stages:
40139  * - \ref SCIP_STAGE_SOLVING
40140  * - \ref SCIP_STAGE_SOLVED
40141  */
40143  SCIP* scip, /**< SCIP data structure */
40144  SCIP_VAR* var /**< variable to get value for */
40145  )
40146 {
40147  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalRayVal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40148 
40149  assert(var != NULL);
40150  assert(scip->primal->primalray != NULL);
40151  assert(var->scip == scip);
40152 
40153  return SCIPsolGetRayVal(scip->primal->primalray, scip->set, scip->stat, var);
40154 }
40155 
40156 /** updates the primal ray thats proves unboundedness
40157  *
40158  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40159  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40160  *
40161  * @pre This method can be called if @p scip is in one of the following stages:
40162  * - \ref SCIP_STAGE_PRESOLVING
40163  * - \ref SCIP_STAGE_PRESOLVED
40164  * - \ref SCIP_STAGE_SOLVING
40165  * - \ref SCIP_STAGE_SOLVED
40166  *
40167  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
40168  */
40170  SCIP* scip, /**< SCIP data structure */
40171  SCIP_SOL* primalray /**< the new primal ray */
40172  )
40173 {
40174  assert(scip != NULL);
40175  assert(primalray != NULL);
40176 
40177  SCIP_CALL( checkStage(scip, "SCIPupdatePrimalRay", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40178 
40179  SCIP_CALL( SCIPprimalUpdateRay(scip->primal, scip->set, scip->stat, primalray, scip->mem->probmem) );
40180 
40181  return SCIP_OKAY;
40182 }
40183 
40184 
40185 /*
40186  * event methods
40187  */
40188 
40189 /** catches a global (not variable or row dependent) event
40190  *
40191  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40192  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40193  *
40194  * @pre This method can be called if @p scip is in one of the following stages:
40195  * - \ref SCIP_STAGE_TRANSFORMING
40196  * - \ref SCIP_STAGE_TRANSFORMED
40197  * - \ref SCIP_STAGE_INITPRESOLVE
40198  * - \ref SCIP_STAGE_PRESOLVING
40199  * - \ref SCIP_STAGE_EXITPRESOLVE
40200  * - \ref SCIP_STAGE_PRESOLVED
40201  * - \ref SCIP_STAGE_INITSOLVE
40202  * - \ref SCIP_STAGE_SOLVING
40203  * - \ref SCIP_STAGE_SOLVED
40204  * - \ref SCIP_STAGE_EXITSOLVE
40205  * - \ref SCIP_STAGE_FREETRANS
40206  */
40208  SCIP* scip, /**< SCIP data structure */
40209  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
40210  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
40211  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
40212  int* filterpos /**< pointer to store position of event filter entry, or NULL */
40213  )
40214 {
40215  SCIP_CALL( checkStage(scip, "SCIPcatchEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40216 
40217  SCIP_CALL( SCIPeventfilterAdd(scip->eventfilter, scip->mem->probmem, scip->set,
40218  eventtype, eventhdlr, eventdata, filterpos) );
40219 
40220  return SCIP_OKAY;
40221 }
40222 
40223 /** drops a global event (stops to track event)
40224  *
40225  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40226  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40227  *
40228  * @pre This method can be called if @p scip is in one of the following stages:
40229  * - \ref SCIP_STAGE_TRANSFORMING
40230  * - \ref SCIP_STAGE_TRANSFORMED
40231  * - \ref SCIP_STAGE_INITPRESOLVE
40232  * - \ref SCIP_STAGE_PRESOLVING
40233  * - \ref SCIP_STAGE_EXITPRESOLVE
40234  * - \ref SCIP_STAGE_PRESOLVED
40235  * - \ref SCIP_STAGE_INITSOLVE
40236  * - \ref SCIP_STAGE_SOLVING
40237  * - \ref SCIP_STAGE_SOLVED
40238  * - \ref SCIP_STAGE_EXITSOLVE
40239  * - \ref SCIP_STAGE_FREETRANS
40240  */
40242  SCIP* scip, /**< SCIP data structure */
40243  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
40244  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
40245  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
40246  int filterpos /**< position of event filter entry returned by SCIPcatchEvent(), or -1 */
40247  )
40248 {
40249  SCIP_CALL( checkStage(scip, "SCIPdropEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40250 
40251  SCIP_CALL( SCIPeventfilterDel(scip->eventfilter, scip->mem->probmem, scip->set,
40252  eventtype, eventhdlr, eventdata, filterpos) );
40253 
40254  return SCIP_OKAY;
40255 }
40256 
40257 /** catches an objective value or domain change event on the given transformed variable
40258  *
40259  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40260  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40261  *
40262  * @pre This method can be called if @p scip is in one of the following stages:
40263  * - \ref SCIP_STAGE_TRANSFORMING
40264  * - \ref SCIP_STAGE_TRANSFORMED
40265  * - \ref SCIP_STAGE_INITPRESOLVE
40266  * - \ref SCIP_STAGE_PRESOLVING
40267  * - \ref SCIP_STAGE_EXITPRESOLVE
40268  * - \ref SCIP_STAGE_PRESOLVED
40269  * - \ref SCIP_STAGE_INITSOLVE
40270  * - \ref SCIP_STAGE_SOLVING
40271  * - \ref SCIP_STAGE_SOLVED
40272  * - \ref SCIP_STAGE_EXITSOLVE
40273  * - \ref SCIP_STAGE_FREETRANS
40274  */
40276  SCIP* scip, /**< SCIP data structure */
40277  SCIP_VAR* var, /**< transformed variable to catch event for */
40278  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
40279  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
40280  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
40281  int* filterpos /**< pointer to store position of event filter entry, or NULL */
40282  )
40283 {
40284  SCIP_CALL( checkStage(scip, "SCIPcatchVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40285 
40286  if( (eventtype & SCIP_EVENTTYPE_VARCHANGED) == 0 )
40287  {
40288  SCIPerrorMessage("event does not operate on a single variable\n");
40289  return SCIP_INVALIDDATA;
40290  }
40291 
40292  if( SCIPvarIsOriginal(var) )
40293  {
40294  SCIPerrorMessage("cannot catch events on original variable <%s>\n", SCIPvarGetName(var));
40295  return SCIP_INVALIDDATA;
40296  }
40297 
40298  SCIP_CALL( SCIPvarCatchEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
40299 
40300  return SCIP_OKAY;
40301 }
40302 
40303 /** drops an objective value or domain change event (stops to track event) on the given transformed variable
40304  *
40305  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40306  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40307  *
40308  * @pre This method can be called if @p scip is in one of the following stages:
40309  * - \ref SCIP_STAGE_TRANSFORMING
40310  * - \ref SCIP_STAGE_TRANSFORMED
40311  * - \ref SCIP_STAGE_INITPRESOLVE
40312  * - \ref SCIP_STAGE_PRESOLVING
40313  * - \ref SCIP_STAGE_EXITPRESOLVE
40314  * - \ref SCIP_STAGE_PRESOLVED
40315  * - \ref SCIP_STAGE_INITSOLVE
40316  * - \ref SCIP_STAGE_SOLVING
40317  * - \ref SCIP_STAGE_SOLVED
40318  * - \ref SCIP_STAGE_EXITSOLVE
40319  * - \ref SCIP_STAGE_FREETRANS
40320  */
40322  SCIP* scip, /**< SCIP data structure */
40323  SCIP_VAR* var, /**< transformed variable to drop event for */
40324  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
40325  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
40326  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
40327  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
40328  )
40329 {
40330  SCIP_CALL( checkStage(scip, "SCIPdropVarEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40331 
40332  if( SCIPvarIsOriginal(var) )
40333  {
40334  SCIPerrorMessage("cannot drop events on original variable <%s>\n", SCIPvarGetName(var));
40335  return SCIP_INVALIDDATA;
40336  }
40337 
40338  SCIP_CALL( SCIPvarDropEvent(var, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
40339 
40340  return SCIP_OKAY;
40341 }
40342 
40343 /** catches a row coefficient, constant, or side change event on the given row
40344  *
40345  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40346  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40347  *
40348  * @pre This method can be called if @p scip is in one of the following stages:
40349  * - \ref SCIP_STAGE_TRANSFORMING
40350  * - \ref SCIP_STAGE_TRANSFORMED
40351  * - \ref SCIP_STAGE_INITPRESOLVE
40352  * - \ref SCIP_STAGE_PRESOLVING
40353  * - \ref SCIP_STAGE_EXITPRESOLVE
40354  * - \ref SCIP_STAGE_PRESOLVED
40355  * - \ref SCIP_STAGE_INITSOLVE
40356  * - \ref SCIP_STAGE_SOLVING
40357  * - \ref SCIP_STAGE_SOLVED
40358  * - \ref SCIP_STAGE_EXITSOLVE
40359  * - \ref SCIP_STAGE_FREETRANS
40360  */
40362  SCIP* scip, /**< SCIP data structure */
40363  SCIP_ROW* row, /**< linear row to catch event for */
40364  SCIP_EVENTTYPE eventtype, /**< event type mask to select events to catch */
40365  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
40366  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
40367  int* filterpos /**< pointer to store position of event filter entry, or NULL */
40368  )
40369 {
40370  SCIP_CALL( checkStage(scip, "SCIPcatchRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40371 
40372  if( (eventtype & SCIP_EVENTTYPE_ROWCHANGED) == 0 )
40373  {
40374  SCIPerrorMessage("event does not operate on a single row\n");
40375  return SCIP_INVALIDDATA;
40376  }
40377 
40378  SCIP_CALL( SCIProwCatchEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
40379 
40380  return SCIP_OKAY;
40381 }
40382 
40383 /** drops a row coefficient, constant, or side change event (stops to track event) on the given row
40384  *
40385  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40386  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40387  *
40388  * @pre This method can be called if @p scip is in one of the following stages:
40389  * - \ref SCIP_STAGE_TRANSFORMING
40390  * - \ref SCIP_STAGE_TRANSFORMED
40391  * - \ref SCIP_STAGE_INITPRESOLVE
40392  * - \ref SCIP_STAGE_PRESOLVING
40393  * - \ref SCIP_STAGE_EXITPRESOLVE
40394  * - \ref SCIP_STAGE_PRESOLVED
40395  * - \ref SCIP_STAGE_INITSOLVE
40396  * - \ref SCIP_STAGE_SOLVING
40397  * - \ref SCIP_STAGE_SOLVED
40398  * - \ref SCIP_STAGE_EXITSOLVE
40399  * - \ref SCIP_STAGE_FREETRANS
40400  */
40402  SCIP* scip, /**< SCIP data structure */
40403  SCIP_ROW* row, /**< linear row to drop event for */
40404  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
40405  SCIP_EVENTHDLR* eventhdlr, /**< event handler to process events with */
40406  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler when processing this event */
40407  int filterpos /**< position of event filter entry returned by SCIPcatchVarEvent(), or -1 */
40408  )
40409 {
40410  SCIP_CALL( checkStage(scip, "SCIPdropRowEvent", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
40411 
40412  SCIP_CALL( SCIProwDropEvent(row, scip->mem->probmem, scip->set, eventtype, eventhdlr, eventdata, filterpos) );
40413 
40414  return SCIP_OKAY;
40415 }
40416 
40417 
40418 /*
40419  * tree methods
40420  */
40421 
40422 /** gets focus node in the tree
40423  *
40424  * if we are in probing/diving mode this method returns the node in the tree where the probing/diving mode was started.
40425  *
40426  * @return the current node of the search tree
40427  *
40428  * @pre This method can be called if @p scip is in one of the following stages:
40429  * - \ref SCIP_STAGE_INITPRESOLVE
40430  * - \ref SCIP_STAGE_PRESOLVING
40431  * - \ref SCIP_STAGE_EXITPRESOLVE
40432  * - \ref SCIP_STAGE_SOLVING
40433  */
40435  SCIP* scip /**< SCIP data structure */
40436  )
40437 {
40438  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFocusNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40439 
40440  return SCIPtreeGetFocusNode(scip->tree);
40441 }
40442 
40443 /** gets current node in the tree
40444  *
40445  * @return the current node of the search tree
40446  *
40447  * @pre This method can be called if @p scip is in one of the following stages:
40448  * - \ref SCIP_STAGE_INITPRESOLVE
40449  * - \ref SCIP_STAGE_PRESOLVING
40450  * - \ref SCIP_STAGE_EXITPRESOLVE
40451  * - \ref SCIP_STAGE_SOLVING
40452  */
40454  SCIP* scip /**< SCIP data structure */
40455  )
40456 {
40457  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCurrentNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40458 
40459  return SCIPtreeGetCurrentNode(scip->tree);
40460 }
40461 
40462 /** gets the root node of the tree
40463  *
40464  * @return the root node of the search tree
40465  *
40466  * @pre This method can be called if @p scip is in one of the following stages:
40467  * - \ref SCIP_STAGE_INITPRESOLVE
40468  * - \ref SCIP_STAGE_PRESOLVING
40469  * - \ref SCIP_STAGE_EXITPRESOLVE
40470  * - \ref SCIP_STAGE_SOLVING
40471  */
40473  SCIP* scip /**< SCIP data structure */
40474  )
40475 {
40476  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRootNode", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40477 
40478  return SCIPtreeGetRootNode(scip->tree);
40479 }
40480 
40481 /** gets the effective root depth, i.e., the depth of the deepest node which is part of all paths from the root node
40482  * to the unprocessed nodes.
40483  *
40484  * @return effective root depth
40485  *
40486  * @pre This method can be called if @p scip is in one of the following stages:
40487  * - \ref SCIP_STAGE_SOLVING
40488  */
40490  SCIP* scip /**< SCIP data structure */
40491  )
40492 {
40493  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetEffectiveRootDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40494 
40495  return SCIPtreeGetEffectiveRootDepth(scip->tree);
40496 }
40497 
40498 /** returns whether the current node is already solved and only propagated again
40499  *
40500  * @return TRUE is returned if \SCIP performance repropagation, otherwise FALSE.
40501  *
40502  * @pre This method can be called if @p scip is in one of the following stages:
40503  * - \ref SCIP_STAGE_INITPRESOLVE
40504  * - \ref SCIP_STAGE_PRESOLVING
40505  * - \ref SCIP_STAGE_EXITPRESOLVE
40506  * - \ref SCIP_STAGE_SOLVING
40507  */
40509  SCIP* scip /**< SCIP data structure */
40510  )
40511 {
40512  SCIP_CALL_ABORT( checkStage(scip, "SCIPinRepropagation", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40513 
40514  return SCIPtreeInRepropagation(scip->tree);
40515 }
40516 
40517 /** gets children of focus node along with the number of children
40518  *
40519  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40520  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40521  *
40522  * @pre This method can be called if @p scip is in one of the following stages:
40523  * - \ref SCIP_STAGE_SOLVING
40524  * - \ref SCIP_STAGE_SOLVED
40525  */
40527  SCIP* scip, /**< SCIP data structure */
40528  SCIP_NODE*** children, /**< pointer to store children array, or NULL if not needed */
40529  int* nchildren /**< pointer to store number of children, or NULL if not needed */
40530  )
40531 {
40532  SCIP_CALL( checkStage(scip, "SCIPgetChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40533 
40534  if( children != NULL )
40535  *children = scip->tree->children;
40536  if( nchildren != NULL )
40537  *nchildren = scip->tree->nchildren;
40538 
40539  return SCIP_OKAY;
40540 }
40541 
40542 /** gets number of children of focus node
40543  *
40544  * @return number of children of the focus node
40545  *
40546  * @pre This method can be called if @p scip is in one of the following stages:
40547  * - \ref SCIP_STAGE_SOLVING
40548  * - \ref SCIP_STAGE_SOLVED
40549  */
40551  SCIP* scip /**< SCIP data structure */
40552  )
40553 {
40554  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNChildren", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40555 
40556  return scip->tree->nchildren;
40557 }
40558 
40559 /** gets siblings of focus node along with the number of siblings
40560  *
40561  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40562  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40563  *
40564  * @pre This method can be called if @p scip is in one of the following stages:
40565  * - \ref SCIP_STAGE_SOLVING
40566  * - \ref SCIP_STAGE_SOLVED
40567  */
40569  SCIP* scip, /**< SCIP data structure */
40570  SCIP_NODE*** siblings, /**< pointer to store siblings array, or NULL if not needed */
40571  int* nsiblings /**< pointer to store number of siblings, or NULL if not needed */
40572  )
40573 {
40574  SCIP_CALL( checkStage(scip, "SCIPgetSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40575 
40576  if( siblings != NULL )
40577  *siblings = scip->tree->siblings;
40578  if( nsiblings != NULL )
40579  *nsiblings = scip->tree->nsiblings;
40580 
40581  return SCIP_OKAY;
40582 }
40583 
40584 /** gets number of siblings of focus node
40585  *
40586  * @return the number of siblings of focus node
40587  *
40588  * @pre This method can be called if @p scip is in one of the following stages:
40589  * - \ref SCIP_STAGE_SOLVING
40590  * - \ref SCIP_STAGE_SOLVED
40591  */
40593  SCIP* scip /**< SCIP data structure */
40594  )
40595 {
40596  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSiblings", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40597 
40598  return scip->tree->nsiblings;
40599 }
40600 
40601 /** gets leaves of the tree along with the number of leaves
40602  *
40603  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40604  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40605  *
40606  * @pre This method can be called if @p scip is in one of the following stages:
40607  * - \ref SCIP_STAGE_SOLVING
40608  * - \ref SCIP_STAGE_SOLVED
40609  */
40611  SCIP* scip, /**< SCIP data structure */
40612  SCIP_NODE*** leaves, /**< pointer to store leaves array, or NULL if not needed */
40613  int* nleaves /**< pointer to store number of leaves, or NULL if not needed */
40614  )
40615 {
40616  SCIP_CALL( checkStage(scip, "SCIPgetLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40617 
40618  if( leaves != NULL )
40619  *leaves = SCIPnodepqNodes(scip->tree->leaves);
40620  if( nleaves != NULL )
40621  *nleaves = SCIPnodepqLen(scip->tree->leaves);
40622 
40623  return SCIP_OKAY;
40624 }
40625 
40626 /** gets number of leaves in the tree
40627  *
40628  * @return the number of leaves in the tree
40629  *
40630  * @pre This method can be called if @p scip is in one of the following stages:
40631  * - \ref SCIP_STAGE_SOLVING
40632  * - \ref SCIP_STAGE_SOLVED
40633  */
40635  SCIP* scip /**< SCIP data structure */
40636  )
40637 {
40638  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLeaves", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
40639 
40640  return SCIPnodepqLen(scip->tree->leaves);
40641 }
40642 
40643 /** gets the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
40644  *
40645  * @return the best child of the focus node w.r.t. the node selection priority assigned by the branching rule
40646  *
40647  * @pre This method can be called if @p scip is in one of the following stages:
40648  * - \ref SCIP_STAGE_SOLVING
40649  */
40651  SCIP* scip /**< SCIP data structure */
40652  )
40653 {
40654  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40655 
40656  return SCIPtreeGetPrioChild(scip->tree);
40657 }
40658 
40659 /** gets the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
40660  *
40661  * @return the best sibling of the focus node w.r.t. the node selection priority assigned by the branching rule
40662  *
40663  * @pre This method can be called if @p scip is in one of the following stages:
40664  * - \ref SCIP_STAGE_SOLVING
40665  */
40667  SCIP* scip /**< SCIP data structure */
40668  )
40669 {
40670  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrioSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40671 
40672  return SCIPtreeGetPrioSibling(scip->tree);
40673 }
40674 
40675 /** gets the best child of the focus node w.r.t. the node selection strategy
40676  *
40677  * @return the best child of the focus node w.r.t. the node selection strategy
40678  *
40679  * @pre This method can be called if @p scip is in one of the following stages:
40680  * - \ref SCIP_STAGE_SOLVING
40681  */
40683  SCIP* scip /**< SCIP data structure */
40684  )
40685 {
40686  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestChild", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40687 
40688  return SCIPtreeGetBestChild(scip->tree, scip->set);
40689 }
40690 
40691 /** gets the best sibling of the focus node w.r.t. the node selection strategy
40692  *
40693  * @return the best sibling of the focus node w.r.t. the node selection strategy
40694  *
40695  * @pre This method can be called if @p scip is in one of the following stages:
40696  * - \ref SCIP_STAGE_SOLVING
40697  */
40699  SCIP* scip /**< SCIP data structure */
40700  )
40701 {
40702  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestSibling", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40703 
40704  return SCIPtreeGetBestSibling(scip->tree, scip->set);
40705 }
40706 
40707 /** gets the best leaf from the node queue w.r.t. the node selection strategy
40708  *
40709  * @return the best leaf from the node queue w.r.t. the node selection strategy
40710  *
40711  * @pre This method can be called if @p scip is in one of the following stages:
40712  * - \ref SCIP_STAGE_SOLVING
40713  */
40715  SCIP* scip /**< SCIP data structure */
40716  )
40717 {
40718  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestLeaf", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40719 
40720  return SCIPtreeGetBestLeaf(scip->tree);
40721 }
40722 
40723 /** gets the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
40724  *
40725  * @return the best node from the tree (child, sibling, or leaf) w.r.t. the node selection strategy
40726  *
40727  * @pre This method can be called if @p scip is in one of the following stages:
40728  * - \ref SCIP_STAGE_SOLVING
40729  */
40731  SCIP* scip /**< SCIP data structure */
40732  )
40733 {
40734  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40735 
40736  return SCIPtreeGetBestNode(scip->tree, scip->set);
40737 }
40738 
40739 /** gets the node with smallest lower bound from the tree (child, sibling, or leaf)
40740  *
40741  * @return the node with smallest lower bound from the tree (child, sibling, or leaf)
40742  *
40743  * @pre This method can be called if @p scip is in one of the following stages:
40744  * - \ref SCIP_STAGE_SOLVING
40745  */
40747  SCIP* scip /**< SCIP data structure */
40748  )
40749 {
40750  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetBestboundNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40751 
40752  return SCIPtreeGetLowerboundNode(scip->tree, scip->set);
40753 }
40754 
40755 /** access to all data of open nodes (leaves, children, and siblings)
40756  *
40757  * @pre This method can be called if @p scip is in one of the following stages:
40758  * - \ref SCIP_STAGE_SOLVING
40759  */
40761  SCIP* scip, /**< SCIP data structure */
40762  SCIP_NODE*** leaves, /**< pointer to store the leaves, or NULL if not needed */
40763  SCIP_NODE*** children, /**< pointer to store the children, or NULL if not needed */
40764  SCIP_NODE*** siblings, /**< pointer to store the siblings, or NULL if not needed */
40765  int* nleaves, /**< pointer to store the number of leaves, or NULL */
40766  int* nchildren, /**< pointer to store the number of children, or NULL */
40767  int* nsiblings /**< pointer to store the number of siblings, or NULL */
40768  )
40769 {
40770  SCIP_CALL( checkStage(scip, "SCIPgetOpenNodesData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40771 
40772  if( leaves != NULL )
40773  *leaves = SCIPnodepqNodes(scip->tree->leaves);
40774  if( children != NULL )
40775  *children = scip->tree->children;
40776  if( siblings != NULL )
40777  *siblings = scip->tree->siblings;
40778  if( nleaves != NULL )
40779  *nleaves = SCIPnodepqLen(scip->tree->leaves);
40780  if( nchildren != NULL )
40781  *nchildren = SCIPtreeGetNChildren(scip->tree);
40782  if( nsiblings != NULL )
40783  *nsiblings = SCIPtreeGetNSiblings(scip->tree);
40784 
40785  return SCIP_OKAY;
40786 }
40787 
40788 /** cuts off node and whole sub tree from branch and bound tree
40789  *
40790  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40791  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40792  *
40793  * @pre This method can be called if @p scip is in one of the following stages:
40794  * - \ref SCIP_STAGE_SOLVING
40795  */
40797  SCIP* scip, /**< SCIP data structure */
40798  SCIP_NODE* node /**< node that should be cut off */
40799  )
40800 {
40801  SCIP_CALL( checkStage(scip, "SCIPcutoffNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40802 
40803  SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->tree, scip->transprob, scip->origprob, scip->reopt,
40804  scip->lp, scip->mem->probmem) );
40805 
40806  return SCIP_OKAY;
40807 }
40808 
40809 /** marks the given node to be propagated again the next time a node of its subtree is processed
40810  *
40811  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40812  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40813  *
40814  * @pre This method can be called if @p scip is in one of the following stages:
40815  * - \ref SCIP_STAGE_SOLVING
40816  */
40818  SCIP* scip, /**< SCIP data structure */
40819  SCIP_NODE* node /**< node that should be propagated again */
40820  )
40821 {
40822  SCIP_CALL( checkStage(scip, "SCIPrepropagateNode", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40823 
40824  SCIPnodePropagateAgain(node, scip->set, scip->stat, scip->tree);
40825 
40826  return SCIP_OKAY;
40827 }
40828 
40829 /** returns depth of first node in active path that is marked being cutoff
40830  *
40831  * @return depth of first node in active path that is marked being cutoff
40832  *
40833  * @pre This method can be called if @p scip is in one of the following stages:
40834  * - \ref SCIP_STAGE_SOLVING
40835  */
40837  SCIP* scip /**< SCIP data structure */
40838  )
40839 {
40840  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40841 
40842  return scip->tree->cutoffdepth;
40843 }
40844 
40845 /** returns depth of first node in active path that has to be propagated again
40846  *
40847  * @return depth of first node in active path that has to be propagated again
40848  *
40849  * @pre This method can be called if @p scip is in one of the following stages:
40850  * - \ref SCIP_STAGE_SOLVING
40851  */
40853  SCIP* scip /**< SCIP data structure */
40854  )
40855 {
40856  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetRepropdepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40857 
40858  return scip->tree->repropdepth;
40859 }
40860 
40861 /** prints all branching decisions on variables from the root to the given node
40862  *
40863  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40864  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40865  *
40866  * @pre This method can be called if @p scip is in one of the following stages:
40867  * - \ref SCIP_STAGE_SOLVING
40868  */
40870  SCIP* scip, /**< SCIP data structure */
40871  SCIP_NODE* node, /**< node data */
40872  FILE* file /**< output file (or NULL for standard output) */
40873  )
40874 {
40875  SCIP_VAR** branchvars; /* array of variables on which the branchings has been performed in all ancestors */
40876  SCIP_Real* branchbounds; /* array of bounds which the branchings in all ancestors set */
40877  SCIP_BOUNDTYPE* boundtypes; /* array of boundtypes which the branchings in all ancestors set */
40878  int* nodeswitches; /* marks, where in the arrays the branching decisions of the next node on the path start
40879  * branchings performed at the parent of node always start at position 0. For single variable branching,
40880  * nodeswitches[i] = i holds */
40881  int nbranchvars; /* number of variables on which branchings have been performed in all ancestors
40882  * if this is larger than the array size, arrays should be reallocated and method should be called again */
40883  int branchvarssize; /* available slots in arrays */
40884  int nnodes; /* number of nodes in the nodeswitch array */
40885  int nodeswitchsize; /* available slots in node switch array */
40886 
40887  branchvarssize = SCIPnodeGetDepth(node);
40888  nodeswitchsize = branchvarssize;
40889 
40890  /* memory allocation */
40891  SCIP_CALL( SCIPallocBufferArray(scip, &branchvars, branchvarssize) );
40892  SCIP_CALL( SCIPallocBufferArray(scip, &branchbounds, branchvarssize) );
40893  SCIP_CALL( SCIPallocBufferArray(scip, &boundtypes, branchvarssize) );
40894  SCIP_CALL( SCIPallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
40895 
40896  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize );
40897 
40898  /* if the arrays were to small, we have to reallocate them and recall SCIPnodeGetAncestorBranchingPath */
40899  if( nbranchvars > branchvarssize || nnodes > nodeswitchsize )
40900  {
40901  branchvarssize = nbranchvars;
40902  nodeswitchsize = nnodes;
40903 
40904  /* memory reallocation */
40905  SCIP_CALL( SCIPreallocBufferArray(scip, &branchvars, branchvarssize) );
40906  SCIP_CALL( SCIPreallocBufferArray(scip, &branchbounds, branchvarssize) );
40907  SCIP_CALL( SCIPreallocBufferArray(scip, &boundtypes, branchvarssize) );
40908  SCIP_CALL( SCIPreallocBufferArray(scip, &nodeswitches, nodeswitchsize) );
40909 
40910  SCIPnodeGetAncestorBranchingPath(node, branchvars, branchbounds, boundtypes, &nbranchvars, branchvarssize, nodeswitches, &nnodes, nodeswitchsize);
40911  assert(nbranchvars == branchvarssize);
40912  }
40913 
40914  /* we only want to create output, if branchings were performed */
40915  if( nbranchvars >= 1 )
40916  {
40917  int i;
40918  int j;
40919 
40920  /* print all nodes, starting from the root, which is last in the arrays */
40921  for( j = nnodes-1; j >= 0; --j)
40922  {
40923  int end;
40924  if(j == nnodes-1)
40925  end = nbranchvars;
40926  else
40927  end = nodeswitches[j+1];
40928 
40929  for( i = nodeswitches[j]; i < end; ++i )
40930  {
40931  if( i > nodeswitches[j] )
40932  SCIPmessageFPrintInfo(scip->messagehdlr, file, " AND ");
40933  SCIPmessageFPrintInfo(scip->messagehdlr, file, "<%s> %s %.1f",SCIPvarGetName(branchvars[i]), boundtypes[i] == SCIP_BOUNDTYPE_LOWER ? ">=" : "<=", branchbounds[i]);
40934  }
40935  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
40936  if( j > 0 )
40937  {
40938  if( nodeswitches[j]-nodeswitches[j-1] != 1 )
40939  SCIPmessageFPrintInfo(scip->messagehdlr, file, " |\n |\n");
40940  else if( boundtypes[i-1] == SCIP_BOUNDTYPE_LOWER )
40941  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\\ \n \\\n");
40942  else
40943  SCIPmessageFPrintInfo(scip->messagehdlr, file, " /\n/ \n");
40944  }
40945  }
40946  }
40947 
40948  /* free all local memory */
40949  SCIPfreeBufferArray(scip, &nodeswitches);
40950  SCIPfreeBufferArray(scip, &boundtypes);
40951  SCIPfreeBufferArray(scip, &branchbounds);
40952  SCIPfreeBufferArray(scip, &branchvars);
40953 
40954  return SCIP_OKAY;
40955 }
40956 
40957 /** sets whether the LP should be solved at the focus node
40958  *
40959  * @note In order to have an effect, this method needs to be called after a node is focused but before the LP is
40960  * solved.
40961  *
40962  * @pre This method can be called if @p scip is in one of the following stages:
40963  * - \ref SCIP_STAGE_SOLVING
40964  */
40966  SCIP* scip, /**< SCIP data structure */
40967  SCIP_Bool solvelp /**< should the LP be solved? */
40968  )
40969 {
40970  SCIP_CALL_ABORT( checkStage(scip, "SCIPsetFocusnodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
40971 
40972  SCIPtreeSetFocusNodeLP(scip->tree, solvelp);
40973 }
40974 
40975 
40976 /*
40977  * parallel interface methods
40978  */
40979 
40980 /** Constructs the parallel interface to execute processes concurrently.
40981  *
40982  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
40983  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
40984  *
40985  * @pre This method can be called if @p scip is in one of the following stages:
40986  * - \ref SCIP_STAGE_PROBLEM
40987  * - \ref SCIP_STAGE_TRANSFORMING
40988  * - \ref SCIP_STAGE_TRANSFORMED
40989  * - \ref SCIP_STAGE_INITPRESOLVE
40990  * - \ref SCIP_STAGE_PRESOLVING
40991  * - \ref SCIP_STAGE_EXITPRESOLVE
40992  * - \ref SCIP_STAGE_PRESOLVED
40993  * - \ref SCIP_STAGE_INITSOLVE
40994  * - \ref SCIP_STAGE_SOLVING
40995  * - \ref SCIP_STAGE_SOLVED
40996  * - \ref SCIP_STAGE_EXITSOLVE
40997  * - \ref SCIP_STAGE_FREETRANS
40998  *
40999  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41000  */
41002  SCIP* scip /**< SCIP data structure */
41003  )
41004 {
41005  SCIP_CALL( checkStage(scip, "SCIPconstructSyncstore", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41006 
41008 
41009  return SCIP_OKAY;
41010 }
41011 
41012 /** releases the current parallel interface
41013  *
41014  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
41015  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
41016  *
41017  * @pre This method can be called if @p scip is in one of the following stages:
41018  * - \ref SCIP_STAGE_PROBLEM
41019  * - \ref SCIP_STAGE_TRANSFORMING
41020  * - \ref SCIP_STAGE_TRANSFORMED
41021  * - \ref SCIP_STAGE_INITPRESOLVE
41022  * - \ref SCIP_STAGE_PRESOLVING
41023  * - \ref SCIP_STAGE_EXITPRESOLVE
41024  * - \ref SCIP_STAGE_PRESOLVED
41025  * - \ref SCIP_STAGE_INITSOLVE
41026  * - \ref SCIP_STAGE_SOLVING
41027  * - \ref SCIP_STAGE_SOLVED
41028  * - \ref SCIP_STAGE_EXITSOLVE
41029  * - \ref SCIP_STAGE_FREETRANS
41030  * - \ref SCIP_STAGE_FREE
41031  *
41032  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41033  */
41035  SCIP* scip /**< SCIP data structure */
41036  )
41037 {
41038  SCIP_CALL( checkStage(scip, "SCIPfreeSyncstore", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE) );
41039 
41041 
41042  return SCIP_OKAY;
41043 }
41044 
41045 /** Gets the parallel interface to execute processes concurrently.
41046  *
41047  * @return the \ref SCIP_SYNCSTORE parallel interface pointer to submit jobs for concurrent processing.
41048  *
41049  * @pre This method can be called if @p scip is in one of the following stages:
41050  * - \ref SCIP_STAGE_INIT
41051  * - \ref SCIP_STAGE_PROBLEM
41052  * - \ref SCIP_STAGE_TRANSFORMING
41053  * - \ref SCIP_STAGE_TRANSFORMED
41054  * - \ref SCIP_STAGE_INITPRESOLVE
41055  * - \ref SCIP_STAGE_PRESOLVING
41056  * - \ref SCIP_STAGE_EXITPRESOLVE
41057  * - \ref SCIP_STAGE_PRESOLVED
41058  * - \ref SCIP_STAGE_INITSOLVE
41059  * - \ref SCIP_STAGE_SOLVING
41060  * - \ref SCIP_STAGE_SOLVED
41061  * - \ref SCIP_STAGE_EXITSOLVE
41062  * - \ref SCIP_STAGE_FREETRANS
41063  *
41064  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
41065  */
41067  SCIP* scip /**< SCIP data structure */
41068  )
41069 {
41070  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSyncstore", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41071 
41072  return scip->syncstore;
41073 }
41074 
41075 
41076 
41077 /*
41078  * statistic methods
41079  */
41080 
41081 /** gets number of branch and bound runs performed, including the current run
41082  *
41083  * @return the number of branch and bound runs performed, including the current run
41084  *
41085  * @pre This method can be called if SCIP is in one of the following stages:
41086  * - \ref SCIP_STAGE_PROBLEM
41087  * - \ref SCIP_STAGE_TRANSFORMING
41088  * - \ref SCIP_STAGE_TRANSFORMED
41089  * - \ref SCIP_STAGE_INITPRESOLVE
41090  * - \ref SCIP_STAGE_PRESOLVING
41091  * - \ref SCIP_STAGE_EXITPRESOLVE
41092  * - \ref SCIP_STAGE_PRESOLVED
41093  * - \ref SCIP_STAGE_INITSOLVE
41094  * - \ref SCIP_STAGE_SOLVING
41095  * - \ref SCIP_STAGE_SOLVED
41096  * - \ref SCIP_STAGE_EXITSOLVE
41097  * - \ref SCIP_STAGE_FREETRANS
41098  */
41100  SCIP* scip /**< SCIP data structure */
41101  )
41102 {
41103  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41104 
41105  return scip->stat->nruns;
41106 }
41107 
41108 /** gets number of reoptimization runs performed, including the current run
41109  *
41110  * @return the number of reoptimization runs performed, including the current run
41111  *
41112  * @pre This method can be called if SCIP is in one of the following stages:
41113  * - \ref SCIP_STAGE_PROBLEM
41114  * - \ref SCIP_STAGE_TRANSFORMING
41115  * - \ref SCIP_STAGE_TRANSFORMED
41116  * - \ref SCIP_STAGE_INITPRESOLVE
41117  * - \ref SCIP_STAGE_PRESOLVING
41118  * - \ref SCIP_STAGE_EXITPRESOLVE
41119  * - \ref SCIP_STAGE_PRESOLVED
41120  * - \ref SCIP_STAGE_INITSOLVE
41121  * - \ref SCIP_STAGE_SOLVING
41122  * - \ref SCIP_STAGE_SOLVED
41123  * - \ref SCIP_STAGE_EXITSOLVE
41124  * - \ref SCIP_STAGE_FREETRANS
41125  */
41127  SCIP* scip /**< SCIP data structure */
41128  )
41129 {
41130  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNReoptRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41131 
41132  return scip->stat->nreoptruns;
41133 }
41134 
41135 /** add given number to the number of processed nodes in current run and in all runs, including the focus node
41136  *
41137  * @return the number of processed nodes in current run, including the focus node
41138  *
41139  * @pre This method can be called if SCIP is in one of the following stages:
41140  * - \ref SCIP_STAGE_PROBLEM
41141  * - \ref SCIP_STAGE_TRANSFORMING
41142  * - \ref SCIP_STAGE_TRANSFORMED
41143  * - \ref SCIP_STAGE_INITPRESOLVE
41144  * - \ref SCIP_STAGE_PRESOLVING
41145  * - \ref SCIP_STAGE_EXITPRESOLVE
41146  * - \ref SCIP_STAGE_PRESOLVED
41147  * - \ref SCIP_STAGE_INITSOLVE
41148  * - \ref SCIP_STAGE_SOLVING
41149  * - \ref SCIP_STAGE_SOLVED
41150  * - \ref SCIP_STAGE_EXITSOLVE
41151  * - \ref SCIP_STAGE_FREETRANS
41152  */
41154  SCIP* scip, /**< SCIP data structure */
41155  SCIP_Longint nnodes /**< number of processed nodes to add to the statistics */
41156  )
41157 {
41158  SCIP_CALL_ABORT( checkStage(scip, "SCIPaddNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41159 
41160  scip->stat->nnodes += nnodes;
41161  scip->stat->ntotalnodes += nnodes;
41162 }
41163 
41164 /** gets number of processed nodes in current run, including the focus node
41165  *
41166  * @return the number of processed nodes in current run, including the focus node
41167  *
41168  * @pre This method can be called if SCIP is in one of the following stages:
41169  * - \ref SCIP_STAGE_PROBLEM
41170  * - \ref SCIP_STAGE_TRANSFORMING
41171  * - \ref SCIP_STAGE_TRANSFORMED
41172  * - \ref SCIP_STAGE_INITPRESOLVE
41173  * - \ref SCIP_STAGE_PRESOLVING
41174  * - \ref SCIP_STAGE_EXITPRESOLVE
41175  * - \ref SCIP_STAGE_PRESOLVED
41176  * - \ref SCIP_STAGE_INITSOLVE
41177  * - \ref SCIP_STAGE_SOLVING
41178  * - \ref SCIP_STAGE_SOLVED
41179  * - \ref SCIP_STAGE_EXITSOLVE
41180  * - \ref SCIP_STAGE_FREETRANS
41181  */
41183  SCIP* scip /**< SCIP data structure */
41184  )
41185 {
41186  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41187 
41188  return scip->stat->nnodes;
41189 }
41190 
41191 /** gets total number of processed nodes in all runs, including the focus node
41192  *
41193  * @return the total number of processed nodes in all runs, including the focus node
41194  *
41195  * @pre This method can be called if SCIP is in one of the following stages:
41196  * - \ref SCIP_STAGE_PROBLEM
41197  * - \ref SCIP_STAGE_TRANSFORMING
41198  * - \ref SCIP_STAGE_TRANSFORMED
41199  * - \ref SCIP_STAGE_INITPRESOLVE
41200  * - \ref SCIP_STAGE_PRESOLVING
41201  * - \ref SCIP_STAGE_EXITPRESOLVE
41202  * - \ref SCIP_STAGE_PRESOLVED
41203  * - \ref SCIP_STAGE_INITSOLVE
41204  * - \ref SCIP_STAGE_SOLVING
41205  * - \ref SCIP_STAGE_SOLVED
41206  * - \ref SCIP_STAGE_EXITSOLVE
41207  * - \ref SCIP_STAGE_FREETRANS
41208  */
41210  SCIP* scip /**< SCIP data structure */
41211  )
41212 {
41213  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNTotalNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41214 
41215  return scip->stat->ntotalnodes;
41216 }
41217 
41218 /** gets number of nodes left in the tree (children + siblings + leaves)
41219  *
41220  * @return the number of nodes left in the tree (children + siblings + leaves)
41221  *
41222  * @pre This method can be called if SCIP is in one of the following stages:
41223  * - \ref SCIP_STAGE_PRESOLVED
41224  * - \ref SCIP_STAGE_SOLVING
41225  * - \ref SCIP_STAGE_SOLVED
41226  */
41228  SCIP* scip /**< SCIP data structure */
41229  )
41230 {
41231  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodesLeft", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41232 
41233  return SCIPtreeGetNNodes(scip->tree);
41234 }
41235 
41236 /** gets number of leaf nodes processed with feasible relaxation solution
41237  *
41238  * @return number of leaf nodes processed with feasible relaxation solution
41239  *
41240  * @pre This method can be called if SCIP is in one of the following stages:
41241  * - \ref SCIP_STAGE_PROBLEM
41242  * - \ref SCIP_STAGE_TRANSFORMING
41243  * - \ref SCIP_STAGE_TRANSFORMED
41244  * - \ref SCIP_STAGE_INITPRESOLVE
41245  * - \ref SCIP_STAGE_PRESOLVING
41246  * - \ref SCIP_STAGE_EXITPRESOLVE
41247  * - \ref SCIP_STAGE_PRESOLVED
41248  * - \ref SCIP_STAGE_INITSOLVE
41249  * - \ref SCIP_STAGE_SOLVING
41250  * - \ref SCIP_STAGE_SOLVED
41251  * - \ref SCIP_STAGE_EXITSOLVE
41252  * - \ref SCIP_STAGE_FREETRANS
41253  */
41255  SCIP* scip /**< SCIP data structure */
41256  )
41257 {
41258  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNFeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41259 
41260  return scip->stat->nfeasleaves;
41261 }
41262 
41263 /** gets number of infeasible leaf nodes processed
41264  *
41265  * @return number of infeasible leaf nodes processed
41266  *
41267  * @pre This method can be called if SCIP is in one of the following stages:
41268  * - \ref SCIP_STAGE_PROBLEM
41269  * - \ref SCIP_STAGE_TRANSFORMING
41270  * - \ref SCIP_STAGE_TRANSFORMED
41271  * - \ref SCIP_STAGE_INITPRESOLVE
41272  * - \ref SCIP_STAGE_PRESOLVING
41273  * - \ref SCIP_STAGE_EXITPRESOLVE
41274  * - \ref SCIP_STAGE_PRESOLVED
41275  * - \ref SCIP_STAGE_INITSOLVE
41276  * - \ref SCIP_STAGE_SOLVING
41277  * - \ref SCIP_STAGE_SOLVED
41278  * - \ref SCIP_STAGE_EXITSOLVE
41279  * - \ref SCIP_STAGE_FREETRANS
41280  */
41282  SCIP* scip /**< SCIP data structure */
41283  )
41284 {
41285  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNInfeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41286 
41287  return scip->stat->ninfeasleaves;
41288 }
41289 
41290 /** gets number of processed leaf nodes that hit LP objective limit
41291  *
41292  * @return number of processed leaf nodes that hit LP objective limit
41293  *
41294  * @pre This method can be called if SCIP is in one of the following stages:
41295  * - \ref SCIP_STAGE_PROBLEM
41296  * - \ref SCIP_STAGE_TRANSFORMING
41297  * - \ref SCIP_STAGE_TRANSFORMED
41298  * - \ref SCIP_STAGE_INITPRESOLVE
41299  * - \ref SCIP_STAGE_PRESOLVING
41300  * - \ref SCIP_STAGE_EXITPRESOLVE
41301  * - \ref SCIP_STAGE_PRESOLVED
41302  * - \ref SCIP_STAGE_INITSOLVE
41303  * - \ref SCIP_STAGE_SOLVING
41304  * - \ref SCIP_STAGE_SOLVED
41305  * - \ref SCIP_STAGE_EXITSOLVE
41306  * - \ref SCIP_STAGE_FREETRANS
41307  */
41309  SCIP* scip /**< Scip data structure */
41310  )
41311 {
41312  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNObjlimLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41313 
41314  return scip->stat->nobjleaves;
41315 }
41316 
41317 
41318 /** gets number of times a selected node was from a cut off subtree
41319  *
41320  * @return number of times a selected node was from a cut off subtree
41321  *
41322  * @pre This method can be called if SCIP is in one of the following stages:
41323  * - \ref SCIP_STAGE_PROBLEM
41324  * - \ref SCIP_STAGE_TRANSFORMING
41325  * - \ref SCIP_STAGE_TRANSFORMED
41326  * - \ref SCIP_STAGE_INITPRESOLVE
41327  * - \ref SCIP_STAGE_PRESOLVING
41328  * - \ref SCIP_STAGE_EXITPRESOLVE
41329  * - \ref SCIP_STAGE_PRESOLVED
41330  * - \ref SCIP_STAGE_INITSOLVE
41331  * - \ref SCIP_STAGE_SOLVING
41332  * - \ref SCIP_STAGE_SOLVED
41333  * - \ref SCIP_STAGE_EXITSOLVE
41334  * - \ref SCIP_STAGE_FREETRANS
41335  */
41337  SCIP* scip /**< SCIP data structure */
41338  )
41339 {
41340  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDelayedCutoffs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41341 
41342  return scip->stat->ndelayedcutoffs;
41343 }
41344 
41345 /** gets total number of LPs solved so far
41346  *
41347  * @return the total number of LPs solved so far
41348  *
41349  * @pre This method can be called if SCIP is in one of the following stages:
41350  * - \ref SCIP_STAGE_PROBLEM
41351  * - \ref SCIP_STAGE_TRANSFORMING
41352  * - \ref SCIP_STAGE_TRANSFORMED
41353  * - \ref SCIP_STAGE_INITPRESOLVE
41354  * - \ref SCIP_STAGE_PRESOLVING
41355  * - \ref SCIP_STAGE_EXITPRESOLVE
41356  * - \ref SCIP_STAGE_PRESOLVED
41357  * - \ref SCIP_STAGE_INITSOLVE
41358  * - \ref SCIP_STAGE_SOLVING
41359  * - \ref SCIP_STAGE_SOLVED
41360  * - \ref SCIP_STAGE_EXITSOLVE
41361  * - \ref SCIP_STAGE_FREETRANS
41362  */
41364  SCIP* scip /**< SCIP data structure */
41365  )
41366 {
41367  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
41368 
41369  return scip->stat->nlps;
41370 }
41371 
41372 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm
41373  *
41374  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm
41375  *
41376  * @pre This method can be called if SCIP is in one of the following stages:
41377  * - \ref SCIP_STAGE_PRESOLVING
41378  * - \ref SCIP_STAGE_PRESOLVED
41379  * - \ref SCIP_STAGE_SOLVING
41380  * - \ref SCIP_STAGE_SOLVED
41381  */
41383  SCIP* scip /**< SCIP data structure */
41384  )
41385 {
41386  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41387 
41388  return scip->stat->nlpiterations;
41389 }
41390 
41391 /** gets number of active non-zeros in the current transformed problem
41392  *
41393  * @return the number of active non-zeros in the current transformed problem
41394  *
41395  * @pre This method can be called if SCIP is in one of the following stages:
41396  * - \ref SCIP_STAGE_PROBLEM
41397  * - \ref SCIP_STAGE_TRANSFORMING
41398  * - \ref SCIP_STAGE_TRANSFORMED
41399  * - \ref SCIP_STAGE_INITPRESOLVE
41400  * - \ref SCIP_STAGE_PRESOLVING
41401  * - \ref SCIP_STAGE_EXITPRESOLVE
41402  * - \ref SCIP_STAGE_PRESOLVED
41403  * - \ref SCIP_STAGE_INITSOLVE
41404  * - \ref SCIP_STAGE_SOLVING
41405  * - \ref SCIP_STAGE_SOLVED
41406  * - \ref SCIP_STAGE_EXITSOLVE
41407  */
41409  SCIP* scip /**< SCIP data structure */
41410  )
41411 {
41412  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNZs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
41413 
41414  return scip->stat->nnz;
41415 }
41416 
41417 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
41418  *
41419  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
41420  *
41421  * @pre This method can be called if SCIP is in one of the following stages:
41422  * - \ref SCIP_STAGE_PRESOLVED
41423  * - \ref SCIP_STAGE_SOLVING
41424  * - \ref SCIP_STAGE_SOLVED
41425  */
41427  SCIP* scip /**< SCIP data structure */
41428  )
41429 {
41430  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41431 
41432  return scip->stat->nrootlpiterations;
41433 }
41434 
41435 /** gets total number of iterations used in primal and dual simplex and barrier algorithm for the first LP at the root
41436  * node
41437  *
41438  * @return the total number of iterations used in primal and dual simplex and barrier algorithm for the first root LP
41439  *
41440  * @pre This method can be called if SCIP is in one of the following stages:
41441  * - \ref SCIP_STAGE_PRESOLVED
41442  * - \ref SCIP_STAGE_SOLVING
41443  * - \ref SCIP_STAGE_SOLVED
41444  */
41446  SCIP* scip /**< SCIP data structure */
41447  )
41448 {
41449  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootFirstLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41450 
41451  return scip->stat->nrootfirstlpiterations;
41452 }
41453 
41454 /** gets total number of primal LPs solved so far
41455  *
41456  * @return the total number of primal LPs solved so far
41457  *
41458  * @pre This method can be called if SCIP is in one of the following stages:
41459  * - \ref SCIP_STAGE_PRESOLVED
41460  * - \ref SCIP_STAGE_SOLVING
41461  * - \ref SCIP_STAGE_SOLVED
41462  */
41464  SCIP* scip /**< SCIP data structure */
41465  )
41466 {
41467  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41468 
41469  return scip->stat->nprimallps;
41470 }
41471 
41472 /** gets total number of iterations used so far in primal simplex
41473  *
41474  * @return total number of iterations used so far in primal simplex
41475  *
41476  * @pre This method can be called if SCIP is in one of the following stages:
41477  * - \ref SCIP_STAGE_PRESOLVED
41478  * - \ref SCIP_STAGE_SOLVING
41479  * - \ref SCIP_STAGE_SOLVED
41480  */
41482  SCIP* scip /**< SCIP data structure */
41483  )
41484 {
41485  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41486 
41487  return scip->stat->nprimallpiterations;
41488 }
41489 
41490 /** gets total number of dual LPs solved so far
41491  *
41492  * @return the total number of dual LPs solved so far
41493  *
41494  * @pre This method can be called if SCIP is in one of the following stages:
41495  * - \ref SCIP_STAGE_PRESOLVED
41496  * - \ref SCIP_STAGE_SOLVING
41497  * - \ref SCIP_STAGE_SOLVED
41498  */
41500  SCIP* scip /**< SCIP data structure */
41501  )
41502 {
41503  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41504 
41505  return scip->stat->nduallps;
41506 }
41507 
41508 /** gets total number of iterations used so far in dual simplex
41509  *
41510  * @return the total number of iterations used so far in dual simplex
41511  *
41512  * @pre This method can be called if SCIP is in one of the following stages:
41513  * - \ref SCIP_STAGE_PRESOLVED
41514  * - \ref SCIP_STAGE_SOLVING
41515  * - \ref SCIP_STAGE_SOLVED
41516  */
41518  SCIP* scip /**< SCIP data structure */
41519  )
41520 {
41521  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41522 
41523  return scip->stat->nduallpiterations;
41524 }
41525 
41526 /** gets total number of barrier LPs solved so far
41527  *
41528  * @return the total number of barrier LPs solved so far
41529  *
41530  * @pre This method can be called if SCIP is in one of the following stages:
41531  * - \ref SCIP_STAGE_PRESOLVED
41532  * - \ref SCIP_STAGE_SOLVING
41533  * - \ref SCIP_STAGE_SOLVED
41534  */
41536  SCIP* scip /**< SCIP data structure */
41537  )
41538 {
41539  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41540 
41541  return scip->stat->nbarrierlps;
41542 }
41543 
41544 /** gets total number of iterations used so far in barrier algorithm
41545  *
41546  * @return the total number of iterations used so far in barrier algorithm
41547  *
41548  * @pre This method can be called if SCIP is in one of the following stages:
41549  * - \ref SCIP_STAGE_PRESOLVED
41550  * - \ref SCIP_STAGE_SOLVING
41551  * - \ref SCIP_STAGE_SOLVED
41552  */
41554  SCIP* scip /**< SCIP data structure */
41555  )
41556 {
41557  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBarrierLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41558 
41559  return scip->stat->nbarrierlpiterations;
41560 }
41561 
41562 /** gets total number of LPs solved so far that were resolved from an advanced start basis
41563  *
41564  * @return the total number of LPs solved so far that were resolved from an advanced start basis
41565  *
41566  * @pre This method can be called if SCIP is in one of the following stages:
41567  * - \ref SCIP_STAGE_PRESOLVED
41568  * - \ref SCIP_STAGE_SOLVING
41569  * - \ref SCIP_STAGE_SOLVED
41570  */
41572  SCIP* scip /**< SCIP data structure */
41573  )
41574 {
41575  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41576 
41577  return scip->stat->nprimalresolvelps + scip->stat->ndualresolvelps;
41578 }
41579 
41580 /** gets total number of simplex iterations used so far in primal and dual simplex calls where an advanced start basis
41581  * was available
41582  *
41583  * @return the total number of simplex iterations used so far in primal and dual simplex calls where an advanced start
41584  * basis was available
41585  *
41586  * @pre This method can be called if SCIP is in one of the following stages:
41587  * - \ref SCIP_STAGE_PRESOLVED
41588  * - \ref SCIP_STAGE_SOLVING
41589  * - \ref SCIP_STAGE_SOLVED
41590  */
41592  SCIP* scip /**< SCIP data structure */
41593  )
41594 {
41595  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41596 
41598 }
41599 
41600 /** gets total number of primal LPs solved so far that were resolved from an advanced start basis
41601  *
41602  * @return the total number of primal LPs solved so far that were resolved from an advanced start basis
41603  *
41604  * @pre This method can be called if SCIP is in one of the following stages:
41605  * - \ref SCIP_STAGE_PRESOLVED
41606  * - \ref SCIP_STAGE_SOLVING
41607  * - \ref SCIP_STAGE_SOLVED
41608  */
41610  SCIP* scip /**< SCIP data structure */
41611  )
41612 {
41613  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41614 
41615  return scip->stat->nprimalresolvelps;
41616 }
41617 
41618 /** gets total number of simplex iterations used so far in primal simplex calls where an advanced start basis
41619  * was available
41620  *
41621  * @return the total number of simplex iterations used so far in primal simplex calls where an advanced start
41622  * basis was available
41623  *
41624  * @pre This method can be called if SCIP is in one of the following stages:
41625  * - \ref SCIP_STAGE_PRESOLVED
41626  * - \ref SCIP_STAGE_SOLVING
41627  * - \ref SCIP_STAGE_SOLVED
41628  */
41630  SCIP* scip /**< SCIP data structure */
41631  )
41632 {
41633  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPrimalResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41634 
41635  return scip->stat->nprimalresolvelpiterations;
41636 }
41637 
41638 /** gets total number of dual LPs solved so far that were resolved from an advanced start basis
41639  *
41640  * @return the total number of dual LPs solved so far that were resolved from an advanced start basis
41641  *
41642  * @pre This method can be called if SCIP is in one of the following stages:
41643  * - \ref SCIP_STAGE_PRESOLVED
41644  * - \ref SCIP_STAGE_SOLVING
41645  * - \ref SCIP_STAGE_SOLVED
41646  */
41648  SCIP* scip /**< SCIP data structure */
41649  )
41650 {
41651  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41652 
41653  return scip->stat->ndualresolvelps;
41654 }
41655 
41656 /** gets total number of simplex iterations used so far in dual simplex calls where an advanced start basis
41657  * was available
41658  *
41659  * @return the total number of simplex iterations used so far in dual simplex calls where an advanced start
41660  * basis was available
41661  *
41662  * @pre This method can be called if SCIP is in one of the following stages:
41663  * - \ref SCIP_STAGE_PRESOLVED
41664  * - \ref SCIP_STAGE_SOLVING
41665  * - \ref SCIP_STAGE_SOLVED
41666  */
41668  SCIP* scip /**< SCIP data structure */
41669  )
41670 {
41671  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDualResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41672 
41673  return scip->stat->ndualresolvelpiterations;
41674 }
41675 
41676 /** gets total number of LPs solved so far for node relaxations
41677  *
41678  * @return the total number of LPs solved so far for node relaxations
41679  *
41680  * @pre This method can be called if SCIP is in one of the following stages:
41681  * - \ref SCIP_STAGE_PRESOLVED
41682  * - \ref SCIP_STAGE_SOLVING
41683  * - \ref SCIP_STAGE_SOLVED
41684  */
41686  SCIP* scip /**< SCIP data structure */
41687  )
41688 {
41689  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41690 
41691  return scip->stat->nnodelps;
41692 }
41693 
41694 /** gets total number of simplex iterations used so far for node relaxations
41695  *
41696  * @return the total number of simplex iterations used so far for node relaxations
41697  *
41698  * @pre This method can be called if SCIP is in one of the following stages:
41699  * - \ref SCIP_STAGE_PRESOLVED
41700  * - \ref SCIP_STAGE_SOLVING
41701  * - \ref SCIP_STAGE_SOLVED
41702  */
41704  SCIP* scip /**< SCIP data structure */
41705  )
41706 {
41707  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41708 
41709  return scip->stat->nnodelpiterations;
41710 }
41711 
41712 /** gets total number of LPs solved so far for initial LP in node relaxations
41713  *
41714  * @return the total number of LPs solved so far for initial LP in node relaxations
41715  *
41716  * @pre This method can be called if SCIP is in one of the following stages:
41717  * - \ref SCIP_STAGE_PRESOLVED
41718  * - \ref SCIP_STAGE_SOLVING
41719  * - \ref SCIP_STAGE_SOLVED
41720  */
41722  SCIP* scip /**< SCIP data structure */
41723  )
41724 {
41725  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41726 
41727  return scip->stat->ninitlps;
41728 }
41729 
41730 /** gets total number of simplex iterations used so far for initial LP in node relaxations
41731  *
41732  * @return the total number of simplex iterations used so far for initial LP in node relaxations
41733  *
41734  * @pre This method can be called if SCIP is in one of the following stages:
41735  * - \ref SCIP_STAGE_PRESOLVED
41736  * - \ref SCIP_STAGE_SOLVING
41737  * - \ref SCIP_STAGE_SOLVED
41738  */
41740  SCIP* scip /**< SCIP data structure */
41741  )
41742 {
41743  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNNodeInitLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41744 
41745  return scip->stat->ninitlpiterations;
41746 }
41747 
41748 /** gets total number of LPs solved so far during diving and probing
41749  *
41750  * @return total number of LPs solved so far during diving and probing
41751  *
41752  * @pre This method can be called if SCIP is in one of the following stages:
41753  * - \ref SCIP_STAGE_PRESOLVED
41754  * - \ref SCIP_STAGE_SOLVING
41755  * - \ref SCIP_STAGE_SOLVED
41756  */
41758  SCIP* scip /**< SCIP data structure */
41759  )
41760 {
41761  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41762 
41763  return scip->stat->ndivinglps;
41764 }
41765 
41766 /** gets total number of simplex iterations used so far during diving and probing
41767  *
41768  * @return the total number of simplex iterations used so far during diving and probing
41769  *
41770  * @pre This method can be called if SCIP is in one of the following stages:
41771  * - \ref SCIP_STAGE_PRESOLVED
41772  * - \ref SCIP_STAGE_SOLVING
41773  * - \ref SCIP_STAGE_SOLVED
41774  */
41776  SCIP* scip /**< SCIP data structure */
41777  )
41778 {
41779  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNDivingLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41780 
41781  return scip->stat->ndivinglpiterations;
41782 }
41783 
41784 /** gets total number of times, strong branching was called (each call represents solving two LPs)
41785  *
41786  * @return the total number of times, strong branching was called (each call represents solving two LPs)
41787  *
41788  * @pre This method can be called if SCIP is in one of the following stages:
41789  * - \ref SCIP_STAGE_PRESOLVED
41790  * - \ref SCIP_STAGE_SOLVING
41791  * - \ref SCIP_STAGE_SOLVED
41792  */
41794  SCIP* scip /**< SCIP data structure */
41795  )
41796 {
41797  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41798 
41799  return scip->stat->nstrongbranchs;
41800 }
41801 
41802 /** gets total number of simplex iterations used so far in strong branching
41803  *
41804  * @return the total number of simplex iterations used so far in strong branching
41805  *
41806  * @pre This method can be called if SCIP is in one of the following stages:
41807  * - \ref SCIP_STAGE_PRESOLVED
41808  * - \ref SCIP_STAGE_SOLVING
41809  * - \ref SCIP_STAGE_SOLVED
41810  */
41812  SCIP* scip /**< SCIP data structure */
41813  )
41814 {
41815  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41816 
41817  return scip->stat->nsblpiterations;
41818 }
41819 
41820 /** gets total number of times, strong branching was called at the root node (each call represents solving two LPs)
41821  *
41822  * @return the total number of times, strong branching was called at the root node (each call represents solving two LPs)
41823  *
41824  * @pre This method can be called if SCIP is in one of the following stages:
41825  * - \ref SCIP_STAGE_PRESOLVED
41826  * - \ref SCIP_STAGE_SOLVING
41827  * - \ref SCIP_STAGE_SOLVED
41828  */
41830  SCIP* scip /**< SCIP data structure */
41831  )
41832 {
41833  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41834 
41835  return scip->stat->nrootstrongbranchs;
41836 }
41837 
41838 /** gets total number of simplex iterations used so far in strong branching at the root node
41839  *
41840  * @return the total number of simplex iterations used so far in strong branching at the root node
41841  *
41842  * @pre This method can be called if SCIP is in one of the following stages:
41843  * - \ref SCIP_STAGE_PRESOLVED
41844  * - \ref SCIP_STAGE_SOLVING
41845  * - \ref SCIP_STAGE_SOLVED
41846  */
41848  SCIP* scip /**< SCIP data structure */
41849  )
41850 {
41851  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNRootStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41852 
41853  return scip->stat->nrootsblpiterations;
41854 }
41855 
41856 /** gets number of pricing rounds performed so far at the current node
41857  *
41858  * @return the number of pricing rounds performed so far at the current node
41859  *
41860  * @pre This method can be called if SCIP is in one of the following stages:
41861  * - \ref SCIP_STAGE_SOLVING
41862  */
41864  SCIP* scip /**< SCIP data structure */
41865  )
41866 {
41867  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPriceRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41868 
41869  return scip->stat->npricerounds;
41870 }
41871 
41872 /** get current number of variables in the pricing store
41873  *
41874  * @return the current number of variables in the pricing store
41875  *
41876  * @pre This method can be called if SCIP is in one of the following stages:
41877  * - \ref SCIP_STAGE_PRESOLVED
41878  * - \ref SCIP_STAGE_SOLVING
41879  * - \ref SCIP_STAGE_SOLVED
41880  */
41882  SCIP* scip /**< SCIP data structure */
41883  )
41884 {
41885  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41886 
41887  return SCIPpricestoreGetNVars(scip->pricestore);
41888 }
41889 
41890 /** get total number of pricing variables found so far
41891  *
41892  * @return the total number of pricing variables found so far
41893  *
41894  * @pre This method can be called if SCIP is in one of the following stages:
41895  * - \ref SCIP_STAGE_PRESOLVED
41896  * - \ref SCIP_STAGE_SOLVING
41897  * - \ref SCIP_STAGE_SOLVED
41898  */
41900  SCIP* scip /**< SCIP data structure */
41901  )
41902 {
41903  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41904 
41906 }
41907 
41908 /** get total number of pricing variables applied to the LPs
41909  *
41910  * @return the total number of pricing variables applied to the LPs
41911  *
41912  * @pre This method can be called if SCIP is in one of the following stages:
41913  * - \ref SCIP_STAGE_PRESOLVED
41914  * - \ref SCIP_STAGE_SOLVING
41915  * - \ref SCIP_STAGE_SOLVED
41916  */
41918  SCIP* scip /**< SCIP data structure */
41919  )
41920 {
41921  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNPricevarsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41922 
41924 }
41925 
41926 /** gets number of separation rounds performed so far at the current node
41927  *
41928  * @return the number of separation rounds performed so far at the current node
41929  *
41930  * @pre This method can be called if SCIP is in one of the following stages:
41931  * - \ref SCIP_STAGE_SOLVING
41932  */
41934  SCIP* scip /**< SCIP data structure */
41935  )
41936 {
41937  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSepaRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
41938 
41939  return scip->stat->nseparounds;
41940 }
41941 
41942 /** get total number of cuts found so far
41943  *
41944  * @return the total number of cuts found so far
41945  *
41946  * @pre This method can be called if SCIP is in one of the following stages:
41947  * - \ref SCIP_STAGE_PRESOLVED
41948  * - \ref SCIP_STAGE_SOLVING
41949  * - \ref SCIP_STAGE_SOLVED
41950  */
41952  SCIP* scip /**< SCIP data structure */
41953  )
41954 {
41955  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41956 
41957  return SCIPsepastoreGetNCutsFound(scip->sepastore);
41958 }
41959 
41960 /** get number of cuts found so far in current separation round
41961  *
41962  * @return the number of cuts found so far in current separation round
41963  *
41964  * @pre This method can be called if SCIP is in one of the following stages:
41965  * - \ref SCIP_STAGE_PRESOLVED
41966  * - \ref SCIP_STAGE_SOLVING
41967  * - \ref SCIP_STAGE_SOLVED
41968  */
41970  SCIP* scip /**< SCIP data structure */
41971  )
41972 {
41973  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsFoundRound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41974 
41976 }
41977 
41978 /** get total number of cuts applied to the LPs
41979  *
41980  * @return the total number of cuts applied to the LPs
41981  *
41982  * @pre This method can be called if SCIP is in one of the following stages:
41983  * - \ref SCIP_STAGE_PRESOLVED
41984  * - \ref SCIP_STAGE_SOLVING
41985  * - \ref SCIP_STAGE_SOLVED
41986  */
41988  SCIP* scip /**< SCIP data structure */
41989  )
41990 {
41991  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNCutsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
41992 
41994 }
41995 
41996 /** get total number of constraints found in conflict analysis (conflict and reconvergence constraints)
41997  *
41998  * @return the total number of constraints found in conflict analysis (conflict and reconvergence constraints)
41999  *
42000  * @pre This method can be called if SCIP is in one of the following stages:
42001  * - \ref SCIP_STAGE_TRANSFORMED
42002  * - \ref SCIP_STAGE_INITPRESOLVE
42003  * - \ref SCIP_STAGE_PRESOLVING
42004  * - \ref SCIP_STAGE_EXITPRESOLVE
42005  * - \ref SCIP_STAGE_PRESOLVED
42006  * - \ref SCIP_STAGE_INITSOLVE
42007  * - \ref SCIP_STAGE_SOLVING
42008  * - \ref SCIP_STAGE_SOLVED
42009  * - \ref SCIP_STAGE_EXITSOLVE
42010  */
42012  SCIP* scip /**< SCIP data structure */
42013  )
42014 {
42015  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42016 
42027 }
42028 
42029 /** get number of conflict constraints found so far at the current node
42030  *
42031  * @return the number of conflict constraints found so far at the current node
42032  *
42033  * @pre This method can be called if SCIP is in one of the following stages:
42034  * - \ref SCIP_STAGE_TRANSFORMED
42035  * - \ref SCIP_STAGE_INITPRESOLVE
42036  * - \ref SCIP_STAGE_PRESOLVING
42037  * - \ref SCIP_STAGE_EXITPRESOLVE
42038  * - \ref SCIP_STAGE_PRESOLVED
42039  * - \ref SCIP_STAGE_INITSOLVE
42040  * - \ref SCIP_STAGE_SOLVING
42041  * - \ref SCIP_STAGE_SOLVED
42042  * - \ref SCIP_STAGE_EXITSOLVE
42043  */
42045  SCIP* scip /**< SCIP data structure */
42046  )
42047 {
42048  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssFoundNode", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42049 
42050  return SCIPconflictGetNConflicts(scip->conflict);
42051 }
42052 
42053 /** get total number of conflict constraints added to the problem
42054  *
42055  * @return the total number of conflict constraints added to the problem
42056  *
42057  * @pre This method can be called if SCIP is in one of the following stages:
42058  * - \ref SCIP_STAGE_TRANSFORMED
42059  * - \ref SCIP_STAGE_INITPRESOLVE
42060  * - \ref SCIP_STAGE_PRESOLVING
42061  * - \ref SCIP_STAGE_EXITPRESOLVE
42062  * - \ref SCIP_STAGE_PRESOLVED
42063  * - \ref SCIP_STAGE_INITSOLVE
42064  * - \ref SCIP_STAGE_SOLVING
42065  * - \ref SCIP_STAGE_SOLVED
42066  * - \ref SCIP_STAGE_EXITSOLVE
42067  */
42069  SCIP* scip /**< SCIP data structure */
42070  )
42071 {
42072  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNConflictConssApplied", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42073 
42074  return SCIPconflictGetNAppliedConss(scip->conflict);
42075 }
42076 
42077 /** gets depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
42078  * such that the depth includes the probing path
42079  *
42080  * @return the depth of current node, or -1 if no current node exists; in probing, the current node is the last probing node,
42081  * such that the depth includes the probing path
42082  *
42083  * @pre This method can be called if SCIP is in one of the following stages:
42084  * - \ref SCIP_STAGE_TRANSFORMED
42085  * - \ref SCIP_STAGE_INITPRESOLVE
42086  * - \ref SCIP_STAGE_PRESOLVING
42087  * - \ref SCIP_STAGE_EXITPRESOLVE
42088  * - \ref SCIP_STAGE_PRESOLVED
42089  * - \ref SCIP_STAGE_INITSOLVE
42090  * - \ref SCIP_STAGE_SOLVING
42091  * - \ref SCIP_STAGE_SOLVED
42092  * - \ref SCIP_STAGE_EXITSOLVE
42093  */
42095  SCIP* scip /**< SCIP data structure */
42096  )
42097 {
42098  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42099 
42100  return SCIPtreeGetCurrentDepth(scip->tree);
42101 }
42102 
42103 /** gets depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
42104  * branching tree, excluding the nodes of the probing path
42105  *
42106  * @return the depth of the focus node, or -1 if no focus node exists; the focus node is the currently processed node in the
42107  * branching tree, excluding the nodes of the probing path
42108  *
42109  * @pre This method can be called if SCIP is in one of the following stages:
42110  * - \ref SCIP_STAGE_TRANSFORMED
42111  * - \ref SCIP_STAGE_INITPRESOLVE
42112  * - \ref SCIP_STAGE_PRESOLVING
42113  * - \ref SCIP_STAGE_EXITPRESOLVE
42114  * - \ref SCIP_STAGE_PRESOLVED
42115  * - \ref SCIP_STAGE_INITSOLVE
42116  * - \ref SCIP_STAGE_SOLVING
42117  * - \ref SCIP_STAGE_SOLVED
42118  * - \ref SCIP_STAGE_EXITSOLVE
42119  */
42121  SCIP* scip /**< SCIP data structure */
42122  )
42123 {
42124  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFocusDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42125 
42126  return SCIPtreeGetFocusDepth(scip->tree);
42127 }
42128 
42129 /** gets maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
42130  *
42131  * @return the maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
42132  *
42133  * @pre This method can be called if SCIP is in one of the following stages:
42134  * - \ref SCIP_STAGE_TRANSFORMED
42135  * - \ref SCIP_STAGE_INITPRESOLVE
42136  * - \ref SCIP_STAGE_PRESOLVING
42137  * - \ref SCIP_STAGE_EXITPRESOLVE
42138  * - \ref SCIP_STAGE_PRESOLVED
42139  * - \ref SCIP_STAGE_INITSOLVE
42140  * - \ref SCIP_STAGE_SOLVING
42141  * - \ref SCIP_STAGE_SOLVED
42142  * - \ref SCIP_STAGE_EXITSOLVE
42143  */
42145  SCIP* scip /**< SCIP data structure */
42146  )
42147 {
42148  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42149 
42150  return scip->stat->maxdepth;
42151 }
42152 
42153 /** gets maximal depth of all processed nodes over all branch and bound runs
42154  *
42155  * @return the maximal depth of all processed nodes over all branch and bound runs
42156  *
42157  * @pre This method can be called if SCIP is in one of the following stages:
42158  * - \ref SCIP_STAGE_TRANSFORMED
42159  * - \ref SCIP_STAGE_INITPRESOLVE
42160  * - \ref SCIP_STAGE_PRESOLVING
42161  * - \ref SCIP_STAGE_EXITPRESOLVE
42162  * - \ref SCIP_STAGE_PRESOLVED
42163  * - \ref SCIP_STAGE_INITSOLVE
42164  * - \ref SCIP_STAGE_SOLVING
42165  * - \ref SCIP_STAGE_SOLVED
42166  * - \ref SCIP_STAGE_EXITSOLVE
42167  */
42169  SCIP* scip /**< SCIP data structure */
42170  )
42171 {
42172  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetMaxTotalDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42173 
42174  return scip->stat->maxtotaldepth;
42175 }
42176 
42177 /** gets total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
42178  *
42179  * @return the total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
42180  *
42181  * @pre This method can be called if SCIP is in one of the following stages:
42182  * - \ref SCIP_STAGE_TRANSFORMED
42183  * - \ref SCIP_STAGE_INITPRESOLVE
42184  * - \ref SCIP_STAGE_PRESOLVING
42185  * - \ref SCIP_STAGE_EXITPRESOLVE
42186  * - \ref SCIP_STAGE_PRESOLVED
42187  * - \ref SCIP_STAGE_INITSOLVE
42188  * - \ref SCIP_STAGE_SOLVING
42189  * - \ref SCIP_STAGE_SOLVED
42190  * - \ref SCIP_STAGE_EXITSOLVE
42191  */
42193  SCIP* scip /**< SCIP data structure */
42194  )
42195 {
42196  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBacktracks", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42197 
42198  return scip->stat->nbacktracks;
42199 }
42200 
42201 /** gets current plunging depth (successive times, a child was selected as next node)
42202  *
42203  * @return the current plunging depth (successive times, a child was selected as next node)
42204  *
42205  * @pre This method can be called if SCIP is in one of the following stages:
42206  * - \ref SCIP_STAGE_PRESOLVED
42207  * - \ref SCIP_STAGE_SOLVING
42208  */
42210  SCIP* scip /**< SCIP data structure */
42211  )
42212 {
42213  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPlungeDepth", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42214 
42215  return scip->stat->plungedepth;
42216 }
42217 
42218 /** gets total number of active constraints at the current node
42219  *
42220  * @return the total number of active constraints at the current node
42221  *
42222  * @pre This method can be called if SCIP is in one of the following stages:
42223  * - \ref SCIP_STAGE_PRESOLVED
42224  * - \ref SCIP_STAGE_SOLVING
42225  */
42227  SCIP* scip /**< SCIP data structure */
42228  )
42229 {
42230  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNActiveConss", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42231 
42232  return scip->stat->nactiveconss;
42233 }
42234 
42235 /** gets total number of enabled constraints at the current node
42236  *
42237  * @return the total number of enabled constraints at the current node
42238  *
42239  * @pre This method can be called if SCIP is in one of the following stages:
42240  * - \ref SCIP_STAGE_PRESOLVED
42241  * - \ref SCIP_STAGE_SOLVING
42242  */
42244  SCIP* scip /**< SCIP data structure */
42245  )
42246 {
42247  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNEnabledConss", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42248 
42249  return scip->stat->nenabledconss;
42250 }
42251 
42252 /** gets average dual bound of all unprocessed nodes for original problem
42253  *
42254  * @return the average dual bound of all unprocessed nodes for original problem
42255  *
42256  * @pre This method can be called if SCIP is in one of the following stages:
42257  * - \ref SCIP_STAGE_PRESOLVED
42258  * - \ref SCIP_STAGE_SOLVING
42259  * - \ref SCIP_STAGE_SOLVED
42260  */
42262  SCIP* scip /**< SCIP data structure */
42263  )
42264 {
42265  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42266 
42267  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set,
42269 }
42270 
42271 /** gets average lower (dual) bound of all unprocessed nodes in transformed problem
42272  *
42273  * @return the average lower (dual) bound of all unprocessed nodes in transformed problem
42274  *
42275  * @pre This method can be called if SCIP is in one of the following stages:
42276  * - \ref SCIP_STAGE_PRESOLVED
42277  * - \ref SCIP_STAGE_SOLVING
42278  * - \ref SCIP_STAGE_SOLVED
42279  */
42281  SCIP* scip /**< SCIP data structure */
42282  )
42283 {
42284  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42285 
42286  return SCIPtreeGetAvgLowerbound(scip->tree, scip->primal->cutoffbound);
42287 }
42288 
42289 /** gets global dual bound
42290  *
42291  * @return the global dual bound
42292  *
42293  * @pre This method can be called if SCIP is in one of the following stages:
42294  * - \ref SCIP_STAGE_PRESOLVING
42295  * - \ref SCIP_STAGE_EXITPRESOLVE
42296  * - \ref SCIP_STAGE_PRESOLVED
42297  * - \ref SCIP_STAGE_INITSOLVE
42298  * - \ref SCIP_STAGE_SOLVING
42299  * - \ref SCIP_STAGE_SOLVED
42300  * - \ref SCIP_STAGE_EXITSOLVE
42301  */
42303  SCIP* scip /**< SCIP data structure */
42304  )
42305 {
42306  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42307 
42308  return getDualbound(scip);
42309 }
42310 
42311 /** gets global lower (dual) bound in transformed problem
42312  *
42313  * @return the global lower (dual) bound in transformed problem
42314  *
42315  * @pre This method can be called if SCIP is in one of the following stages:
42316  * - \ref SCIP_STAGE_PRESOLVING
42317  * - \ref SCIP_STAGE_EXITPRESOLVE
42318  * - \ref SCIP_STAGE_PRESOLVED
42319  * - \ref SCIP_STAGE_INITSOLVE
42320  * - \ref SCIP_STAGE_SOLVING
42321  * - \ref SCIP_STAGE_SOLVED
42322  */
42324  SCIP* scip /**< SCIP data structure */
42325  )
42326 {
42327  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42328 
42329  return getLowerbound(scip);
42330 }
42331 
42332 /** gets dual bound of the root node for the original problem
42333  *
42334  * @return the dual bound of the root node for the original problem
42335  *
42336  * @pre This method can be called if SCIP is in one of the following stages:
42337  * - \ref SCIP_STAGE_PRESOLVING
42338  * - \ref SCIP_STAGE_EXITPRESOLVE
42339  * - \ref SCIP_STAGE_PRESOLVED
42340  * - \ref SCIP_STAGE_INITSOLVE
42341  * - \ref SCIP_STAGE_SOLVING
42342  * - \ref SCIP_STAGE_SOLVED
42343  */
42345  SCIP* scip /**< SCIP data structure */
42346  )
42347 {
42348  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42349 
42350  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
42351  return getPrimalbound(scip);
42352  else
42353  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->rootlowerbound);
42354 }
42355 
42356 /** gets lower (dual) bound in transformed problem of the root node
42357  *
42358  * @return the lower (dual) bound in transformed problem of the root node
42359  *
42360  * @pre This method can be called if SCIP is in one of the following stages:
42361  * - \ref SCIP_STAGE_PRESOLVING
42362  * - \ref SCIP_STAGE_EXITPRESOLVE
42363  * - \ref SCIP_STAGE_PRESOLVED
42364  * - \ref SCIP_STAGE_INITSOLVE
42365  * - \ref SCIP_STAGE_SOLVING
42366  * - \ref SCIP_STAGE_SOLVED
42367  */
42369  SCIP* scip /**< SCIP data structure */
42370  )
42371 {
42372  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42373 
42374  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
42375  return getUpperbound(scip);
42376  else
42377  return scip->stat->rootlowerbound;
42378 }
42379 
42380 /** gets dual bound for the original problem obtained by the first LP solve at the root node
42381  *
42382  * @return the dual bound for the original problem of the first LP solve at the root node
42383  *
42384  * @pre This method can be called if SCIP is in one of the following stages:
42385  * - \ref SCIP_STAGE_PRESOLVING
42386  * - \ref SCIP_STAGE_EXITPRESOLVE
42387  * - \ref SCIP_STAGE_PRESOLVED
42388  * - \ref SCIP_STAGE_INITSOLVE
42389  * - \ref SCIP_STAGE_SOLVING
42390  * - \ref SCIP_STAGE_SOLVED
42391  */
42393  SCIP* scip /**< SCIP data structure */
42394  )
42395 {
42396  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42397 
42398  return scip->stat->firstlpdualbound;
42399 }
42400 
42401 /** gets lower (dual) bound in transformed problem obtained by the first LP solve at the root node
42402  *
42403  * @return the lower (dual) bound in transformed problem obtained by first LP solve at the root node
42404  *
42405  * @pre This method can be called if SCIP is in one of the following stages:
42406  * - \ref SCIP_STAGE_PRESOLVING
42407  * - \ref SCIP_STAGE_EXITPRESOLVE
42408  * - \ref SCIP_STAGE_PRESOLVED
42409  * - \ref SCIP_STAGE_INITSOLVE
42410  * - \ref SCIP_STAGE_SOLVING
42411  * - \ref SCIP_STAGE_SOLVED
42412  */
42414  SCIP* scip /**< SCIP data structure */
42415  )
42416 {
42417  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42418 
42419  if( scip->stat->firstlpdualbound == SCIP_INVALID ) /*lint !e777*/
42420  return -SCIPinfinity(scip);
42421  else
42422  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->firstlpdualbound);
42423 }
42424 
42425 /** the primal bound of the very first solution */
42427  SCIP* scip /**< SCIP data structure */
42428  )
42429 {
42430  return scip->stat->firstprimalbound;
42431 }
42432 
42433 /** gets global primal bound (objective value of best solution or user objective limit) for the original problem
42434  *
42435  * @return the global primal bound (objective value of best solution or user objective limit) for the original problem
42436  *
42437  * @pre This method can be called if SCIP is in one of the following stages:
42438  * - \ref SCIP_STAGE_TRANSFORMED
42439  * - \ref SCIP_STAGE_INITPRESOLVE
42440  * - \ref SCIP_STAGE_PRESOLVING
42441  * - \ref SCIP_STAGE_EXITPRESOLVE
42442  * - \ref SCIP_STAGE_PRESOLVED
42443  * - \ref SCIP_STAGE_INITSOLVE
42444  * - \ref SCIP_STAGE_SOLVING
42445  * - \ref SCIP_STAGE_SOLVED
42446  * - \ref SCIP_STAGE_EXITSOLVE
42447  */
42449  SCIP* scip /**< SCIP data structure */
42450  )
42451 {
42452  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPrimalbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42453 
42454  return getPrimalbound(scip);
42455 }
42456 
42457 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
42458  *
42459  * @return the global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
42460  *
42461  * @pre This method can be called if SCIP is in one of the following stages:
42462  * - \ref SCIP_STAGE_TRANSFORMED
42463  * - \ref SCIP_STAGE_INITPRESOLVE
42464  * - \ref SCIP_STAGE_PRESOLVING
42465  * - \ref SCIP_STAGE_EXITPRESOLVE
42466  * - \ref SCIP_STAGE_PRESOLVED
42467  * - \ref SCIP_STAGE_INITSOLVE
42468  * - \ref SCIP_STAGE_SOLVING
42469  * - \ref SCIP_STAGE_SOLVED
42470  * - \ref SCIP_STAGE_EXITSOLVE
42471  */
42473  SCIP* scip /**< SCIP data structure */
42474  )
42475 {
42476  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetUpperbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42477 
42478  return getUpperbound(scip);
42479 }
42480 
42481 /** gets global cutoff bound in transformed problem: a sub problem with lower bound larger than the cutoff
42482  * cannot contain a better feasible solution; usually, this bound is equal to the upper bound, but if the
42483  * objective value is always integral, the cutoff bound is (nearly) one less than the upper bound;
42484  * additionally, due to objective function domain propagation, the cutoff bound can be further reduced
42485  *
42486  * @return global cutoff bound in transformed problem
42487  *
42488  * @pre This method can be called if SCIP is in one of the following stages:
42489  * - \ref SCIP_STAGE_TRANSFORMED
42490  * - \ref SCIP_STAGE_INITPRESOLVE
42491  * - \ref SCIP_STAGE_PRESOLVING
42492  * - \ref SCIP_STAGE_EXITPRESOLVE
42493  * - \ref SCIP_STAGE_PRESOLVED
42494  * - \ref SCIP_STAGE_INITSOLVE
42495  * - \ref SCIP_STAGE_SOLVING
42496  * - \ref SCIP_STAGE_SOLVED
42497  * - \ref SCIP_STAGE_EXITSOLVE
42498  */
42500  SCIP* scip /**< SCIP data structure */
42501  )
42502 {
42503  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetCutoffbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42504 
42505  return scip->primal->cutoffbound;
42506 }
42507 
42508 /** updates the cutoff bound
42509  *
42510  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
42511  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
42512  *
42513  * @note using this method in the solving stage can lead to an erroneous SCIP solving status; in particular,
42514  * if a solution not respecting the cutoff bound was found before installing a cutoff bound which
42515  * renders the remaining problem infeasible, this solution may be reported as optimal
42516  *
42517  * @pre This method can be called if SCIP is in one of the following stages:
42518  * - \ref SCIP_STAGE_TRANSFORMED
42519  * - \ref SCIP_STAGE_PRESOLVING
42520  * - \ref SCIP_STAGE_PRESOLVED
42521  * - \ref SCIP_STAGE_INITSOLVE
42522  * - \ref SCIP_STAGE_SOLVING
42523  *
42524  * @note the given cutoff bound has to better or equal to known one (SCIPgetCutoffbound())
42525  * @note a given cutoff bound is also used for updating the objective limit, if possible
42526  */
42528  SCIP* scip, /**< SCIP data structure */
42529  SCIP_Real cutoffbound /**< new cutoff bound */
42530  )
42531 {
42532  SCIP_CALL( checkStage(scip, "SCIPupdateCutoffbound", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
42533 
42534  assert(cutoffbound <= SCIPgetCutoffbound(scip));
42535 
42536  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
42537  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, cutoffbound, FALSE) );
42538 
42539  return SCIP_OKAY;
42540 }
42541 
42542 
42543 /** returns whether the current primal bound is justified with a feasible primal solution; if not, the primal bound
42544  * was set from the user as objective limit
42545  *
42546  * @return TRUE if the current primal bound is justified with a feasible primal solution, otherwise FALSE
42547  *
42548  * @pre This method can be called if SCIP is in one of the following stages:
42549  * - \ref SCIP_STAGE_TRANSFORMED
42550  * - \ref SCIP_STAGE_INITPRESOLVE
42551  * - \ref SCIP_STAGE_PRESOLVING
42552  * - \ref SCIP_STAGE_EXITPRESOLVE
42553  * - \ref SCIP_STAGE_PRESOLVED
42554  * - \ref SCIP_STAGE_INITSOLVE
42555  * - \ref SCIP_STAGE_SOLVING
42556  * - \ref SCIP_STAGE_SOLVED
42557  * - \ref SCIP_STAGE_EXITSOLVE
42558  */
42560  SCIP* scip /**< SCIP data structure */
42561  )
42562 {
42563  SCIP_CALL_ABORT( checkStage(scip, "SCIPisPrimalboundSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42564 
42565  return SCIPprimalUpperboundIsSol(scip->primal, scip->set, scip->transprob, scip->origprob);
42566 }
42567 
42568 /** gets current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
42569  * or infinity, if they have opposite sign
42570  *
42571  * @return the current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
42572  * or infinity, if they have opposite sign
42573  *
42574  * @pre This method can be called if SCIP is in one of the following stages:
42575  * - \ref SCIP_STAGE_PRESOLVING
42576  * - \ref SCIP_STAGE_EXITPRESOLVE
42577  * - \ref SCIP_STAGE_PRESOLVED
42578  * - \ref SCIP_STAGE_SOLVING
42579  * - \ref SCIP_STAGE_SOLVED
42580  */
42582  SCIP* scip /**< SCIP data structure */
42583  )
42584 {
42585  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetGap", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42586 
42587  if( SCIPsetIsInfinity(scip->set, getLowerbound(scip)) )
42588  {
42589  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
42590  * gap = +inf instead of gap = 0
42591  */
42592  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
42593  return SCIPsetInfinity(scip->set);
42594  else
42595  return 0.0;
42596  }
42597 
42598  return SCIPcomputeGap(SCIPsetEpsilon(scip->set), SCIPsetInfinity(scip->set), getPrimalbound(scip), getDualbound(scip));
42599 }
42600 
42601 /** gets current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
42602  * have same sign, or infinity, if they have opposite sign
42603  *
42604  * @return current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
42605  * have same sign, or infinity, if they have opposite sign
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_Real upperbound;
42617  SCIP_Real lowerbound;
42618 
42619  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetTransGap", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42620 
42621  upperbound = getUpperbound(scip);
42622  lowerbound = getLowerbound(scip);
42623 
42624  if( SCIPsetIsInfinity(scip->set, lowerbound) )
42625  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with
42626  * gap = +inf instead of gap = 0
42627  */
42628  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
42629  return SCIPsetInfinity(scip->set);
42630  else
42631  return 0.0;
42632  else if( SCIPsetIsEQ(scip->set, upperbound, lowerbound) )
42633  return 0.0;
42634  else if( SCIPsetIsZero(scip->set, lowerbound)
42635  || SCIPsetIsZero(scip->set, upperbound)
42636  || SCIPsetIsInfinity(scip->set, upperbound)
42637  || SCIPsetIsInfinity(scip->set, -lowerbound)
42638  || lowerbound * upperbound < 0.0 )
42639  return SCIPsetInfinity(scip->set);
42640  else
42641  {
42642  SCIP_Real abslower = REALABS(lowerbound);
42643  SCIP_Real absupper = REALABS(upperbound);
42644 
42645  return REALABS((upperbound - lowerbound)/MIN(abslower, absupper));
42646  }
42647 }
42648 
42649 /** gets number of feasible primal solutions found so far
42650  *
42651  * @return the number of feasible primal solutions found so far
42652  *
42653  * @pre This method can be called if SCIP is in one of the following stages:
42654  * - \ref SCIP_STAGE_TRANSFORMED
42655  * - \ref SCIP_STAGE_INITPRESOLVE
42656  * - \ref SCIP_STAGE_PRESOLVING
42657  * - \ref SCIP_STAGE_EXITPRESOLVE
42658  * - \ref SCIP_STAGE_PRESOLVED
42659  * - \ref SCIP_STAGE_INITSOLVE
42660  * - \ref SCIP_STAGE_SOLVING
42661  * - \ref SCIP_STAGE_SOLVED
42662  * - \ref SCIP_STAGE_EXITSOLVE
42663  */
42665  SCIP* scip /**< SCIP data structure */
42666  )
42667 {
42668  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42669 
42670  return scip->primal->nsolsfound;
42671 }
42672 
42673 /** gets number of feasible primal solutions respecting the objective limit found so far
42674  *
42675  * @return the number of feasible primal solutions respecting the objective limit found so far
42676  *
42677  * @pre This method can be called if SCIP is in one of the following stages:
42678  * - \ref SCIP_STAGE_INIT
42679  * - \ref SCIP_STAGE_PROBLEM
42680  * - \ref SCIP_STAGE_TRANSFORMING
42681  * - \ref SCIP_STAGE_TRANSFORMED
42682  * - \ref SCIP_STAGE_INITPRESOLVE
42683  * - \ref SCIP_STAGE_PRESOLVING
42684  * - \ref SCIP_STAGE_EXITPRESOLVE
42685  * - \ref SCIP_STAGE_PRESOLVED
42686  * - \ref SCIP_STAGE_INITSOLVE
42687  * - \ref SCIP_STAGE_SOLVING
42688  * - \ref SCIP_STAGE_SOLVED
42689  * - \ref SCIP_STAGE_EXITSOLVE
42690  */
42692  SCIP* scip /**< SCIP data structure */
42693  )
42694 {
42696  return 0;
42697 
42698  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNLimSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42699 
42700  return scip->primal->nlimsolsfound;
42701 }
42702 
42703 /** gets number of feasible primal solutions found so far, that improved the primal bound at the time they were found
42704  *
42705  * @return the number of feasible primal solutions found so far, that improved the primal bound at the time they were found
42706  *
42707  * @pre This method can be called if SCIP is in one of the following stages:
42708  * - \ref SCIP_STAGE_TRANSFORMED
42709  * - \ref SCIP_STAGE_INITPRESOLVE
42710  * - \ref SCIP_STAGE_PRESOLVING
42711  * - \ref SCIP_STAGE_EXITPRESOLVE
42712  * - \ref SCIP_STAGE_PRESOLVED
42713  * - \ref SCIP_STAGE_INITSOLVE
42714  * - \ref SCIP_STAGE_SOLVING
42715  * - \ref SCIP_STAGE_SOLVED
42716  * - \ref SCIP_STAGE_EXITSOLVE
42717  */
42719  SCIP* scip /**< SCIP data structure */
42720  )
42721 {
42722  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNBestSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
42723 
42724  return scip->primal->nbestsolsfound;
42725 }
42726 
42727 /** gets the average pseudo cost value for the given direction over all variables
42728  *
42729  * @return the average pseudo cost value for the given direction over all variables
42730  *
42731  * @pre This method can be called if SCIP is in one of the following stages:
42732  * - \ref SCIP_STAGE_SOLVING
42733  * - \ref SCIP_STAGE_SOLVED
42734  */
42736  SCIP* scip, /**< SCIP data structure */
42737  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
42738  )
42739 {
42740  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42741 
42742  return SCIPhistoryGetPseudocost(scip->stat->glbhistory, solvaldelta);
42743 }
42744 
42745 /** gets the average pseudo cost value for the given direction over all variables,
42746  * only using the pseudo cost information of the current run
42747  *
42748  * @return the average pseudo cost value for the given direction over all variables,
42749  * only using the pseudo cost information of the current run
42750  *
42751  * @pre This method can be called if SCIP is in one of the following stages:
42752  * - \ref SCIP_STAGE_SOLVING
42753  * - \ref SCIP_STAGE_SOLVED
42754  */
42756  SCIP* scip, /**< SCIP data structure */
42757  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
42758  )
42759 {
42760  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42761 
42762  return SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, solvaldelta);
42763 }
42764 
42765 
42766 
42767 /** gets the average number of pseudo cost updates for the given direction over all variables
42768  *
42769  * @return the average number of pseudo cost updates for the given direction over all variables
42770  *
42771  * @pre This method can be called if SCIP is in one of the following stages:
42772  * - \ref SCIP_STAGE_SOLVING
42773  * - \ref SCIP_STAGE_SOLVED
42774  */
42776  SCIP* scip, /**< SCIP data structure */
42777  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
42778  )
42779 {
42780  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42781 
42782  return SCIPhistoryGetPseudocostCount(scip->stat->glbhistory, dir)
42783  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
42784 }
42785 
42786 /** gets the average number of pseudo cost updates for the given direction over all variables,
42787  * only using the pseudo cost information of the current run
42788  *
42789  * @return the average number of pseudo cost updates for the given direction over all variables,
42790  * only using the pseudo cost information of the current run
42791  *
42792  * @pre This method can be called if SCIP is in one of the following stages:
42793  * - \ref SCIP_STAGE_SOLVING
42794  * - \ref SCIP_STAGE_SOLVED
42795  */
42797  SCIP* scip, /**< SCIP data structure */
42798  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
42799  )
42800 {
42801  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42802 
42804  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
42805 }
42806 
42807 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5
42808  *
42809  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5
42810  *
42811  * @pre This method can be called if SCIP is in one of the following stages:
42812  * - \ref SCIP_STAGE_SOLVING
42813  * - \ref SCIP_STAGE_SOLVED
42814  */
42816  SCIP* scip /**< SCIP data structure */
42817  )
42818 {
42819  SCIP_Real pscostdown;
42820  SCIP_Real pscostup;
42821 
42822  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42823 
42824  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistory, -0.5);
42825  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistory, +0.5);
42826 
42827  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
42828 }
42829 
42830 /** returns the variance of pseudo costs for all variables in the requested direction
42831  *
42832  * @return the variance of pseudo costs for all variables in the requested direction
42833  *
42834  * @pre This method can be called if SCIP is in one of the following stages:
42835  * - \ref SCIP_STAGE_SOLVING
42836  * - \ref SCIP_STAGE_SOLVED
42837  */
42839  SCIP* scip, /**< SCIP data structure */
42840  SCIP_BRANCHDIR branchdir, /**< the branching direction, up or down */
42841  SCIP_Bool onlycurrentrun /**< use only history of current run? */
42842  )
42843 {
42844  SCIP_HISTORY* history;
42845 
42846  assert(scip != NULL);
42847  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudocostVariance", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42848 
42849  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
42850  assert(history != NULL);
42851 
42852  return SCIPhistoryGetPseudocostVariance(history, branchdir);
42853 }
42854 
42855 /** gets the number of pseudo cost updates for the given direction over all variables
42856  *
42857  * @return the number of pseudo cost updates for the given direction over all variables
42858  *
42859  * @pre This method can be called if SCIP is in one of the following stages:
42860  * - \ref SCIP_STAGE_SOLVING
42861  * - \ref SCIP_STAGE_SOLVED
42862  */
42864  SCIP* scip, /**< SCIP data structure */
42865  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
42866  SCIP_Bool onlycurrentrun /**< use only history of current run? */
42867  )
42868 {
42869  SCIP_HISTORY* history;
42870 
42871  assert(scip != NULL);
42872  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42873 
42874  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
42875 
42876  return SCIPhistoryGetPseudocostCount(history, dir);
42877 }
42878 
42879 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
42880  * only using the pseudo cost information of the current run
42881  *
42882  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
42883  * only using the pseudo cost information of the current run
42884  *
42885  * @pre This method can be called if SCIP is in one of the following stages:
42886  * - \ref SCIP_STAGE_SOLVING
42887  * - \ref SCIP_STAGE_SOLVED
42888  */
42890  SCIP* scip /**< SCIP data structure */
42891  )
42892 {
42893  SCIP_Real pscostdown;
42894  SCIP_Real pscostup;
42895 
42896  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42897 
42898  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, -0.5);
42899  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, +0.5);
42900 
42901  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
42902 }
42903 
42904 /** gets the average conflict score value over all variables
42905  *
42906  * @return the average conflict score value over all variables
42907  *
42908  * @pre This method can be called if SCIP is in one of the following stages:
42909  * - \ref SCIP_STAGE_SOLVING
42910  * - \ref SCIP_STAGE_SOLVED
42911  */
42913  SCIP* scip /**< SCIP data structure */
42914  )
42915 {
42916  SCIP_Real conflictscoredown;
42917  SCIP_Real conflictscoreup;
42918  SCIP_Real scale;
42919 
42920  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42921 
42922  scale = scip->transprob->nvars * scip->stat->vsidsweight;
42923  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_DOWNWARDS) / scale;
42924  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_UPWARDS) / scale;
42925 
42926  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
42927 }
42928 
42929 /** gets the average conflict score value over all variables, only using the pseudo cost information of the current run
42930  *
42931  * @return the average conflict score value over all variables, only using the pseudo cost information of the current run
42932  *
42933  * @pre This method can be called if SCIP is in one of the following stages:
42934  * - \ref SCIP_STAGE_SOLVING
42935  * - \ref SCIP_STAGE_SOLVED
42936  */
42938  SCIP* scip /**< SCIP data structure */
42939  )
42940 {
42941  SCIP_Real conflictscoredown;
42942  SCIP_Real conflictscoreup;
42943  SCIP_Real scale;
42944 
42945  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42946 
42947  scale = scip->transprob->nvars * scip->stat->vsidsweight;
42948  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_DOWNWARDS) / scale;
42949  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_UPWARDS) / scale;
42950 
42951  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
42952 }
42953 
42954 /** gets the average inference score value over all variables
42955  *
42956  * @return the average inference score value over all variables
42957  *
42958  * @pre This method can be called if SCIP is in one of the following stages:
42959  * - \ref SCIP_STAGE_SOLVING
42960  * - \ref SCIP_STAGE_SOLVED
42961  */
42963  SCIP* scip /**< SCIP data structure */
42964  )
42965 {
42966  SCIP_Real conflictlengthdown;
42967  SCIP_Real conflictlengthup;
42968 
42969  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42970 
42973 
42974  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
42975 }
42976 
42977 /** gets the average conflictlength score value over all variables, only using the pseudo cost information of the
42978  * current run
42979  *
42980  * @return the average conflictlength score value over all variables, only using the pseudo cost information of the
42981  * current run
42982  *
42983  * @pre This method can be called if SCIP is in one of the following stages:
42984  * - \ref SCIP_STAGE_SOLVING
42985  * - \ref SCIP_STAGE_SOLVED
42986  */
42988  SCIP* scip /**< SCIP data structure */
42989  )
42990 {
42991  SCIP_Real conflictlengthdown;
42992  SCIP_Real conflictlengthup;
42993 
42994  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
42995 
42998 
42999  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
43000 }
43001 
43002 /** returns the average number of inferences found after branching in given direction over all variables
43003  *
43004  * @return the average number of inferences found after branching in given direction over all variables
43005  *
43006  * @pre This method can be called if SCIP is in one of the following stages:
43007  * - \ref SCIP_STAGE_SOLVING
43008  * - \ref SCIP_STAGE_SOLVED
43009  */
43011  SCIP* scip, /**< SCIP data structure */
43012  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43013  )
43014 {
43015  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferences", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43016 
43017  return SCIPhistoryGetAvgInferences(scip->stat->glbhistory, dir);
43018 }
43019 
43020 /** returns the average number of inferences found after branching in given direction over all variables,
43021  * only using the pseudo cost information of the current run
43022  *
43023  * @return the average number of inferences found after branching in given direction over all variables,
43024  * only using the pseudo cost information of the current run
43025  *
43026  * @pre This method can be called if SCIP is in one of the following stages:
43027  * - \ref SCIP_STAGE_SOLVING
43028  * - \ref SCIP_STAGE_SOLVED
43029  */
43031  SCIP* scip, /**< SCIP data structure */
43032  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43033  )
43034 {
43035  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43036 
43037  return SCIPhistoryGetAvgInferences(scip->stat->glbhistorycrun, dir);
43038 }
43039 
43040 /** gets the average inference score value over all variables
43041  *
43042  * @return the average inference score value over all variables
43043  *
43044  * @pre This method can be called if SCIP is in one of the following stages:
43045  * - \ref SCIP_STAGE_SOLVING
43046  * - \ref SCIP_STAGE_SOLVED
43047  */
43049  SCIP* scip /**< SCIP data structure */
43050  )
43051 {
43052  SCIP_Real inferencesdown;
43053  SCIP_Real inferencesup;
43054 
43055  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43056 
43059 
43060  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
43061 }
43062 
43063 /** gets the average inference score value over all variables, only using the inference information information of the
43064  * current run
43065  *
43066  * @return the average inference score value over all variables, only using the inference information information of the
43067  * current run
43068  *
43069  * @pre This method can be called if SCIP is in one of the following stages:
43070  * - \ref SCIP_STAGE_SOLVING
43071  * - \ref SCIP_STAGE_SOLVED
43072  */
43074  SCIP* scip /**< SCIP data structure */
43075  )
43076 {
43077  SCIP_Real inferencesdown;
43078  SCIP_Real inferencesup;
43079 
43080  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43081 
43084 
43085  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
43086 }
43087 
43088 /** returns the average number of cutoffs found after branching in given direction over all variables
43089  *
43090  * @return the average number of cutoffs found after branching in given direction over all variables
43091  *
43092  * @pre This method can be called if SCIP is in one of the following stages:
43093  * - \ref SCIP_STAGE_SOLVING
43094  * - \ref SCIP_STAGE_SOLVED
43095  */
43097  SCIP* scip, /**< SCIP data structure */
43098  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43099  )
43100 {
43101  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43102 
43103  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistory, dir);
43104 }
43105 
43106 /** returns the average number of cutoffs found after branching in given direction over all variables,
43107  * only using the pseudo cost information of the current run
43108  *
43109  * @return the average number of cutoffs found after branching in given direction over all variables,
43110  * only using the pseudo cost information of the current run
43111  *
43112  * @pre This method can be called if SCIP is in one of the following stages:
43113  * - \ref SCIP_STAGE_SOLVING
43114  * - \ref SCIP_STAGE_SOLVED
43115  */
43117  SCIP* scip, /**< SCIP data structure */
43118  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
43119  )
43120 {
43121  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43122 
43123  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistorycrun, dir);
43124 }
43125 
43126 /** gets the average cutoff score value over all variables
43127  *
43128  * @return the average cutoff score value over all variables
43129  *
43130  * @pre This method can be called if SCIP is in one of the following stages:
43131  * - \ref SCIP_STAGE_SOLVING
43132  * - \ref SCIP_STAGE_SOLVED
43133  */
43135  SCIP* scip /**< SCIP data structure */
43136  )
43137 {
43138  SCIP_Real cutoffsdown;
43139  SCIP_Real cutoffsup;
43140 
43141  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43142 
43145 
43146  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
43147 }
43148 
43149 /** gets the average cutoff score value over all variables, only using the pseudo cost information of the current run
43150  *
43151  * @return the average cutoff score value over all variables, only using the pseudo cost information of the current run
43152  *
43153  * @pre This method can be called if SCIP is in one of the following stages:
43154  * - \ref SCIP_STAGE_SOLVING
43155  * - \ref SCIP_STAGE_SOLVED
43156  */
43158  SCIP* scip /**< SCIP data structure */
43159  )
43160 {
43161  SCIP_Real cutoffsdown;
43162  SCIP_Real cutoffsup;
43163 
43164  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
43165 
43168 
43169  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
43170 }
43171 
43172 /** computes a deterministic measure of time from statistics
43173  *
43174  * @return the deterministic time
43175  *
43176  * @pre This method can be called if SCIP is in one of the following stages:
43177  * - \ref SCIP_STAGE_PRESOLVING
43178  * - \ref SCIP_STAGE_PRESOLVED
43179  * - \ref SCIP_STAGE_SOLVING
43180  * - \ref SCIP_STAGE_SOLVED
43181  */
43183  SCIP* scip /**< SCIP data structure */
43184  )
43185 {
43186 /* TODO: SCIP_CALL_ABORT( checkStage(scip, "SCIPgetDeterministicTime", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) ); */
43187  if(scip->stat == NULL)
43188  return 0.0;
43189 
43190  return 1e-6 * scip->stat->nnz * (
43191  0.00328285264101 * scip->stat->nprimalresolvelpiterations +
43192  0.00531625104146 * scip->stat->ndualresolvelpiterations +
43193  0.000738719124051 * scip->stat->nprobboundchgs +
43194  0.0011123144764 * scip->stat->nisstoppedcalls );
43195 }
43196 
43197 /** outputs problem to file stream */
43198 static
43200  SCIP* scip, /**< SCIP data structure */
43201  SCIP_PROB* prob, /**< problem data */
43202  FILE* file, /**< output file (or NULL for standard output) */
43203  const char* extension, /**< file format (or NULL for default CIP format) */
43204  SCIP_Bool genericnames /**< using generic variable and constraint names? */
43205  )
43206 {
43207  SCIP_RESULT result;
43208  int i;
43209  assert(scip != NULL);
43210  assert(prob != NULL);
43211 
43212  /* try all readers until one could read the file */
43213  result = SCIP_DIDNOTRUN;
43214  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
43215  {
43216  SCIP_RETCODE retcode;
43217 
43218  if( extension != NULL )
43219  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, extension, genericnames, &result);
43220  else
43221  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, "cip", genericnames, &result);
43222 
43223  /* check for reader errors */
43224  if( retcode == SCIP_WRITEERROR )
43225  return retcode;
43226 
43227  SCIP_CALL( retcode );
43228  }
43229 
43230  switch( result )
43231  {
43232  case SCIP_DIDNOTRUN:
43233  return SCIP_PLUGINNOTFOUND;
43234 
43235  case SCIP_SUCCESS:
43236  return SCIP_OKAY;
43237 
43238  default:
43239  assert(i < scip->set->nreaders);
43240  SCIPerrorMessage("invalid result code <%d> from reader <%s> writing <%s> format\n",
43241  result, SCIPreaderGetName(scip->set->readers[i]), extension);
43242  return SCIP_READERROR;
43243  } /*lint !e788*/
43244 }
43245 
43246 /** outputs original problem to file stream
43247  *
43248  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
43249  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
43250  *
43251  * @pre This method can be called if SCIP is in one of the following stages:
43252  * - \ref SCIP_STAGE_PROBLEM
43253  * - \ref SCIP_STAGE_TRANSFORMING
43254  * - \ref SCIP_STAGE_TRANSFORMED
43255  * - \ref SCIP_STAGE_INITPRESOLVE
43256  * - \ref SCIP_STAGE_PRESOLVING
43257  * - \ref SCIP_STAGE_EXITPRESOLVE
43258  * - \ref SCIP_STAGE_PRESOLVED
43259  * - \ref SCIP_STAGE_INITSOLVE
43260  * - \ref SCIP_STAGE_SOLVING
43261  * - \ref SCIP_STAGE_SOLVED
43262  * - \ref SCIP_STAGE_EXITSOLVE
43263  * - \ref SCIP_STAGE_FREETRANS
43264  */
43266  SCIP* scip, /**< SCIP data structure */
43267  FILE* file, /**< output file (or NULL for standard output) */
43268  const char* extension, /**< file format (or NULL for default CIP format)*/
43269  SCIP_Bool genericnames /**< using generic variable and constraint names? */
43270  )
43271 {
43272  SCIP_RETCODE retcode;
43273 
43274  SCIP_CALL( checkStage(scip, "SCIPprintOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
43275 
43276  assert(scip != NULL);
43277  assert( scip->origprob != NULL );
43278 
43279  retcode = printProblem(scip, scip->origprob, file, extension, genericnames);
43280 
43281  /* check for write errors */
43282  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
43283  return retcode;
43284  else
43285  {
43286  SCIP_CALL( retcode );
43287  }
43288 
43289  return SCIP_OKAY;
43290 }
43291 
43292 /** outputs transformed problem of the current node to file stream
43293  *
43294  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
43295  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
43296  *
43297  * @pre This method can be called if SCIP is in one of the following stages:
43298  * - \ref SCIP_STAGE_TRANSFORMED
43299  * - \ref SCIP_STAGE_INITPRESOLVE
43300  * - \ref SCIP_STAGE_PRESOLVING
43301  * - \ref SCIP_STAGE_EXITPRESOLVE
43302  * - \ref SCIP_STAGE_PRESOLVED
43303  * - \ref SCIP_STAGE_INITSOLVE
43304  * - \ref SCIP_STAGE_SOLVING
43305  * - \ref SCIP_STAGE_SOLVED
43306  * - \ref SCIP_STAGE_EXITSOLVE
43307  * - \ref SCIP_STAGE_FREETRANS
43308  */
43310  SCIP* scip, /**< SCIP data structure */
43311  FILE* file, /**< output file (or NULL for standard output) */
43312  const char* extension, /**< file format (or NULL for default CIP format)*/
43313  SCIP_Bool genericnames /**< using generic variable and constraint names? */
43314  )
43315 {
43316  SCIP_RETCODE retcode;
43317 
43318  SCIP_CALL( checkStage(scip, "SCIPprintTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
43319 
43320  assert(scip != NULL);
43321  assert(scip->transprob != NULL );
43322 
43323  retcode = printProblem(scip, scip->transprob, file, extension, genericnames);
43324 
43325  /* check for write errors */
43326  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
43327  return retcode;
43328  else
43329  {
43330  SCIP_CALL( retcode );
43331  }
43332 
43333  return SCIP_OKAY;
43334 }
43335 
43336 static
43338  SCIP* scip, /**< SCIP data structure */
43339  FILE* file /**< output file */
43340  )
43341 {
43342  int i;
43343 
43344  assert(scip != NULL);
43345  assert(scip->set != NULL);
43346 
43347  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolvers : ExecTime SetupTime Calls FixedVars AggrVars ChgTypes ChgBounds AddHoles DelCons AddCons ChgSides ChgCoefs\n");
43348 
43349  /* sort presolvers w.r.t. their name */
43350  SCIPsetSortPresolsName(scip->set);
43351 
43352  /* presolver statistics */
43353  for( i = 0; i < scip->set->npresols; ++i )
43354  {
43355  SCIP_PRESOL* presol;
43356  presol = scip->set->presols[i];
43357  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpresolGetName(presol));
43358  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
43359  SCIPpresolGetTime(presol),
43360  SCIPpresolGetSetupTime(presol),
43361  SCIPpresolGetNCalls(presol),
43362  SCIPpresolGetNFixedVars(presol),
43363  SCIPpresolGetNAggrVars(presol),
43364  SCIPpresolGetNChgVarTypes(presol),
43365  SCIPpresolGetNChgBds(presol),
43366  SCIPpresolGetNAddHoles(presol),
43367  SCIPpresolGetNDelConss(presol),
43368  SCIPpresolGetNAddConss(presol),
43369  SCIPpresolGetNChgSides(presol),
43370  SCIPpresolGetNChgCoefs(presol));
43371  }
43372 
43373  /* sort propagators w.r.t. their name */
43374  SCIPsetSortPropsName(scip->set);
43375 
43376  for( i = 0; i < scip->set->nprops; ++i )
43377  {
43378  SCIP_PROP* prop;
43379  prop = scip->set->props[i];
43380  if( SCIPpropDoesPresolve(prop) )
43381  {
43382  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
43383  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
43384  SCIPpropGetPresolTime(prop),
43385  SCIPpropGetSetupTime(prop),
43387  SCIPpropGetNFixedVars(prop),
43388  SCIPpropGetNAggrVars(prop),
43390  SCIPpropGetNChgBds(prop),
43391  SCIPpropGetNAddHoles(prop),
43392  SCIPpropGetNDelConss(prop),
43393  SCIPpropGetNAddConss(prop),
43394  SCIPpropGetNChgSides(prop),
43395  SCIPpropGetNChgCoefs(prop));
43396  }
43397  }
43398 
43399  /* constraint handler presolving methods statistics */
43400  for( i = 0; i < scip->set->nconshdlrs; ++i )
43401  {
43402  SCIP_CONSHDLR* conshdlr;
43403  int maxnactiveconss;
43404 
43405  conshdlr = scip->set->conshdlrs[i];
43406  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
43407  if( SCIPconshdlrDoesPresolve(conshdlr)
43408  && (maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr)
43409  || SCIPconshdlrGetNFixedVars(conshdlr) > 0
43410  || SCIPconshdlrGetNAggrVars(conshdlr) > 0
43411  || SCIPconshdlrGetNChgVarTypes(conshdlr) > 0
43412  || SCIPconshdlrGetNChgBds(conshdlr) > 0
43413  || SCIPconshdlrGetNAddHoles(conshdlr) > 0
43414  || SCIPconshdlrGetNDelConss(conshdlr) > 0
43415  || SCIPconshdlrGetNAddConss(conshdlr) > 0
43416  || SCIPconshdlrGetNChgSides(conshdlr) > 0
43417  || SCIPconshdlrGetNChgCoefs(conshdlr) > 0
43418  || SCIPconshdlrGetNUpgdConss(conshdlr) > 0) )
43419  {
43420  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
43421  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
43422  SCIPconshdlrGetPresolTime(conshdlr),
43423  SCIPconshdlrGetSetupTime(conshdlr),
43424  SCIPconshdlrGetNPresolCalls(conshdlr),
43425  SCIPconshdlrGetNFixedVars(conshdlr),
43426  SCIPconshdlrGetNAggrVars(conshdlr),
43427  SCIPconshdlrGetNChgVarTypes(conshdlr),
43428  SCIPconshdlrGetNChgBds(conshdlr),
43429  SCIPconshdlrGetNAddHoles(conshdlr),
43430  SCIPconshdlrGetNDelConss(conshdlr),
43431  SCIPconshdlrGetNAddConss(conshdlr),
43432  SCIPconshdlrGetNChgSides(conshdlr),
43433  SCIPconshdlrGetNChgCoefs(conshdlr));
43434  }
43435  }
43436 
43437  /* root node bound changes */
43438  SCIPmessageFPrintInfo(scip->messagehdlr, file, " root node : - - - %10d - - %10d - - - - -\n",
43439  scip->stat->nrootintfixings, scip->stat->nrootboundchgs);
43440 }
43441 
43442 /** print constraint statistics to output file */
43443 static
43445  SCIP* scip, /**< SCIP data structure */
43446  FILE* file /**< output file */
43447  )
43448 {
43449  int i;
43450 
43451  assert(scip != NULL);
43452  assert(scip->set != NULL);
43453 
43454  /* Add maximal number of constraints of the same type? So far this information is not added because of lack of space. */
43455  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraints : Number MaxNumber #Separate #Propagate #EnfoLP #EnfoRelax #EnfoPS #Check #ResProp Cutoffs DomReds Cuts Applied Conss Children\n");
43456 
43457  for( i = 0; i < scip->set->nconshdlrs; ++i )
43458  {
43459  SCIP_CONSHDLR* conshdlr;
43460  int startnactiveconss;
43461  int maxnactiveconss;
43462 
43463  conshdlr = scip->set->conshdlrs[i];
43464  startnactiveconss = SCIPconshdlrGetStartNActiveConss(conshdlr);
43465  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
43466  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
43467  {
43468  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
43469  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",
43470  startnactiveconss,
43471  maxnactiveconss > startnactiveconss ? '+' : ' ',
43472  maxnactiveconss,
43473  SCIPconshdlrGetNSepaCalls(conshdlr),
43474  SCIPconshdlrGetNPropCalls(conshdlr),
43475  SCIPconshdlrGetNEnfoLPCalls(conshdlr),
43477  SCIPconshdlrGetNEnfoPSCalls(conshdlr),
43478  SCIPconshdlrGetNCheckCalls(conshdlr),
43479  SCIPconshdlrGetNRespropCalls(conshdlr),
43480  SCIPconshdlrGetNCutoffs(conshdlr),
43481  SCIPconshdlrGetNDomredsFound(conshdlr),
43482  SCIPconshdlrGetNCutsFound(conshdlr),
43483  SCIPconshdlrGetNCutsApplied(conshdlr),
43484  SCIPconshdlrGetNConssFound(conshdlr),
43485  SCIPconshdlrGetNChildren(conshdlr));
43486  }
43487  }
43488 }
43489 
43490 /** print constraint timing statistics to output file */
43491 static
43493  SCIP* scip, /**< SCIP data structure */
43494  FILE* file /**< output file */
43495  )
43496 {
43497  int i;
43498 
43499  assert(scip != NULL);
43500  assert(scip->set != NULL);
43501 
43502  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraint Timings : TotalTime SetupTime Separate Propagate EnfoLP EnfoPS EnfoRelax Check ResProp SB-Prop\n");
43503 
43504  for( i = 0; i < scip->set->nconshdlrs; ++i )
43505  {
43506  SCIP_CONSHDLR* conshdlr;
43507  int maxnactiveconss;
43508 
43509  conshdlr = scip->set->conshdlrs[i];
43510  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
43511  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
43512  {
43513  SCIP_Real totaltime;
43514 
43515  totaltime = SCIPconshdlrGetSepaTime(conshdlr) + SCIPconshdlrGetPropTime(conshdlr)
43517  + SCIPconshdlrGetEnfoLPTime(conshdlr)
43518  + SCIPconshdlrGetEnfoPSTime(conshdlr)
43519  + SCIPconshdlrGetEnfoRelaxTime(conshdlr)
43520  + SCIPconshdlrGetCheckTime(conshdlr)
43521  + SCIPconshdlrGetRespropTime(conshdlr)
43522  + SCIPconshdlrGetSetupTime(conshdlr);
43523 
43524  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
43525  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",
43526  totaltime,
43527  SCIPconshdlrGetSetupTime(conshdlr),
43528  SCIPconshdlrGetSepaTime(conshdlr),
43529  SCIPconshdlrGetPropTime(conshdlr),
43530  SCIPconshdlrGetEnfoLPTime(conshdlr),
43531  SCIPconshdlrGetEnfoPSTime(conshdlr),
43532  SCIPconshdlrGetEnfoRelaxTime(conshdlr),
43533  SCIPconshdlrGetCheckTime(conshdlr),
43534  SCIPconshdlrGetRespropTime(conshdlr),
43536  }
43537  }
43538 }
43539 
43540 /** print propagator statistics to output file */
43541 static
43543  SCIP* scip, /**< SCIP data structure */
43544  FILE* file /**< output file */
43545  )
43546 {
43547  int i;
43548 
43549  assert(scip != NULL);
43550  assert(scip->set != NULL);
43551 
43552  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagators : #Propagate #ResProp Cutoffs DomReds\n");
43553 
43554  /* sort propagaters w.r.t. their name */
43555  SCIPsetSortPropsName(scip->set);
43556 
43557  for( i = 0; i < scip->set->nprops; ++i )
43558  {
43559  SCIP_PROP* prop;
43560  prop = scip->set->props[i];
43561 
43562  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
43563  SCIPpropGetName(prop),
43564  SCIPpropGetNCalls(prop),
43566  SCIPpropGetNCutoffs(prop),
43567  SCIPpropGetNDomredsFound(prop));
43568  }
43569 
43570  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagator Timings : TotalTime SetupTime Presolve Propagate ResProp SB-Prop\n");
43571 
43572  for( i = 0; i < scip->set->nprops; ++i )
43573  {
43574  SCIP_PROP* prop;
43575  SCIP_Real totaltime;
43576 
43577  prop = scip->set->props[i];
43578  totaltime = SCIPpropGetPresolTime(prop) + SCIPpropGetTime(prop) + SCIPpropGetRespropTime(prop)
43580 
43581  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
43582  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
43583  totaltime,
43584  SCIPpropGetSetupTime(prop),
43585  SCIPpropGetPresolTime(prop),
43586  SCIPpropGetTime(prop),
43587  SCIPpropGetRespropTime(prop),
43589  }
43590 }
43591 
43592 /** print conflict statistic to given output stream */
43593 static
43595  SCIP* scip, /**< SCIP data structure */
43596  FILE* file /**< output file */
43597  )
43598 {
43599  char initstoresize[SCIP_MAXSTRLEN];
43600  char maxstoresize[SCIP_MAXSTRLEN];
43601 
43602  if( scip->set->conf_maxstoresize == 0 )
43603  {
43604  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "inf");
43605  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "inf");
43606  }
43607  else
43608  {
43609  int initsize = SCIPconflictstoreGetInitPoolSize(scip->conflictstore);
43610  int maxsize = SCIPconflictstoreGetMaxPoolSize(scip->conflictstore);
43611 
43612  if( maxsize == -1 )
43613  {
43614  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "--");
43615  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "--");
43616  }
43617  else
43618  {
43619  assert(initsize >= 0);
43620  assert(maxsize >= 0);
43621 
43622  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "%d", initsize);
43623  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "%d", maxsize);
43624  }
43625  }
43626  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);
43627  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",
43639  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",
43656  SCIPmessageFPrintInfo(scip->messagehdlr, file, " bound exceed. LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " - %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT "\n",
43669  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",
43682  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",
43694  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied globally : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
43702  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied locally : - - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
43709 }
43710 
43711 static
43713  SCIP* scip, /**< SCIP data structure */
43714  FILE* file /**< output file */
43715  )
43716 {
43717  int i;
43718 
43719  assert(scip != NULL);
43720  assert(scip->set != NULL);
43721 
43722  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Separators : ExecTime SetupTime Calls Cutoffs DomReds Cuts Applied Conss\n");
43723  SCIPmessageFPrintInfo(scip->messagehdlr, file, " cut pool : %10.2f %10" SCIP_LONGINT_FORMAT " - - %10" SCIP_LONGINT_FORMAT " - - (maximal pool size: %d)\n",
43724  SCIPcutpoolGetTime(scip->cutpool),
43728 
43729  /* sort separators w.r.t. their name */
43730  SCIPsetSortSepasName(scip->set);
43731 
43732  for( i = 0; i < scip->set->nsepas; ++i )
43733  {
43734  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",
43735  SCIPsepaGetName(scip->set->sepas[i]),
43736  SCIPsepaGetTime(scip->set->sepas[i]),
43737  SCIPsepaGetSetupTime(scip->set->sepas[i]),
43738  SCIPsepaGetNCalls(scip->set->sepas[i]),
43739  SCIPsepaGetNCutoffs(scip->set->sepas[i]),
43740  SCIPsepaGetNDomredsFound(scip->set->sepas[i]),
43741  SCIPsepaGetNCutsFound(scip->set->sepas[i]),
43742  SCIPsepaGetNCutsApplied(scip->set->sepas[i]),
43743  SCIPsepaGetNConssFound(scip->set->sepas[i]));
43744  }
43745 }
43746 
43747 static
43749  SCIP* scip, /**< SCIP data structure */
43750  FILE* file /**< output file */
43751  )
43752 {
43753  int i;
43754 
43755  assert(scip != NULL);
43756  assert(scip->set != NULL);
43757 
43758  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Pricers : ExecTime SetupTime Calls Vars\n");
43759  SCIPmessageFPrintInfo(scip->messagehdlr, file, " problem variables: %10.2f - %10d %10d\n",
43763 
43764  /* sort pricers w.r.t. their name */
43765  SCIPsetSortPricersName(scip->set);
43766 
43767  for( i = 0; i < scip->set->nactivepricers; ++i )
43768  {
43769  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10d %10d\n",
43770  SCIPpricerGetName(scip->set->pricers[i]),
43771  SCIPpricerGetTime(scip->set->pricers[i]),
43772  SCIPpricerGetSetupTime(scip->set->pricers[i]),
43773  SCIPpricerGetNCalls(scip->set->pricers[i]),
43774  SCIPpricerGetNVarsFound(scip->set->pricers[i]));
43775  }
43776 }
43777 
43778 static
43780  SCIP* scip, /**< SCIP data structure */
43781  FILE* file /**< output file */
43782  )
43783 {
43784  int i;
43785 
43786  assert(scip != NULL);
43787  assert(scip->set != NULL);
43788 
43789  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Branching Rules : ExecTime SetupTime BranchLP BranchExt BranchPS Cutoffs DomReds Cuts Conss Children\n");
43790 
43791  /* sort branching rules w.r.t. their name */
43793 
43794  for( i = 0; i < scip->set->nbranchrules; ++i )
43795  {
43796  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",
43808  }
43809 }
43810 
43811 static
43813  SCIP* scip, /**< SCIP data structure */
43814  FILE* file /**< output file */
43815  )
43816 {
43817  int ndivesets = 0;
43818  int i;
43819 
43820  assert(scip != NULL);
43821  assert(scip->set != NULL);
43822  assert(scip->tree != NULL);
43823 
43824  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Primal Heuristics : ExecTime SetupTime Calls Found Best\n");
43825  SCIPmessageFPrintInfo(scip->messagehdlr, file, " LP solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
43827  scip->stat->nlpsolsfound, scip->stat->nlpbestsolsfound);
43828  SCIPmessageFPrintInfo(scip->messagehdlr, file, " relax solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
43830  scip->stat->nrelaxsolsfound, scip->stat->nrelaxbestsolsfound);
43831  SCIPmessageFPrintInfo(scip->messagehdlr, file, " pseudo solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
43833  scip->stat->npssolsfound, scip->stat->npsbestsolsfound);
43834  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
43836  scip->stat->nsbsolsfound, scip->stat->nsbbestsolsfound);
43837 
43838  /* sort heuristics w.r.t. their names */
43839  SCIPsetSortHeursName(scip->set);
43840 
43841  for( i = 0; i < scip->set->nheurs; ++i )
43842  {
43843  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
43844  SCIPheurGetName(scip->set->heurs[i]),
43845  SCIPheurGetTime(scip->set->heurs[i]),
43846  SCIPheurGetSetupTime(scip->set->heurs[i]),
43847  SCIPheurGetNCalls(scip->set->heurs[i]),
43848  SCIPheurGetNSolsFound(scip->set->heurs[i]),
43849  SCIPheurGetNBestSolsFound(scip->set->heurs[i]));
43850 
43851  /* count heuristics that use diving; needed to determine output later */
43852  ndivesets += SCIPheurGetNDivesets(scip->set->heurs[i]);
43853  }
43854 
43855  SCIPmessageFPrintInfo(scip->messagehdlr, file, " other solutions : - - - %10" SCIP_LONGINT_FORMAT " -\n",
43856  scip->stat->nexternalsolsfound);
43857 
43858  if ( ndivesets > 0 )
43859  {
43860  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Diving Statistics : Calls Nodes LP Iters Backtracks MinDepth MaxDepth AvgDepth NLeafSols MinSolDpt MaxSolDpt AvgSolDpt\n");
43861  for( i = 0; i < scip->set->nheurs; ++i )
43862  {
43863  int s;
43864  for( s = 0; s < SCIPheurGetNDivesets(scip->set->heurs[i]); ++s )
43865  {
43866  SCIP_DIVESET* diveset = SCIPheurGetDivesets(scip->set->heurs[i])[s];
43867  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10d", SCIPdivesetGetName(diveset), SCIPdivesetGetNCalls(diveset));
43868  if( SCIPdivesetGetNCalls(diveset) > 0 )
43869  {
43870  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10d %10d %10.1f",
43871  SCIPdivesetGetNProbingNodes(diveset),
43872  SCIPdivesetGetNLPIterations(diveset),
43873  SCIPdivesetGetNBacktracks(diveset),
43874  SCIPdivesetGetMinDepth(diveset),
43875  SCIPdivesetGetMaxDepth(diveset),
43876  SCIPdivesetGetAvgDepth(diveset));
43877  if( SCIPdivesetGetNSolutionCalls(diveset) > 0 )
43878  {
43879  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10d %10d %10d %10.1f\n",
43884  }
43885  else
43886  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - -\n");
43887  }
43888  else
43889  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - - - - - - - -\n");
43890  }
43891  }
43892  }
43893 }
43894 
43895 /* print compression statistics if tree reoptimization is enabled */
43896 static
43898  SCIP* scip, /**< SCIP data structure */
43899  FILE* file /**< output file */
43900  )
43901 {
43902  int i;
43903 
43904  assert(scip != NULL);
43905 
43906  /* only print compression statistics if tree reoptimization is enabled */
43907  if( !scip->set->reopt_enable )
43908  return;
43909 
43910  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Tree Compressions : ExecTime SetupTime Calls Found\n");
43911 
43912  /* sort compressions w.r.t. their names */
43913  SCIPsetSortComprsName(scip->set);
43914 
43915  for( i = 0; i < scip->set->ncomprs; ++i )
43916  {
43917  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
43918  SCIPcomprGetName(scip->set->comprs[i]),
43919  SCIPcomprGetTime(scip->set->comprs[i]),
43920  SCIPcomprGetSetupTime(scip->set->comprs[i]),
43921  SCIPcomprGetNCalls(scip->set->comprs[i]),
43922  SCIPcomprGetNFound(scip->set->comprs[i]));
43923  }
43924 }
43925 
43926 static
43928  SCIP* scip, /**< SCIP data structure */
43929  FILE* file /**< output file */
43930  )
43931 {
43932  assert(scip != NULL);
43933  assert(scip->stat != NULL);
43934  assert(scip->lp != NULL);
43935 
43936  SCIPmessageFPrintInfo(scip->messagehdlr, file, "LP : Time Calls Iterations Iter/call Iter/sec Time-0-It Calls-0-It ItLimit\n");
43937 
43938  SCIPmessageFPrintInfo(scip->messagehdlr, file, " primal LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
43940  scip->stat->nprimallps + scip->stat->nprimalzeroitlps,
43941  scip->stat->nprimallpiterations,
43942  scip->stat->nprimallps > 0 ? (SCIP_Real)scip->stat->nprimallpiterations/(SCIP_Real)scip->stat->nprimallps : 0.0);
43943  if( SCIPclockGetTime(scip->stat->primallptime) >= 0.01 )
43945  else
43946  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
43947  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
43948  scip->stat->primalzeroittime,
43949  scip->stat->nprimalzeroitlps);
43950 
43951  SCIPmessageFPrintInfo(scip->messagehdlr, file, " dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
43953  scip->stat->nduallps + scip->stat->ndualzeroitlps,
43954  scip->stat->nduallpiterations,
43955  scip->stat->nduallps > 0 ? (SCIP_Real)scip->stat->nduallpiterations/(SCIP_Real)scip->stat->nduallps : 0.0);
43956  if( SCIPclockGetTime(scip->stat->duallptime) >= 0.01 )
43958  else
43959  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
43960  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
43961  scip->stat->dualzeroittime,
43962  scip->stat->ndualzeroitlps);
43963 
43964  SCIPmessageFPrintInfo(scip->messagehdlr, file, " lex dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
43966  scip->stat->nlexduallps,
43967  scip->stat->nlexduallpiterations,
43968  scip->stat->nlexduallps > 0 ? (SCIP_Real)scip->stat->nlexduallpiterations/(SCIP_Real)scip->stat->nlexduallps : 0.0);
43969  if( SCIPclockGetTime(scip->stat->lexduallptime) >= 0.01 )
43971  else
43972  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
43973 
43974  SCIPmessageFPrintInfo(scip->messagehdlr, file, " barrier LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
43976  scip->stat->nbarrierlps,
43977  scip->stat->nbarrierlpiterations,
43978  scip->stat->nbarrierlps > 0 ? (SCIP_Real)scip->stat->nbarrierlpiterations/(SCIP_Real)scip->stat->nbarrierlps : 0.0);
43979  if( SCIPclockGetTime(scip->stat->barrierlptime) >= 0.01 )
43981  else
43982  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
43983  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
43984  scip->stat->barrierzeroittime,
43985  scip->stat->nbarrierzeroitlps);
43986 
43987  SCIPmessageFPrintInfo(scip->messagehdlr, file, " diving/probing LP: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
43989  scip->stat->ndivinglps,
43990  scip->stat->ndivinglpiterations,
43991  scip->stat->ndivinglps > 0 ? (SCIP_Real)scip->stat->ndivinglpiterations/(SCIP_Real)scip->stat->ndivinglps : 0.0);
43992  if( SCIPclockGetTime(scip->stat->divinglptime) >= 0.01 )
43994  else
43995  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
43996 
43997  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
43999  scip->stat->nstrongbranchs,
44000  scip->stat->nsblpiterations,
44001  scip->stat->nstrongbranchs > 0 ? (SCIP_Real)scip->stat->nsblpiterations/(SCIP_Real)scip->stat->nstrongbranchs : 0.0);
44002  if( SCIPclockGetTime(scip->stat->strongbranchtime) >= 0.01 )
44004  else
44005  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
44006  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - %10d\n", scip->stat->nsbtimesiterlimhit);
44007 
44008  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (at root node) : - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f -\n",
44009  scip->stat->nrootstrongbranchs,
44010  scip->stat->nrootsblpiterations,
44011  scip->stat->nrootstrongbranchs > 0
44013 
44014  SCIPmessageFPrintInfo(scip->messagehdlr, file, " conflict analysis: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
44016  scip->stat->nconflictlps,
44017  scip->stat->nconflictlpiterations,
44018  scip->stat->nconflictlps > 0 ? (SCIP_Real)scip->stat->nconflictlpiterations/(SCIP_Real)scip->stat->nconflictlps : 0.0);
44019  if( SCIPclockGetTime(scip->stat->conflictlptime) >= 0.01 )
44021  else
44022  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
44023 }
44024 
44025 static
44027  SCIP* scip, /**< SCIP data structure */
44028  FILE* file /**< output file */
44029  )
44030 {
44031  assert(scip != NULL);
44032  assert(scip->stat != NULL);
44033 
44034  if( scip->nlp == NULL )
44035  return;
44036 
44037  SCIPmessageFPrintInfo(scip->messagehdlr, file, "NLP : Time Calls\n");
44038 
44039  SCIPmessageFPrintInfo(scip->messagehdlr, file, " all NLPs : %10.2f %10" SCIP_LONGINT_FORMAT "\n",
44041  scip->stat->nnlps);
44042 }
44043 
44044 static
44046  SCIP* scip, /**< SCIP data structure */
44047  FILE* file /**< output file */
44048  )
44049 {
44050  int i;
44051 
44052  assert(scip != NULL);
44053  assert(scip->set != NULL);
44054 
44055  if( scip->set->nrelaxs == 0 )
44056  return;
44057 
44058  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Relaxators : Time Calls\n");
44059 
44060  /* sort relaxators w.r.t. their name */
44061  SCIPsetSortRelaxsName(scip->set);
44062 
44063  for( i = 0; i < scip->set->nrelaxs; ++i )
44064  {
44065  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10" SCIP_LONGINT_FORMAT "\n",
44066  SCIPrelaxGetName(scip->set->relaxs[i]),
44067  SCIPrelaxGetTime(scip->set->relaxs[i]),
44068  SCIPrelaxGetNCalls(scip->set->relaxs[i]));
44069  }
44070 }
44071 
44072 static
44074  SCIP* scip, /**< SCIP data structure */
44075  FILE* file /**< output file */
44076  )
44077 {
44078  assert(scip != NULL);
44079  assert(scip->stat != NULL);
44080  assert(scip->tree != NULL);
44081 
44082  SCIPmessageFPrintInfo(scip->messagehdlr, file, "B&B Tree :\n");
44083  SCIPmessageFPrintInfo(scip->messagehdlr, file, " number of runs : %10d\n", scip->stat->nruns);
44084  SCIPmessageFPrintInfo(scip->messagehdlr, file,
44085  " nodes : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
44086  scip->stat->nnodes, scip->stat->ninternalnodes, scip->stat->nnodes - scip->stat->ninternalnodes );
44087  SCIPmessageFPrintInfo(scip->messagehdlr, file, " feasible leaves : %10d\n", scip->stat->nfeasleaves);
44088  SCIPmessageFPrintInfo(scip->messagehdlr, file, " infeas. leaves : %10d\n", scip->stat->ninfeasleaves);
44089  SCIPmessageFPrintInfo(scip->messagehdlr, file, " objective leaves : %10d\n", scip->stat->nobjleaves);
44090  SCIPmessageFPrintInfo(scip->messagehdlr, file,
44091  " nodes (total) : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
44093  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes left : %10d\n", SCIPtreeGetNNodes(scip->tree));
44094  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth : %10d\n", scip->stat->maxdepth);
44095  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth (total): %10d\n", scip->stat->maxtotaldepth);
44096  SCIPmessageFPrintInfo(scip->messagehdlr, file, " backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nbacktracks,
44097  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nbacktracks / (SCIP_Real)scip->stat->nnodes : 0.0);
44098  SCIPmessageFPrintInfo(scip->messagehdlr, file, " early backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nearlybacktracks,
44099  scip->stat->nbacktracks > 0 ? 100.0 * (SCIP_Real)scip->stat->nearlybacktracks / (SCIP_Real)scip->stat->nbacktracks : 0.0);
44100  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes exc. ref. : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nnodesaboverefbound,
44101  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nnodesaboverefbound / (SCIP_Real)scip->stat->nnodes : 0.0);
44102 
44103  SCIPmessageFPrintInfo(scip->messagehdlr, file, " delayed cutoffs : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->ndelayedcutoffs);
44104  SCIPmessageFPrintInfo(scip->messagehdlr, file, " repropagations : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " domain reductions, %" SCIP_LONGINT_FORMAT " cutoffs)\n",
44105  scip->stat->nreprops, scip->stat->nrepropboundchgs, scip->stat->nrepropcutoffs);
44106  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg switch length: %10.2f\n",
44107  scip->stat->nnodes > 0
44108  ? (SCIP_Real)(scip->stat->nactivatednodes + scip->stat->ndeactivatednodes) / (SCIP_Real)scip->stat->nnodes : 0.0);
44109  SCIPmessageFPrintInfo(scip->messagehdlr, file, " switching time : %10.2f\n", SCIPclockGetTime(scip->stat->nodeactivationtime));
44110 }
44111 
44112 /** display solution statistics */
44113 static
44115  SCIP* scip, /**< SCIP data structure */
44116  FILE* file /**< output file */
44117  )
44118 {
44119  SCIP_Real primalbound;
44120  SCIP_Real dualbound;
44121  SCIP_Real bestsol;
44122  SCIP_Real gap;
44123  SCIP_Real firstprimalbound;
44124  SCIP_Bool objlimitreached;
44125  char limsolstring[SCIP_MAXSTRLEN];
44126 
44127  assert(scip != NULL);
44128  assert(scip->stat != NULL);
44129  assert(scip->primal != NULL);
44130 
44131  primalbound = getPrimalbound(scip);
44132  dualbound = getDualbound(scip);
44133  gap = SCIPgetGap(scip);
44134 
44135  objlimitreached = FALSE;
44136  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0
44137  && !SCIPisInfinity(scip, primalbound) )
44138  objlimitreached = TRUE;
44139 
44140  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
44141  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
44142  else
44143  limsolstring[0] = '\0';
44144 
44145  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Solution :\n");
44146  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Solutions found : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " improvements%s)\n",
44147  scip->primal->nsolsfound, scip->primal->nbestsolsfound, limsolstring);
44148 
44149  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(primalbound)) )
44150  {
44151  if( scip->set->stage == SCIP_STAGE_SOLVED )
44152  {
44153  if( scip->primal->nlimsolsfound == 0 )
44154  {
44155  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
44156  {
44157  assert(!objlimitreached);
44158  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible or unbounded\n");
44159  }
44160  else
44161  {
44162  assert(SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE);
44163  if( objlimitreached )
44164  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible (objective limit reached)\n");
44165  else
44166  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible\n");
44167  }
44168  }
44169  else
44170  {
44171  assert(!objlimitreached);
44172  assert(SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED);
44173  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : unbounded\n");
44174  }
44175  }
44176  else
44177  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : -\n");
44178  }
44179  else
44180  {
44181  if( scip->primal->nlimsolsfound == 0 )
44182  {
44183  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
44184  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
44185  }
44186  else
44187  {
44188  /* display first primal bound line */
44189  firstprimalbound = scip->stat->firstprimalbound;
44190  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First Solution : %+21.14e", firstprimalbound);
44191 
44192  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
44193  scip->stat->nrunsbeforefirst,
44194  scip->stat->nnodesbeforefirst,
44195  scip->stat->firstprimaltime,
44196  scip->stat->firstprimaldepth,
44197  ( scip->stat->firstprimalheur != NULL )
44198  ? ( SCIPheurGetName(scip->stat->firstprimalheur) )
44199  : (( scip->stat->nrunsbeforefirst == 0 ) ? "initial" : "relaxation"));
44200 
44201  if( SCIPisInfinity(scip, scip->stat->firstsolgap) )
44202  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : infinite\n");
44203  else
44204  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : %10.2f %%\n", 100.0 * scip->stat->firstsolgap);
44205 
44206  if( SCIPisInfinity(scip, scip->stat->lastsolgap) )
44207  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : infinite\n");
44208  else
44209  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : %10.2f %%\n", 100.0 * scip->stat->lastsolgap);
44210 
44211  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
44212 
44213  /* display (best) primal bound */
44214  bestsol = SCIPsolGetObj(scip->primal->sols[0], scip->set, scip->transprob, scip->origprob);
44215  bestsol = SCIPretransformObj(scip, bestsol);
44216  if( SCIPsetIsGT(scip->set, bestsol, primalbound) )
44217  {
44218  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (user objective limit)\n");
44219  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Best Solution : %+21.14e", bestsol);
44220  }
44221  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
44222  SCIPsolGetRunnum(scip->primal->sols[0]),
44223  SCIPsolGetNodenum(scip->primal->sols[0]),
44224  SCIPsolGetTime(scip->primal->sols[0]),
44225  SCIPsolGetDepth(scip->primal->sols[0]),
44226  SCIPsolGetHeur(scip->primal->sols[0]) != NULL
44228  : (SCIPsolGetRunnum(scip->primal->sols[0]) == 0 ? "initial" : "relaxation"));
44229  }
44230  }
44231  if( objlimitreached || SCIPsetIsInfinity(scip->set, REALABS(dualbound)) )
44232  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : -\n");
44233  else
44234  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : %+21.14e\n", dualbound);
44235  if( SCIPsetIsInfinity(scip->set, gap) )
44236  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : infinite\n");
44237  else
44238  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : %10.2f %%\n", 100.0 * gap);
44239 
44240  if( scip->set->misc_calcintegral )
44241  {
44242  if( SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE )
44243  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (problem infeasible)\n");
44244  else
44245  {
44246  SCIP_Real avggap;
44247 
44248  avggap = 0.0;
44249 
44250  if( !SCIPisFeasZero(scip, SCIPgetSolvingTime(scip)) )
44251  avggap = scip->stat->primaldualintegral/SCIPgetSolvingTime(scip);
44252 
44253  /* caution: this assert is non-deterministic since it depends on the solving time */
44254  assert(0.0 <= avggap && SCIPisLE(scip, avggap, 100.0));
44255 
44256  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : %10.2f %% (%.2f primal-dual integral)\n",
44257  avggap, scip->stat->primaldualintegral);
44258  }
44259  }
44260  else
44261  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (not evaluated)\n");
44262 }
44263 
44264 /** display thread statistics */
44265 static
44267  SCIP* scip, /**< SCIP data structure */
44268  FILE* file /**< output file */
44269  )
44270 {
44271  SCIP_CONCSOLVER** concsolvers;
44272  int nconcsolvers;
44273  int i;
44274  int winner;
44275 
44277  return;
44278 
44279  nconcsolvers = SCIPgetNConcurrentSolvers(scip);
44280  concsolvers = SCIPgetConcurrentSolvers(scip);
44281  winner = SCIPsyncstoreGetWinner(scip->syncstore);
44282 
44283  if( nconcsolvers > 0 )
44284  {
44285  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Concurrent Solvers : SolvingTime SyncTime Nodes LP Iters SolsShared SolsRecvd TighterBnds TighterIntBnds\n");
44286  for( i = 0; i < nconcsolvers; ++i )
44287  {
44288  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",
44289  winner == i ? '*' : ' ',
44290  SCIPconcsolverGetName(concsolvers[i]),
44291  SCIPconcsolverGetSolvingTime(concsolvers[i]),
44292  SCIPconcsolverGetSyncTime(concsolvers[i]),
44293  SCIPconcsolverGetNNodes(concsolvers[i]),
44294  SCIPconcsolverGetNLPIterations(concsolvers[i]),
44295  SCIPconcsolverGetNSolsShared(concsolvers[i]),
44296  SCIPconcsolverGetNSolsRecvd(concsolvers[i]),
44297  SCIPconcsolverGetNTighterBnds(concsolvers[i]),
44298  SCIPconcsolverGetNTighterIntBnds(concsolvers[i])
44299  );
44300  }
44301  }
44302 }
44303 
44304 /** display first LP statistics */
44305 static
44307  SCIP* scip, /**< SCIP data structure */
44308  FILE* file /**< output file */
44309  )
44310 {
44311  SCIP_Real dualboundroot;
44312  SCIP_Real firstdualboundroot;
44313  SCIP_Real firstlptime;
44314  SCIP_Real firstlpspeed;
44315 
44316  assert(scip != NULL);
44317  assert(scip->stat != NULL);
44318  assert(scip->primal != NULL);
44319 
44320  dualboundroot = SCIPgetDualboundRoot(scip);
44321  firstdualboundroot = SCIPgetFirstLPDualboundRoot(scip);
44322  firstlptime = SCIPgetFirstLPTime(scip);
44323 
44324  if( firstlptime > 0.0 )
44325  firstlpspeed = (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime;
44326  else
44327  firstlpspeed = 0.0;
44328 
44329  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Root Node :\n");
44330  if( SCIPsetIsInfinity(scip->set, REALABS(firstdualboundroot)) )
44331  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : -\n");
44332  else
44333  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : %+21.14e\n", firstdualboundroot);
44334  if( firstlpspeed > 0.0 )
44335  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT " (%.2f Iter/sec)\n",
44337  (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime);
44338  else
44339  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootfirstlpiterations);
44340  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Time : %10.2f\n", firstlptime);
44341 
44342  if( SCIPsetIsInfinity(scip->set, REALABS(dualboundroot)) )
44343  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : -\n");
44344  else
44345  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : %+21.14e\n", dualboundroot);
44346  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Root Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootlpiterations);
44347 
44348  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Root LP Estimate : ");
44349  if( scip->stat->rootlpbestestimate != SCIP_INVALID ) /*lint !e777*/
44350  {
44351  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%+21.14e\n", SCIPretransformObj(scip, scip->stat->rootlpbestestimate));
44352  }
44353  else
44354  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%21s\n","-");
44355 }
44356 
44357 /** display timing statistics */
44358 static
44360  SCIP* scip, /**< SCIP data structure */
44361  FILE* file /**< output file */
44362  )
44363 {
44364  SCIP_Real readingtime;
44365 
44366  assert(SCIPgetStage(scip) >= SCIP_STAGE_PROBLEM);
44367 
44368  readingtime = SCIPgetReadingTime(scip);
44369 
44370  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
44371  {
44372  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", readingtime);
44373  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f\n", readingtime);
44374  }
44375  else
44376  {
44377  SCIP_Real totaltime;
44378  SCIP_Real solvingtime;
44379 
44380  solvingtime = SCIPclockGetTime(scip->stat->solvingtime);
44381 
44382  if( scip->set->time_reading )
44383  totaltime = solvingtime;
44384  else
44385  totaltime = solvingtime + readingtime;
44386 
44387  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", totaltime);
44388  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solvingtime);
44389  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", SCIPclockGetTime(scip->stat->presolvingtime));
44390  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f%s\n", readingtime, scip->set->time_reading ? " (included in solving)" : "");
44391 
44392  if( scip->stat->ncopies > 0 )
44393  {
44394  SCIP_Real copytime;
44395 
44396  copytime = SCIPclockGetTime(scip->stat->copyclock);
44397 
44398  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f (%d #copies) (minimal %.2f, maximal %.2f, average %.2f)\n",
44399  copytime, scip->stat->ncopies, scip->stat->mincopytime, scip->stat->maxcopytime, copytime / scip->stat->ncopies);
44400  }
44401  else
44402  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f %s\n", 0.0, "(0 times copied the problem)");
44403  }
44404 }
44405 
44406 /** outputs solving statistics
44407  *
44408  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44409  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44410  *
44411  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
44412  * thus may to correspond to the original status.
44413  *
44414  * @pre This method can be called if SCIP is in one of the following stages:
44415  * - \ref SCIP_STAGE_INIT
44416  * - \ref SCIP_STAGE_PROBLEM
44417  * - \ref SCIP_STAGE_TRANSFORMED
44418  * - \ref SCIP_STAGE_INITPRESOLVE
44419  * - \ref SCIP_STAGE_PRESOLVING
44420  * - \ref SCIP_STAGE_EXITPRESOLVE
44421  * - \ref SCIP_STAGE_PRESOLVED
44422  * - \ref SCIP_STAGE_SOLVING
44423  * - \ref SCIP_STAGE_SOLVED
44424  */
44426  SCIP* scip, /**< SCIP data structure */
44427  FILE* file /**< output file (or NULL for standard output) */
44428  )
44429 {
44430  SCIP_CALL( checkStage(scip, "SCIPprintStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44431 
44432  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Status : ");
44433  SCIP_CALL( SCIPprintStage(scip, file) );
44434  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
44435 
44436  switch( scip->set->stage )
44437  {
44438  case SCIP_STAGE_INIT:
44439  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem : no problem exists.\n");
44440  return SCIP_OKAY;
44441 
44442  case SCIP_STAGE_PROBLEM:
44443  {
44444  printTimingStatistics(scip, file);
44445  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
44446  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
44447  return SCIP_OKAY;
44448  }
44451  {
44452  printTimingStatistics(scip, file);
44453  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
44454  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
44455  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
44456  SCIPprobPrintStatistics(scip->transprob, scip->messagehdlr, file);
44457  printPresolverStatistics(scip, file);
44458  printConstraintStatistics(scip, file);
44459  printConstraintTimingStatistics(scip, file);
44460  printPropagatorStatistics(scip, file);
44461  printConflictStatistics(scip, file);
44462  printConcsolverStatistics(scip, file);
44463  return SCIP_OKAY;
44464  }
44465  case SCIP_STAGE_PRESOLVING:
44467  case SCIP_STAGE_PRESOLVED:
44468  {
44469  printTimingStatistics(scip, file);
44470  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
44471  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
44472  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
44473  SCIPprobPrintStatistics(scip->transprob, scip->messagehdlr, file);
44474  printPresolverStatistics(scip, file);
44475  printConstraintStatistics(scip, file);
44476  printConstraintTimingStatistics(scip, file);
44477  printPropagatorStatistics(scip, file);
44478  printConflictStatistics(scip, file);
44479  printHeuristicStatistics(scip, file);
44480  printCompressionStatistics(scip, file);
44481  printSolutionStatistics(scip, file);
44482  printConcsolverStatistics(scip, file);
44483  return SCIP_OKAY;
44484  }
44485  case SCIP_STAGE_SOLVING:
44486  case SCIP_STAGE_SOLVED:
44487  {
44488  printTimingStatistics(scip, file);
44489  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
44490  SCIPprobPrintStatistics(scip->origprob, scip->messagehdlr, file);
44491  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
44492  SCIPprobPrintStatistics(scip->transprob, scip->messagehdlr, file);
44493  printPresolverStatistics(scip, file);
44494  printConstraintStatistics(scip, file);
44495  printConstraintTimingStatistics(scip, file);
44496  printPropagatorStatistics(scip, file);
44497  printConflictStatistics(scip, file);
44498  printSeparatorStatistics(scip, file);
44499  printPricerStatistics(scip, file);
44500  printBranchruleStatistics(scip, file);
44501  printHeuristicStatistics(scip, file);
44502  printCompressionStatistics(scip, file);
44503  printLPStatistics(scip, file);
44504  printNLPStatistics(scip, file);
44505  printRelaxatorStatistics(scip, file);
44506  printTreeStatistics(scip, file);
44507  printRootStatistics(scip, file);
44508  printSolutionStatistics(scip, file);
44509  printConcsolverStatistics(scip, file);
44510 
44511  return SCIP_OKAY;
44512  }
44513  default:
44514  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
44515  return SCIP_INVALIDCALL;
44516  } /*lint !e788*/
44517 }
44518 
44519 /** outputs reoptimization statistics
44520  *
44521  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44522  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44523  *
44524  * @pre This method can be called if SCIP is in one of the following stages:
44525  * - \ref SCIP_STAGE_INIT
44526  * - \ref SCIP_STAGE_PROBLEM
44527  * - \ref SCIP_STAGE_TRANSFORMED
44528  * - \ref SCIP_STAGE_INITPRESOLVE
44529  * - \ref SCIP_STAGE_PRESOLVING
44530  * - \ref SCIP_STAGE_EXITPRESOLVE
44531  * - \ref SCIP_STAGE_PRESOLVED
44532  * - \ref SCIP_STAGE_SOLVING
44533  * - \ref SCIP_STAGE_SOLVED
44534  */
44536  SCIP* scip, /**< SCIP data structure */
44537  FILE* file /**< output file (or NULL for standard output) */
44538  )
44539 {
44540  SCIP_Real solving;
44541  SCIP_Real presolving;
44542  SCIP_Real updatetime;
44543 
44544  SCIP_CALL( checkStage(scip, "SCIPprintReoptStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44545 
44546  /* skip if reoptimization is disabled */
44547  if( !scip->set->reopt_enable )
44548  return SCIP_OKAY;
44549 
44550  solving = SCIPclockGetTime(scip->stat->solvingtimeoverall);
44551  presolving = SCIPclockGetTime(scip->stat->presolvingtimeoverall);
44552  updatetime = SCIPclockGetTime(scip->stat->reoptupdatetime);
44553 
44554  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Reopt Status : finish after %d runs.\n", scip->stat->nreoptruns);
44555  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Time (sec) :\n");
44556  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solving);
44557  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", presolving);
44558  SCIPmessageFPrintInfo(scip->messagehdlr, file, " save time : %10.2f\n", SCIPreoptGetSavingtime(scip->reopt));
44559  SCIPmessageFPrintInfo(scip->messagehdlr, file, " update time : %10.2f\n", updatetime);
44560  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Nodes : feas infeas pruned cutoff\n");
44561  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d %10d %10d\n",
44564  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : %10.2f %10.2f %10.2f %10.2f\n",
44569 
44570  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Restarts : global local\n");
44571  SCIPmessageFPrintInfo(scip->messagehdlr, file, " first : %10d --\n", SCIPreoptGetFirstRestarts(scip->reopt));
44572  SCIPmessageFPrintInfo(scip->messagehdlr, file, " last : %10d --\n", SCIPreoptGetLastRestarts(scip->reopt));
44573  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d\n", SCIPreoptGetNRestartsGlobal(scip->reopt),
44575  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : -- %10.2f\n",
44577 
44578  return SCIP_OKAY;
44579 }
44580 
44581 /** outputs history statistics about branchings on variables
44582  *
44583  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44584  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44585  *
44586  * @pre This method can be called if SCIP is in one of the following stages:
44587  * - \ref SCIP_STAGE_INIT
44588  * - \ref SCIP_STAGE_PROBLEM
44589  * - \ref SCIP_STAGE_TRANSFORMED
44590  * - \ref SCIP_STAGE_INITPRESOLVE
44591  * - \ref SCIP_STAGE_PRESOLVING
44592  * - \ref SCIP_STAGE_EXITPRESOLVE
44593  * - \ref SCIP_STAGE_PRESOLVED
44594  * - \ref SCIP_STAGE_SOLVING
44595  * - \ref SCIP_STAGE_SOLVED
44596  */
44598  SCIP* scip, /**< SCIP data structure */
44599  FILE* file /**< output file (or NULL for standard output) */
44600  )
44601 {
44602  SCIP_VAR** vars;
44603  int totalnstrongbranchs;
44604  int v;
44605 
44606  SCIP_CALL( checkStage(scip, "SCIPprintBranchingStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44607 
44608  switch( scip->set->stage )
44609  {
44610  case SCIP_STAGE_INIT:
44611  case SCIP_STAGE_PROBLEM:
44612  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem not yet solved. branching statistics not available.\n");
44613  return SCIP_OKAY;
44614 
44617  case SCIP_STAGE_PRESOLVING:
44619  case SCIP_STAGE_PRESOLVED:
44620  case SCIP_STAGE_SOLVING:
44621  case SCIP_STAGE_SOLVED:
44622  SCIP_CALL( SCIPallocBufferArray(scip, &vars, scip->transprob->nvars) );
44623  for( v = 0; v < scip->transprob->nvars; ++v )
44624  {
44625  SCIP_VAR* var;
44626  int i;
44627 
44628  var = scip->transprob->vars[v];
44629  for( i = v; i > 0 && strcmp(SCIPvarGetName(var), SCIPvarGetName(vars[i-1])) < 0; i-- )
44630  vars[i] = vars[i-1];
44631  vars[i] = var;
44632  }
44633 
44634  SCIPmessageFPrintInfo(scip->messagehdlr, file, " locks branchings inferences cutoffs LP gain pscostcount gain variance \n");
44635  SCIPmessageFPrintInfo(scip->messagehdlr, file, "variable prio factor down up depth down up sb down up down up down up down up down up\n");
44636 
44637  totalnstrongbranchs = 0;
44638  for( v = 0; v < scip->transprob->nvars; ++v )
44639  {
44642  || SCIPgetVarNStrongbranchs(scip, vars[v]) > 0 )
44643  {
44644  int nstrongbranchs;
44645 
44646  nstrongbranchs = SCIPgetVarNStrongbranchs(scip, vars[v]);
44647  totalnstrongbranchs += nstrongbranchs;
44648  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",
44649  SCIPvarGetName(vars[v]),
44650  SCIPvarGetBranchPriority(vars[v]),
44651  SCIPvarGetBranchFactor(vars[v]),
44652  SCIPvarGetNLocksDown(vars[v]),
44653  SCIPvarGetNLocksUp(vars[v]),
44655  + SCIPvarGetAvgBranchdepth(vars[v], SCIP_BRANCHDIR_UPWARDS))/2.0 - 1.0,
44658  nstrongbranchs,
44661  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_DOWNWARDS),
44662  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_UPWARDS),
44663  SCIPvarGetPseudocost(vars[v], scip->stat, -1.0),
44664  SCIPvarGetPseudocost(vars[v], scip->stat, +1.0),
44669  }
44670  }
44671  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",
44674  totalnstrongbranchs,
44693 
44694  SCIPfreeBufferArray(scip, &vars);
44695 
44696  return SCIP_OKAY;
44697 
44698  default:
44699  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
44700  return SCIP_INVALIDCALL;
44701  } /*lint !e788*/
44702 }
44703 
44704 /** outputs node information display line
44705  *
44706  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44707  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44708  *
44709  * @pre This method can be called if SCIP is in one of the following stages:
44710  * - \ref SCIP_STAGE_SOLVING
44711  */
44713  SCIP* scip, /**< SCIP data structure */
44714  FILE* file, /**< output file (or NULL for standard output) */
44715  SCIP_VERBLEVEL verblevel, /**< minimal verbosity level to actually display the information line */
44716  SCIP_Bool endline /**< should the line be terminated with a newline symbol? */
44717  )
44718 {
44719  SCIP_CALL( checkStage(scip, "SCIPprintDisplayLine", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
44720 
44721  if( (SCIP_VERBLEVEL)scip->set->disp_verblevel >= verblevel )
44722  {
44723  SCIP_CALL( SCIPdispPrintLine(scip->set, scip->messagehdlr, scip->stat, file, TRUE, endline) );
44724  }
44725 
44726  return SCIP_OKAY;
44727 }
44728 
44729 /** gets total number of implications between variables that are stored in the implication graph
44730  *
44731  * @return the total number of implications between variables that are stored in the implication graph
44732  *
44733  * @pre This method can be called if SCIP is in one of the following stages:
44734  * - \ref SCIP_STAGE_INITPRESOLVE
44735  * - \ref SCIP_STAGE_PRESOLVING
44736  * - \ref SCIP_STAGE_EXITPRESOLVE
44737  * - \ref SCIP_STAGE_PRESOLVED
44738  * - \ref SCIP_STAGE_INITSOLVE
44739  * - \ref SCIP_STAGE_SOLVING
44740  * - \ref SCIP_STAGE_SOLVED
44741  */
44743  SCIP* scip /**< SCIP data structure */
44744  )
44745 {
44746  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetNImplications", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
44747 
44748  return scip->stat->nimplications;
44749 }
44750 
44751 /** stores conflict graph of binary variables' implications into a file, which can be used as input for the DOT tool
44752  *
44753  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44754  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44755  *
44756  * @pre This method can be called if SCIP is in one of the following stages:
44757  * - \ref SCIP_STAGE_TRANSFORMED
44758  * - \ref SCIP_STAGE_INITPRESOLVE
44759  * - \ref SCIP_STAGE_PRESOLVING
44760  * - \ref SCIP_STAGE_EXITPRESOLVE
44761  * - \ref SCIP_STAGE_PRESOLVED
44762  * - \ref SCIP_STAGE_INITSOLVE
44763  * - \ref SCIP_STAGE_SOLVING
44764  * - \ref SCIP_STAGE_SOLVED
44765  * - \ref SCIP_STAGE_EXITSOLVE
44766  *
44767  * @deprecated because binary implications are now stored as cliques, please use SCIPwriteCliqueGraph() instead
44768  *
44769  */
44771  SCIP* scip, /**< SCIP data structure */
44772  const char* filename /**< file name, or NULL for stdout */
44773  )
44774 { /*lint --e{715}*/
44775  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");
44776 
44777  return SCIP_OKAY;
44778 }
44779 
44780 /** update statistical information when a new solution was found */
44782  SCIP* scip /**< SCIP data structure */
44783  )
44784 {
44785  SCIP_Real primalbound;
44786  SCIP_Real dualbound;
44787 
44788  primalbound = getPrimalbound(scip);
44789  dualbound = getDualbound(scip);
44790 
44791  if( SCIPsetIsEQ(scip->set, primalbound, dualbound) )
44792  scip->stat->lastsolgap = 0.0;
44793 
44794  else if( SCIPsetIsZero(scip->set, dualbound)
44795  || SCIPsetIsZero(scip->set, primalbound)
44796  || SCIPsetIsInfinity(scip->set, REALABS(primalbound))
44797  || SCIPsetIsInfinity(scip->set, REALABS(dualbound))
44798  || primalbound * dualbound < 0.0 )
44799  {
44800  scip->stat->lastsolgap = SCIPsetInfinity(scip->set);
44801  }
44802  else
44803  {
44804  SCIP_Real absdual = REALABS(dualbound);
44805  SCIP_Real absprimal = REALABS(primalbound);
44806 
44807  scip->stat->lastsolgap = REALABS((primalbound - dualbound)/MIN(absdual, absprimal));
44808  }
44809 
44810  if( scip->primal->nsols == 1 )
44811  scip->stat->firstsolgap = scip->stat->lastsolgap;
44812 
44813  if( scip->set->stage == SCIP_STAGE_SOLVING && scip->set->misc_calcintegral )
44814  {
44816  }
44817 }
44818 
44819 
44820 
44821 
44822 /*
44823  * timing methods
44824  */
44825 
44826 /** gets current time of day in seconds (standard time zone)
44827  *
44828  * @return the current time of day in seconds (standard time zone).
44829  */
44831  SCIP* scip /**< SCIP data structure */
44832  )
44833 {
44834  assert(scip != NULL);
44835 
44836  return SCIPclockGetTimeOfDay();
44837 }
44838 
44839 /** creates a clock using the default clock type
44840  *
44841  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44842  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44843  */
44845  SCIP* scip, /**< SCIP data structure */
44846  SCIP_CLOCK** clck /**< pointer to clock timer */
44847  )
44848 {
44849  assert(scip != NULL);
44850 
44852 
44853  return SCIP_OKAY;
44854 }
44855 
44856 /** creates a clock counting the CPU user seconds
44857  *
44858  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44859  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44860  */
44862  SCIP* scip, /**< SCIP data structure */
44863  SCIP_CLOCK** clck /**< pointer to clock timer */
44864  )
44865 {
44866  assert(scip != NULL);
44867 
44869 
44870  return SCIP_OKAY;
44871 }
44872 
44873 /** creates a clock counting the wall clock seconds
44874  *
44875  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44876  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44877  */
44879  SCIP* scip, /**< SCIP data structure */
44880  SCIP_CLOCK** clck /**< pointer to clock timer */
44881  )
44882 {
44883  assert(scip != NULL);
44884 
44886 
44887  return SCIP_OKAY;
44888 }
44889 
44890 /** frees a clock
44891  *
44892  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44893  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44894  */
44896  SCIP* scip, /**< SCIP data structure */
44897  SCIP_CLOCK** clck /**< pointer to clock timer */
44898  )
44899 {
44900  assert(scip != NULL);
44901 
44902  SCIPclockFree(clck);
44903 
44904  return SCIP_OKAY;
44905 }
44906 
44907 /** resets the time measurement of a clock to zero and completely stops the clock
44908  *
44909  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44910  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44911  */
44913  SCIP* scip, /**< SCIP data structure */
44914  SCIP_CLOCK* clck /**< clock timer */
44915  )
44916 {
44917  assert(scip != NULL);
44918 
44919  SCIPclockReset(clck);
44920 
44921  return SCIP_OKAY;
44922 }
44923 
44924 /** starts the time measurement of a clock
44925  *
44926  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44927  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44928  */
44930  SCIP* scip, /**< SCIP data structure */
44931  SCIP_CLOCK* clck /**< clock timer */
44932  )
44933 {
44934  assert(scip != NULL);
44935 
44936  SCIPclockStart(clck, scip->set);
44937 
44938  return SCIP_OKAY;
44939 }
44940 
44941 /** stops the time measurement of a clock
44942  *
44943  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
44944  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
44945  */
44947  SCIP* scip, /**< SCIP data structure */
44948  SCIP_CLOCK* clck /**< clock timer */
44949  )
44950 {
44951  assert(scip != NULL);
44952 
44953  SCIPclockStop(clck, scip->set);
44954 
44955  return SCIP_OKAY;
44956 }
44957 
44958 /** enables or disables all statistic clocks of SCIP concerning plugin statistics,
44959  * LP execution time, strong branching time, etc.
44960  *
44961  * Method reads the value of the parameter timing/statistictiming. In order to disable statistic timing,
44962  * set the parameter to FALSE.
44963  *
44964  * @note: The (pre-)solving time clocks which are relevant for the output during (pre-)solving
44965  * are not affected by this method
44966  *
44967  * @see: For completely disabling all timing of SCIP, consider setting the parameter timing/enabled to FALSE
44968  *
44969  * @pre This method can be called if SCIP is in one of the following stages:
44970  * - \ref SCIP_STAGE_INIT
44971  * - \ref SCIP_STAGE_PROBLEM
44972  * - \ref SCIP_STAGE_TRANSFORMING
44973  * - \ref SCIP_STAGE_TRANSFORMED
44974  * - \ref SCIP_STAGE_INITPRESOLVE
44975  * - \ref SCIP_STAGE_PRESOLVING
44976  * - \ref SCIP_STAGE_EXITPRESOLVE
44977  * - \ref SCIP_STAGE_PRESOLVED
44978  * - \ref SCIP_STAGE_INITSOLVE
44979  * - \ref SCIP_STAGE_SOLVING
44980  * - \ref SCIP_STAGE_SOLVED
44981  * - \ref SCIP_STAGE_EXITSOLVE
44982  * - \ref SCIP_STAGE_FREETRANS
44983  *
44984  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
44985  */
44987  SCIP* scip /**< SCIP data structure */
44988  )
44989 {
44990  SCIP_CALL( checkStage(scip, "SCIPenableOrDisableStatisticTiming", TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
44991 
44993 
44994  if( scip->set->stage > SCIP_STAGE_INIT )
44995  {
44996  assert(scip->stat != NULL);
44998  }
44999  if( scip->set->stage >= SCIP_STAGE_TRANSFORMING )
45000  {
45001  assert(scip->conflict != NULL);
45003  }
45004 
45005  return SCIP_OKAY;
45006 }
45007 
45008 /** starts the current solving time
45009  *
45010  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45011  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45012  *
45013  * @pre This method can be called if SCIP is in one of the following stages:
45014  * - \ref SCIP_STAGE_PROBLEM
45015  * - \ref SCIP_STAGE_TRANSFORMING
45016  * - \ref SCIP_STAGE_TRANSFORMED
45017  * - \ref SCIP_STAGE_INITPRESOLVE
45018  * - \ref SCIP_STAGE_PRESOLVING
45019  * - \ref SCIP_STAGE_EXITPRESOLVE
45020  * - \ref SCIP_STAGE_PRESOLVED
45021  * - \ref SCIP_STAGE_INITSOLVE
45022  * - \ref SCIP_STAGE_SOLVING
45023  * - \ref SCIP_STAGE_SOLVED
45024  * - \ref SCIP_STAGE_EXITSOLVE
45025  * - \ref SCIP_STAGE_FREETRANS
45026  *
45027  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
45028  */
45030  SCIP* scip /**< SCIP data structure */
45031  )
45032 {
45033  SCIP_CALL( checkStage(scip, "SCIPstartSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
45034 
45035  SCIPclockStart(scip->stat->solvingtime, scip->set);
45036  SCIPclockStart(scip->stat->solvingtimeoverall, scip->set);
45037 
45038  return SCIP_OKAY;
45039 }
45040 
45041 /** stops the current solving time in seconds
45042  *
45043  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45044  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45045  *
45046  * @pre This method can be called if SCIP is in one of the following stages:
45047  * - \ref SCIP_STAGE_PROBLEM
45048  * - \ref SCIP_STAGE_TRANSFORMING
45049  * - \ref SCIP_STAGE_TRANSFORMED
45050  * - \ref SCIP_STAGE_INITPRESOLVE
45051  * - \ref SCIP_STAGE_PRESOLVING
45052  * - \ref SCIP_STAGE_EXITPRESOLVE
45053  * - \ref SCIP_STAGE_PRESOLVED
45054  * - \ref SCIP_STAGE_INITSOLVE
45055  * - \ref SCIP_STAGE_SOLVING
45056  * - \ref SCIP_STAGE_SOLVED
45057  * - \ref SCIP_STAGE_EXITSOLVE
45058  * - \ref SCIP_STAGE_FREETRANS
45059  *
45060  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
45061  */
45063  SCIP* scip /**< SCIP data structure */
45064  )
45065 {
45066  SCIP_CALL( checkStage(scip, "SCIPstopSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
45067 
45068  SCIPclockStop(scip->stat->solvingtime, scip->set);
45069  SCIPclockStop(scip->stat->solvingtimeoverall, scip->set);
45070 
45071  return SCIP_OKAY;
45072 }
45073 
45074 /** gets the measured time of a clock in seconds
45075  *
45076  * @return the measured time of a clock in seconds.
45077  */
45079  SCIP* scip, /**< SCIP data structure */
45080  SCIP_CLOCK* clck /**< clock timer */
45081  )
45082 {
45083  assert(scip != NULL);
45084 
45085  return SCIPclockGetTime(clck);
45086 }
45087 
45088 /** sets the measured time of a clock to the given value in seconds
45089  *
45090  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45091  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45092  */
45094  SCIP* scip, /**< SCIP data structure */
45095  SCIP_CLOCK* clck, /**< clock timer */
45096  SCIP_Real sec /**< time in seconds to set the clock's timer to */
45097  )
45098 {
45099  assert(scip != NULL);
45100 
45101  SCIPclockSetTime(clck, sec);
45102 
45103  return SCIP_OKAY;
45104 }
45105 
45106 /** gets the current total SCIP time in seconds, possibly accumulated over several problems.
45107  *
45108  * @return the current total SCIP time in seconds, ie. the total time since the SCIP instance has been created
45109  */
45111  SCIP* scip /**< SCIP data structure */
45112  )
45113 {
45114  assert(scip != NULL);
45115 
45116  return SCIPclockGetTime(scip->totaltime);
45117 }
45118 
45119 /** gets the current solving time in seconds
45120  *
45121  * @return the current solving time in seconds.
45122  *
45123  * @pre This method can be called if SCIP is in one of the following stages:
45124  * - \ref SCIP_STAGE_PROBLEM
45125  * - \ref SCIP_STAGE_TRANSFORMING
45126  * - \ref SCIP_STAGE_TRANSFORMED
45127  * - \ref SCIP_STAGE_INITPRESOLVE
45128  * - \ref SCIP_STAGE_PRESOLVING
45129  * - \ref SCIP_STAGE_EXITPRESOLVE
45130  * - \ref SCIP_STAGE_PRESOLVED
45131  * - \ref SCIP_STAGE_INITSOLVE
45132  * - \ref SCIP_STAGE_SOLVING
45133  * - \ref SCIP_STAGE_SOLVED
45134  *
45135  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
45136  */
45138  SCIP* scip /**< SCIP data structure */
45139  )
45140 {
45141  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetSolvingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45142 
45143  return SCIPclockGetTime(scip->stat->solvingtime);
45144 }
45145 
45146 /** gets the current reading time in seconds
45147  *
45148  * @return the current reading time in seconds.
45149  *
45150  * @pre This method can be called if SCIP is in one of the following stages:
45151  * - \ref SCIP_STAGE_PROBLEM
45152  * - \ref SCIP_STAGE_TRANSFORMING
45153  * - \ref SCIP_STAGE_TRANSFORMED
45154  * - \ref SCIP_STAGE_INITPRESOLVE
45155  * - \ref SCIP_STAGE_PRESOLVING
45156  * - \ref SCIP_STAGE_EXITPRESOLVE
45157  * - \ref SCIP_STAGE_PRESOLVED
45158  * - \ref SCIP_STAGE_INITSOLVE
45159  * - \ref SCIP_STAGE_SOLVING
45160  * - \ref SCIP_STAGE_SOLVED
45161  *
45162  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
45163  */
45165  SCIP* scip /**< SCIP data structure */
45166  )
45167 {
45168  SCIP_Real readingtime;
45169  int r;
45170 
45171  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetReadingTime", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45172 
45173  readingtime = 0.0;
45174 
45175  /* sum up the reading time of all readers */
45176  for( r = 0; r < scip->set->nreaders; ++r )
45177  {
45178  assert(scip->set->readers[r] != NULL);
45179  assert(!SCIPisNegative(scip, SCIPreaderGetReadingTime(scip->set->readers[r])));
45180  readingtime += SCIPreaderGetReadingTime(scip->set->readers[r]);
45181  }
45182 
45183  return readingtime;
45184 }
45185 
45186 /** gets the current presolving time in seconds
45187  *
45188  * @return the current presolving time in seconds.
45189  *
45190  * @pre This method can be called if SCIP is in one of the following stages:
45191  * - \ref SCIP_STAGE_INITPRESOLVE
45192  * - \ref SCIP_STAGE_PRESOLVING
45193  * - \ref SCIP_STAGE_EXITPRESOLVE
45194  * - \ref SCIP_STAGE_PRESOLVED
45195  * - \ref SCIP_STAGE_INITSOLVE
45196  * - \ref SCIP_STAGE_SOLVING
45197  * - \ref SCIP_STAGE_SOLVED
45198  *
45199  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
45200  */
45202  SCIP* scip /**< SCIP data structure */
45203  )
45204 {
45205  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetPresolvingTime", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45206 
45207  return SCIPclockGetTime(scip->stat->presolvingtime);
45208 }
45209 
45210 /** gets the time need to solve the first LP in the root node
45211  *
45212  * @return the solving time for the first LP in the root node in seconds.
45213  *
45214  * @pre This method can be called if SCIP is in one of the following stages:
45215  * - \ref SCIP_STAGE_TRANSFORMING
45216  * - \ref SCIP_STAGE_TRANSFORMED
45217  * - \ref SCIP_STAGE_INITPRESOLVE
45218  * - \ref SCIP_STAGE_PRESOLVING
45219  * - \ref SCIP_STAGE_EXITPRESOLVE
45220  * - \ref SCIP_STAGE_PRESOLVED
45221  * - \ref SCIP_STAGE_INITSOLVE
45222  * - \ref SCIP_STAGE_SOLVING
45223  * - \ref SCIP_STAGE_SOLVED
45224  *
45225  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
45226  */
45228  SCIP* scip /**< SCIP data structure */
45229  )
45230 {
45231  SCIP_CALL_ABORT( checkStage(scip, "SCIPgetFirstLPTime", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
45232 
45233  return scip->stat->firstlptime;
45234 }
45235 
45236 
45237 
45238 /*
45239  * numeric values and comparisons
45240  */
45241 
45242 /** returns value treated as zero
45243  *
45244  * @return value treated as zero
45245  */
45247  SCIP* scip /**< SCIP data structure */
45248  )
45249 {
45250  assert(scip != NULL);
45251  assert(scip->set != NULL);
45252 
45253  return SCIPsetEpsilon(scip->set);
45254 }
45255 
45256 /** returns value treated as zero for sums of floating point values
45257  *
45258  * @return value treated as zero for sums of floating point values
45259  */
45261  SCIP* scip /**< SCIP data structure */
45262  )
45263 {
45264  assert(scip != NULL);
45265  assert(scip->set != NULL);
45266 
45267  return SCIPsetSumepsilon(scip->set);
45268 }
45269 
45270 /** returns feasibility tolerance for constraints
45271  *
45272  * @return feasibility tolerance for constraints
45273  */
45275  SCIP* scip /**< SCIP data structure */
45276  )
45277 {
45278  assert(scip != NULL);
45279  assert(scip->set != NULL);
45280 
45281  return SCIPsetFeastol(scip->set);
45282 }
45283 
45284 /** returns primal feasibility tolerance of LP solver
45285  *
45286  * @return primal feasibility tolerance of LP solver
45287  */
45289  SCIP* scip /**< SCIP data structure */
45290  )
45291 {
45292  assert(scip != NULL);
45293  assert(scip->set != NULL);
45294 
45295  return SCIPsetLpfeastol(scip->set);
45296 }
45297 
45298 /** returns feasibility tolerance for reduced costs
45299  *
45300  * @return feasibility tolerance for reduced costs
45301  */
45303  SCIP* scip /**< SCIP data structure */
45304  )
45305 {
45306  assert(scip != NULL);
45307  assert(scip->set != NULL);
45308 
45309  return SCIPsetDualfeastol(scip->set);
45310 }
45311 
45312 /** returns convergence tolerance used in barrier algorithm
45313  *
45314  * @return convergence tolerance used in barrier algorithm
45315  */
45317  SCIP* scip /**< SCIP data structure */
45318  )
45319 {
45320  assert(scip != NULL);
45321  assert(scip->set != NULL);
45322 
45323  return SCIPsetBarrierconvtol(scip->set);
45324 }
45325 
45326 /** return the cutoff bound delta
45327  *
45328  * @return cutoff bound data
45329  */
45331  SCIP* scip /**< SCIP data structure */
45332  )
45333 {
45334  assert(scip != NULL);
45335  assert(scip->set != NULL);
45336 
45337  return SCIPsetCutoffbounddelta(scip->set);
45338 }
45339 
45340 /** sets the feasibility tolerance for constraints
45341  *
45342  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45343  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45344  */
45346  SCIP* scip, /**< SCIP data structure */
45347  SCIP_Real feastol /**< new feasibility tolerance for constraints */
45348  )
45349 {
45350  assert(scip != NULL);
45351 
45352  /* change the settings */
45353  SCIP_CALL( SCIPsetSetFeastol(scip->set, feastol) );
45354 
45355  return SCIP_OKAY;
45356 }
45357 
45358 /** sets the primal feasibility tolerance of LP solver
45359  *
45360  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45361  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45362  */
45364  SCIP* scip, /**< SCIP data structure */
45365  SCIP_Real lpfeastol, /**< new primal feasibility tolerance of LP solver */
45366  SCIP_Bool printnewvalue /**< should "numerics/lpfeastol = ..." be printed? */
45367  )
45368 {
45369  assert(scip != NULL);
45370 
45371  /* mark the LP unsolved, if the primal feasibility tolerance was tightened */
45372  if( scip->lp != NULL && lpfeastol < SCIPsetLpfeastol(scip->set) )
45373  {
45374  scip->lp->solved = FALSE;
45376  }
45377 
45378  /* change the settings */
45379  SCIP_CALL( SCIPsetSetLpfeastol(scip->set, lpfeastol, printnewvalue) );
45380 
45381  return SCIP_OKAY;
45382 }
45383 
45384 /** sets the feasibility tolerance for reduced costs
45385  *
45386  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45387  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45388  */
45390  SCIP* scip, /**< SCIP data structure */
45391  SCIP_Real dualfeastol /**< new feasibility tolerance for reduced costs */
45392  )
45393 {
45394  assert(scip != NULL);
45395 
45396  /* mark the LP unsolved, if the dual feasibility tolerance was tightened */
45397  if( scip->lp != NULL && dualfeastol < SCIPsetDualfeastol(scip->set) )
45398  {
45399  scip->lp->solved = FALSE;
45401  }
45402 
45403  /* change the settings */
45404  SCIP_CALL( SCIPsetSetDualfeastol(scip->set, dualfeastol) );
45405 
45406  return SCIP_OKAY;
45407 }
45408 
45409 /** sets the convergence tolerance used in barrier algorithm
45410  *
45411  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45412  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45413  */
45415  SCIP* scip, /**< SCIP data structure */
45416  SCIP_Real barrierconvtol /**< new convergence tolerance used in barrier algorithm */
45417  )
45418 {
45419  assert(scip != NULL);
45420 
45421  /* mark the LP unsolved, if the convergence tolerance was tightened, and the LP was solved with the barrier algorithm */
45422  if( scip->lp != NULL && barrierconvtol < SCIPsetBarrierconvtol(scip->set)
45424  scip->lp->solved = FALSE;
45425 
45426  /* change the settings */
45427  SCIP_CALL( SCIPsetSetBarrierconvtol(scip->set, barrierconvtol) );
45428 
45429  return SCIP_OKAY;
45430 }
45431 
45432 /** marks that some limit parameter was changed */
45434  SCIP* scip /**< SCIP data structure */
45435  )
45436 {
45437  assert(scip != NULL);
45438 
45439  /* change the settings */
45440  SCIPsetSetLimitChanged(scip->set);
45441 }
45442 
45443 /** outputs a real number, or "+infinity", or "-infinity" to a file */
45445  SCIP* scip, /**< SCIP data structure */
45446  FILE* file, /**< output file (or NULL for standard output) */
45447  SCIP_Real val, /**< value to print */
45448  int width, /**< width of the field */
45449  int precision /**< number of significant digits printed */
45450  )
45451 {
45452  char s[SCIP_MAXSTRLEN];
45453  char strformat[SCIP_MAXSTRLEN];
45454 
45455  assert(scip != NULL);
45456 
45457  if( SCIPsetIsInfinity(scip->set, val) )
45458  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "+infinity");
45459  else if( SCIPsetIsInfinity(scip->set, -val) )
45460  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, "-infinity");
45461  else
45462  {
45463  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%.%dg", precision);
45464  (void) SCIPsnprintf(s, SCIP_MAXSTRLEN, (const char*)strformat, val);
45465  }
45466  (void) SCIPsnprintf(strformat, SCIP_MAXSTRLEN, "%%%ds", width);
45467  SCIPmessageFPrintInfo(scip->messagehdlr, file, (const char*)strformat, s);
45468 }
45469 
45470 /** parse a real value that was written with SCIPprintReal() */
45472  SCIP* scip, /**< SCIP data structure */
45473  const char* str, /**< string to search */
45474  SCIP_Real* value, /**< pointer to store the parsed value */
45475  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
45476  )
45477 {
45478  char* localstr;
45479 
45480  assert(scip != NULL);
45481  assert(str != NULL);
45482  assert(value != NULL);
45483  assert(endptr != NULL);
45484 
45485  localstr = (char*)str;
45486 
45487  /* ignore white space */
45488  while(isspace((unsigned char)*localstr))
45489  ++localstr;
45490 
45491  /* test for a special infinity first */
45492  if( strncmp(localstr, "+infinity", 9) == 0 )
45493  {
45494  *value = SCIPinfinity(scip);
45495  *endptr = (char*)(localstr + 9);
45496  return TRUE;
45497  }
45498  else if( strncmp(localstr, "-infinity", 9) == 0 )
45499  {
45500  *value = -SCIPinfinity(scip);
45501  *endptr = (char*)(localstr + 9);
45502  return TRUE;
45503  }
45504  else
45505  {
45506  /* parse a finite value */
45507  return SCIPstrToRealValue(str, value, endptr);
45508  }
45509 }
45510 
45511 /*
45512  * memory management
45513  */
45514 
45515 /** returns block memory to use at the current time
45516  *
45517  * @return the block memory to use at the current time.
45518  */
45520  SCIP* scip /**< SCIP data structure */
45521  )
45522 {
45523  assert(scip != NULL);
45524  assert(scip->set != NULL);
45525  assert(scip->mem != NULL);
45526 
45527  return scip->mem->probmem;
45528 }
45529 
45530 /** returns buffer memory for short living temporary objects
45531  *
45532  * @return the buffer memory for short living temporary objects
45533  */
45535  SCIP* scip /**< SCIP data structure */
45536  )
45537 {
45538  assert(scip != NULL);
45539  assert(scip->mem != NULL);
45540 
45541  return scip->mem->buffer;
45542 }
45543 
45544 /** returns clean buffer memory for short living temporary objects initialized to all zero
45545  *
45546  * @return the buffer memory for short living temporary objects initialized to all zero
45547  */
45549  SCIP* scip /**< SCIP data structure */
45550  )
45551 {
45552  assert(scip != NULL);
45553  assert(scip->mem != NULL);
45554 
45555  return scip->mem->cleanbuffer;
45556 }
45557 
45558 /** returns the total number of bytes used in block and buffer memory
45559  *
45560  * @return the total number of bytes used in block and buffer memory.
45561  */
45563  SCIP* scip /**< SCIP data structure */
45564  )
45565 {
45566  assert(scip != NULL);
45567 
45568  return SCIPmemGetUsed(scip->mem);
45569 }
45570 
45571 /** returns the total number of bytes in block and buffer memory
45572  *
45573  * @return the total number of bytes in block and buffer memory.
45574  */
45576  SCIP* scip /**< SCIP data structure */
45577  )
45578 {
45579  assert(scip != NULL);
45580 
45581  return SCIPmemGetTotal(scip->mem);
45582 }
45583 
45584 /** returns the estimated number of bytes used by external software, e.g., the LP solver
45585  *
45586  * @return the estimated number of bytes used by external software, e.g., the LP solver.
45587  */
45589  SCIP* scip /**< SCIP data structure */
45590  )
45591 {
45592  assert(scip != NULL);
45593 
45594  return SCIPstatGetMemExternEstim(scip->stat);
45595 }
45596 
45597 /** calculate memory size for dynamically allocated arrays
45598  *
45599  * @return the memory size for dynamically allocated arrays.
45600  */
45602  SCIP* scip, /**< SCIP data structure */
45603  int num /**< minimum number of entries to store */
45604  )
45605 {
45606  assert(scip != NULL);
45607 
45608  return SCIPsetCalcMemGrowSize(scip->set, num);
45609 }
45610 
45611 /** extends a dynamically allocated block memory array to be able to store at least the given number of elements;
45612  * use SCIPensureBlockMemoryArray() define to call this method!
45613  *
45614  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
45615  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
45616  */
45618  SCIP* scip, /**< SCIP data structure */
45619  void** arrayptr, /**< pointer to dynamically sized array */
45620  size_t elemsize, /**< size in bytes of each element in array */
45621  int* arraysize, /**< pointer to current array size */
45622  int minsize /**< required minimal array size */
45623  )
45624 {
45625  assert(scip != NULL);
45626  assert(arrayptr != NULL);
45627  assert(elemsize > 0);
45628  assert(arraysize != NULL);
45629 
45630  if( minsize > *arraysize )
45631  {
45632  int newsize;
45633 
45634  newsize = SCIPsetCalcMemGrowSize(scip->set, minsize);
45635  SCIP_ALLOC( BMSreallocBlockMemorySize(SCIPblkmem(scip), arrayptr, *arraysize * elemsize, newsize * elemsize) );
45636  *arraysize = newsize;
45637  }
45638 
45639  return SCIP_OKAY;
45640 }
45641 
45642 /** prints output about used memory */
45644  SCIP* scip /**< SCIP data structure */
45645  )
45646 {
45647  assert(scip != NULL);
45648  assert(scip->mem != NULL);
45649  assert(scip->set != NULL);
45650 
45651  BMSdisplayMemory();
45652 
45653  SCIPmessagePrintInfo(scip->messagehdlr, "\nParameter Block Memory (%p):\n", scip->mem->setmem);
45655 
45656  SCIPmessagePrintInfo(scip->messagehdlr, "\nSolution Block Memory (%p):\n", scip->mem->probmem);
45658 
45659  SCIPmessagePrintInfo(scip->messagehdlr, "\nMemory Buffers:\n");
45661 
45662  SCIPmessagePrintInfo(scip->messagehdlr, "\nClean Memory Buffers:\n");
45664 }
45665 
45666 
45667 
45668 
45669 /*
45670  * simple functions implemented as defines
45671  */
45672 
45673 /* In debug mode, the following methods are implemented as function calls to ensure
45674  * type validity.
45675  * In optimized mode, the methods are implemented as defines to improve performance.
45676  * However, we want to have them in the library anyways, so we have to undef the defines.
45677  */
45678 
45679 #undef SCIPinfinity
45680 #undef SCIPisInfinity
45681 #undef SCIPisEQ
45682 #undef SCIPisLT
45683 #undef SCIPisLE
45684 #undef SCIPisGT
45685 #undef SCIPisGE
45686 #undef SCIPisZero
45687 #undef SCIPisPositive
45688 #undef SCIPisNegative
45689 #undef SCIPisIntegral
45690 #undef SCIPisScalingIntegral
45691 #undef SCIPisFracIntegral
45692 #undef SCIPfloor
45693 #undef SCIPceil
45694 #undef SCIPround
45695 #undef SCIPfrac
45696 #undef SCIPisSumEQ
45697 #undef SCIPisSumLT
45698 #undef SCIPisSumLE
45699 #undef SCIPisSumGT
45700 #undef SCIPisSumGE
45701 #undef SCIPisSumZero
45702 #undef SCIPisSumPositive
45703 #undef SCIPisSumNegative
45704 #undef SCIPisFeasEQ
45705 #undef SCIPisFeasLT
45706 #undef SCIPisFeasLE
45707 #undef SCIPisFeasGT
45708 #undef SCIPisFeasGE
45709 #undef SCIPisFeasZero
45710 #undef SCIPisFeasPositive
45711 #undef SCIPisFeasNegative
45712 #undef SCIPisFeasIntegral
45713 #undef SCIPisFeasFracIntegral
45714 #undef SCIPfeasFloor
45715 #undef SCIPfeasCeil
45716 #undef SCIPfeasRound
45717 #undef SCIPfeasFrac
45718 #undef SCIPisDualfeasEQ
45719 #undef SCIPisDualfeasLT
45720 #undef SCIPisDualfeasLE
45721 #undef SCIPisDualfeasGT
45722 #undef SCIPisDualfeasGE
45723 #undef SCIPisDualfeasZero
45724 #undef SCIPisDualfeasPositive
45725 #undef SCIPisDualfeasNegative
45726 #undef SCIPisDualfeasIntegral
45727 #undef SCIPisDualfeasFracIntegral
45728 #undef SCIPdualfeasFloor
45729 #undef SCIPdualfeasCeil
45730 #undef SCIPdualfeasRound
45731 #undef SCIPdualfeasFrac
45732 #undef SCIPisLbBetter
45733 #undef SCIPisUbBetter
45734 #undef SCIPisRelEQ
45735 #undef SCIPisRelLT
45736 #undef SCIPisRelLE
45737 #undef SCIPisRelGT
45738 #undef SCIPisRelGE
45739 #undef SCIPisSumRelEQ
45740 #undef SCIPisSumRelLT
45741 #undef SCIPisSumRelLE
45742 #undef SCIPisSumRelGT
45743 #undef SCIPisSumRelGE
45744 #undef SCIPconvertRealToInt
45745 #undef SCIPconvertRealToLongint
45746 #undef SCIPisUpdateUnreliable
45747 #undef SCIPisHugeValue
45748 #undef SCIPgetHugeValue
45749 
45750 /** checks, if values are in range of epsilon */
45752  SCIP* scip, /**< SCIP data structure */
45753  SCIP_Real val1, /**< first value to be compared */
45754  SCIP_Real val2 /**< second value to be compared */
45755  )
45756 {
45757  assert(scip != NULL);
45758  assert(scip->set != NULL);
45759 
45760  return SCIPsetIsEQ(scip->set, val1, val2);
45761 }
45762 
45763 /** checks, if val1 is (more than epsilon) lower than val2 */
45765  SCIP* scip, /**< SCIP data structure */
45766  SCIP_Real val1, /**< first value to be compared */
45767  SCIP_Real val2 /**< second value to be compared */
45768  )
45769 {
45770  assert(scip != NULL);
45771  assert(scip->set != NULL);
45772 
45773  return SCIPsetIsLT(scip->set, val1, val2);
45774 }
45775 
45776 /** checks, if val1 is not (more than epsilon) greater than val2 */
45778  SCIP* scip, /**< SCIP data structure */
45779  SCIP_Real val1, /**< first value to be compared */
45780  SCIP_Real val2 /**< second value to be compared */
45781  )
45782 {
45783  assert(scip != NULL);
45784  assert(scip->set != NULL);
45785 
45786  return SCIPsetIsLE(scip->set, val1, val2);
45787 }
45788 
45789 /** checks, if val1 is (more than epsilon) greater than val2 */
45791  SCIP* scip, /**< SCIP data structure */
45792  SCIP_Real val1, /**< first value to be compared */
45793  SCIP_Real val2 /**< second value to be compared */
45794  )
45795 {
45796  assert(scip != NULL);
45797  assert(scip->set != NULL);
45798 
45799  return SCIPsetIsGT(scip->set, val1, val2);
45800 }
45801 
45802 /** checks, if val1 is not (more than epsilon) lower than val2 */
45804  SCIP* scip, /**< SCIP data structure */
45805  SCIP_Real val1, /**< first value to be compared */
45806  SCIP_Real val2 /**< second value to be compared */
45807  )
45808 {
45809  assert(scip != NULL);
45810  assert(scip->set != NULL);
45811 
45812  return SCIPsetIsGE(scip->set, val1, val2);
45813 }
45814 
45815 /** returns value treated as infinity */
45817  SCIP* scip /**< SCIP data structure */
45818  )
45819 {
45820  assert(scip != NULL);
45821  assert(scip->set != NULL);
45822 
45823  return SCIPsetInfinity(scip->set);
45824 }
45825 
45826 /** checks, if value is (positive) infinite */
45828  SCIP* scip, /**< SCIP data structure */
45829  SCIP_Real val /**< value to be compared against infinity */
45830  )
45831 {
45832  assert(scip != NULL);
45833  assert(scip->set != NULL);
45834 
45835  return SCIPsetIsInfinity(scip->set, val);
45836 }
45837 
45838 /** checks, if value is huge and should be handled separately (e.g., in activity computation) */
45840  SCIP* scip, /**< SCIP data structure */
45841  SCIP_Real val /**< value to be checked whether it is huge */
45842  )
45843 {
45844  assert(scip != NULL);
45845  assert(scip->set != NULL);
45846 
45847  return SCIPsetIsHugeValue(scip->set, val);
45848 }
45849 
45850 /** returns the minimum value that is regarded as huge and should be handled separately (e.g., in activity
45851  * computation)
45852  */
45854  SCIP* scip /**< SCIP data structure */
45855  )
45856 {
45857  assert(scip != NULL);
45858  assert(scip->set != NULL);
45859 
45860  return SCIPsetGetHugeValue(scip->set);
45861 }
45862 
45863 /** checks, if value is in range epsilon of 0.0 */
45865  SCIP* scip, /**< SCIP data structure */
45866  SCIP_Real val /**< value to process */
45867  )
45868 {
45869  assert(scip != NULL);
45870  assert(scip->set != NULL);
45871 
45872  return SCIPsetIsZero(scip->set, val);
45873 }
45874 
45875 /** checks, if value is greater than epsilon */
45877  SCIP* scip, /**< SCIP data structure */
45878  SCIP_Real val /**< value to process */
45879  )
45880 {
45881  assert(scip != NULL);
45882  assert(scip->set != NULL);
45883 
45884  return SCIPsetIsPositive(scip->set, val);
45885 }
45886 
45887 /** checks, if value is lower than -epsilon */
45889  SCIP* scip, /**< SCIP data structure */
45890  SCIP_Real val /**< value to process */
45891  )
45892 {
45893  assert(scip != NULL);
45894  assert(scip->set != NULL);
45895 
45896  return SCIPsetIsNegative(scip->set, val);
45897 }
45898 
45899 /** checks, if value is integral within epsilon */
45901  SCIP* scip, /**< SCIP data structure */
45902  SCIP_Real val /**< value to process */
45903  )
45904 {
45905  assert(scip != NULL);
45906  assert(scip->set != NULL);
45907 
45908  return SCIPsetIsIntegral(scip->set, val);
45909 }
45910 
45911 /** checks whether the product val * scalar is integral in epsilon scaled by scalar */
45913  SCIP* scip, /**< SCIP data structure */
45914  SCIP_Real val, /**< unscaled value to check for scaled integrality */
45915  SCIP_Real scalar /**< value to scale val with for checking for integrality */
45916  )
45917 {
45918  assert(scip != NULL);
45919  assert(scip->set != NULL);
45920 
45921  return SCIPsetIsScalingIntegral(scip->set, val, scalar);
45922 }
45923 
45924 /** checks, if given fractional part is smaller than epsilon */
45926  SCIP* scip, /**< SCIP data structure */
45927  SCIP_Real val /**< value to process */
45928  )
45929 {
45930  assert(scip != NULL);
45931  assert(scip->set != NULL);
45932 
45933  return SCIPsetIsFracIntegral(scip->set, val);
45934 }
45935 
45936 /** rounds value + epsilon down to the next integer */
45938  SCIP* scip, /**< SCIP data structure */
45939  SCIP_Real val /**< value to process */
45940  )
45941 {
45942  assert(scip != NULL);
45943  assert(scip->set != NULL);
45944 
45945  return SCIPsetFloor(scip->set, val);
45946 }
45947 
45948 /** rounds value - epsilon up to the next integer */
45950  SCIP* scip, /**< SCIP data structure */
45951  SCIP_Real val /**< value to process */
45952  )
45953 {
45954  assert(scip != NULL);
45955  assert(scip->set != NULL);
45956 
45957  return SCIPsetCeil(scip->set, val);
45958 }
45959 
45960 /** rounds value to the nearest integer with epsilon tolerance */
45962  SCIP* scip, /**< SCIP data structure */
45963  SCIP_Real val /**< value to process */
45964  )
45965 {
45966  assert(scip != NULL);
45967  assert(scip->set != NULL);
45968 
45969  return SCIPsetRound(scip->set, val);
45970 }
45971 
45972 /** returns fractional part of value, i.e. x - floor(x) in epsilon tolerance */
45974  SCIP* scip, /**< SCIP data structure */
45975  SCIP_Real val /**< value to return fractional part for */
45976  )
45977 {
45978  assert(scip != NULL);
45979  assert(scip->set != NULL);
45980 
45981  return SCIPsetFrac(scip->set, val);
45982 }
45983 
45984 /** checks, if values are in range of sumepsilon */
45986  SCIP* scip, /**< SCIP data structure */
45987  SCIP_Real val1, /**< first value to be compared */
45988  SCIP_Real val2 /**< second value to be compared */
45989  )
45990 {
45991  assert(scip != NULL);
45992  assert(scip->set != NULL);
45993 
45994  return SCIPsetIsSumEQ(scip->set, val1, val2);
45995 }
45996 
45997 /** checks, if val1 is (more than sumepsilon) lower than val2 */
45999  SCIP* scip, /**< SCIP data structure */
46000  SCIP_Real val1, /**< first value to be compared */
46001  SCIP_Real val2 /**< second value to be compared */
46002  )
46003 {
46004  assert(scip != NULL);
46005  assert(scip->set != NULL);
46006 
46007  return SCIPsetIsSumLT(scip->set, val1, val2);
46008 }
46009 
46010 /** checks, if val1 is not (more than sumepsilon) greater than val2 */
46012  SCIP* scip, /**< SCIP data structure */
46013  SCIP_Real val1, /**< first value to be compared */
46014  SCIP_Real val2 /**< second value to be compared */
46015  )
46016 {
46017  assert(scip != NULL);
46018  assert(scip->set != NULL);
46019 
46020  return SCIPsetIsSumLE(scip->set, val1, val2);
46021 }
46022 
46023 /** checks, if val1 is (more than sumepsilon) greater than val2 */
46025  SCIP* scip, /**< SCIP data structure */
46026  SCIP_Real val1, /**< first value to be compared */
46027  SCIP_Real val2 /**< second value to be compared */
46028  )
46029 {
46030  assert(scip != NULL);
46031  assert(scip->set != NULL);
46032 
46033  return SCIPsetIsSumGT(scip->set, val1, val2);
46034 }
46035 
46036 /** checks, if val1 is not (more than sumepsilon) lower than val2 */
46038  SCIP* scip, /**< SCIP data structure */
46039  SCIP_Real val1, /**< first value to be compared */
46040  SCIP_Real val2 /**< second value to be compared */
46041  )
46042 {
46043  assert(scip != NULL);
46044  assert(scip->set != NULL);
46045 
46046  return SCIPsetIsSumGE(scip->set, val1, val2);
46047 }
46048 
46049 /** checks, if value is in range sumepsilon of 0.0 */
46051  SCIP* scip, /**< SCIP data structure */
46052  SCIP_Real val /**< value to process */
46053  )
46054 {
46055  assert(scip != NULL);
46056  assert(scip->set != NULL);
46057 
46058  return SCIPsetIsSumZero(scip->set, val);
46059 }
46060 
46061 /** checks, if value is greater than sumepsilon */
46063  SCIP* scip, /**< SCIP data structure */
46064  SCIP_Real val /**< value to process */
46065  )
46066 {
46067  assert(scip != NULL);
46068  assert(scip->set != NULL);
46069 
46070  return SCIPsetIsSumPositive(scip->set, val);
46071 }
46072 
46073 /** checks, if value is lower than -sumepsilon */
46075  SCIP* scip, /**< SCIP data structure */
46076  SCIP_Real val /**< value to process */
46077  )
46078 {
46079  assert(scip != NULL);
46080  assert(scip->set != NULL);
46081 
46082  return SCIPsetIsSumNegative(scip->set, val);
46083 }
46084 
46085 /** checks, if relative difference of values is in range of feasibility tolerance */
46087  SCIP* scip, /**< SCIP data structure */
46088  SCIP_Real val1, /**< first value to be compared */
46089  SCIP_Real val2 /**< second value to be compared */
46090  )
46091 {
46092  assert(scip != NULL);
46093  assert(scip->set != NULL);
46094 
46095  return SCIPsetIsFeasEQ(scip->set, val1, val2);
46096 }
46097 
46098 /** checks, if relative difference val1 and val2 is lower than feasibility tolerance */
46100  SCIP* scip, /**< SCIP data structure */
46101  SCIP_Real val1, /**< first value to be compared */
46102  SCIP_Real val2 /**< second value to be compared */
46103  )
46104 {
46105  assert(scip != NULL);
46106  assert(scip->set != NULL);
46107 
46108  return SCIPsetIsFeasLT(scip->set, val1, val2);
46109 }
46110 
46111 /** checks, if relative difference of val1 and val2 is not greater than feasibility tolerance */
46113  SCIP* scip, /**< SCIP data structure */
46114  SCIP_Real val1, /**< first value to be compared */
46115  SCIP_Real val2 /**< second value to be compared */
46116  )
46117 {
46118  assert(scip != NULL);
46119  assert(scip->set != NULL);
46120 
46121  return SCIPsetIsFeasLE(scip->set, val1, val2);
46122 }
46123 
46124 /** checks, if relative difference of val1 and val2 is greater than feastol */
46126  SCIP* scip, /**< SCIP data structure */
46127  SCIP_Real val1, /**< first value to be compared */
46128  SCIP_Real val2 /**< second value to be compared */
46129  )
46130 {
46131  assert(scip != NULL);
46132  assert(scip->set != NULL);
46133 
46134  return SCIPsetIsFeasGT(scip->set, val1, val2);
46135 }
46136 
46137 /** checks, if relative difference of val1 and val2 is not lower than -feastol */
46139  SCIP* scip, /**< SCIP data structure */
46140  SCIP_Real val1, /**< first value to be compared */
46141  SCIP_Real val2 /**< second value to be compared */
46142  )
46143 {
46144  assert(scip != NULL);
46145  assert(scip->set != NULL);
46146 
46147  return SCIPsetIsFeasGE(scip->set, val1, val2);
46148 }
46149 
46150 /** checks, if value is in range feasibility tolerance of 0.0 */
46152  SCIP* scip, /**< SCIP data structure */
46153  SCIP_Real val /**< value to process */
46154  )
46155 {
46156  assert(scip != NULL);
46157  assert(scip->set != NULL);
46158 
46159  return SCIPsetIsFeasZero(scip->set, val);
46160 }
46161 
46162 /** checks, if value is greater than feasibility tolerance */
46164  SCIP* scip, /**< SCIP data structure */
46165  SCIP_Real val /**< value to process */
46166  )
46167 {
46168  assert(scip != NULL);
46169  assert(scip->set != NULL);
46170 
46171  return SCIPsetIsFeasPositive(scip->set, val);
46172 }
46173 
46174 /** checks, if value is lower than -feasibility tolerance */
46176  SCIP* scip, /**< SCIP data structure */
46177  SCIP_Real val /**< value to process */
46178  )
46179 {
46180  assert(scip != NULL);
46181  assert(scip->set != NULL);
46182 
46183  return SCIPsetIsFeasNegative(scip->set, val);
46184 }
46185 
46186 /** checks, if value is integral within the LP feasibility bounds */
46188  SCIP* scip, /**< SCIP data structure */
46189  SCIP_Real val /**< value to process */
46190  )
46191 {
46192  assert(scip != NULL);
46193  assert(scip->set != NULL);
46194 
46195  return SCIPsetIsFeasIntegral(scip->set, val);
46196 }
46197 
46198 /** checks, if given fractional part is smaller than feastol */
46200  SCIP* scip, /**< SCIP data structure */
46201  SCIP_Real val /**< value to process */
46202  )
46203 {
46204  assert(scip != NULL);
46205  assert(scip->set != NULL);
46206 
46207  return SCIPsetIsFeasFracIntegral(scip->set, val);
46208 }
46209 
46210 /** rounds value + feasibility tolerance down to the next integer */
46212  SCIP* scip, /**< SCIP data structure */
46213  SCIP_Real val /**< value to process */
46214  )
46215 {
46216  assert(scip != NULL);
46217  assert(scip->set != NULL);
46218 
46219  return SCIPsetFeasFloor(scip->set, val);
46220 }
46221 
46222 /** rounds value - feasibility tolerance up to the next integer */
46224  SCIP* scip, /**< SCIP data structure */
46225  SCIP_Real val /**< value to process */
46226  )
46227 {
46228  assert(scip != NULL);
46229  assert(scip->set != NULL);
46230 
46231  return SCIPsetFeasCeil(scip->set, val);
46232 }
46233 
46234 /** rounds value to the nearest integer in feasibility tolerance */
46236  SCIP* scip, /**< SCIP data structure */
46237  SCIP_Real val /**< value to process */
46238  )
46239 {
46240  assert(scip != NULL);
46241  assert(scip->set != NULL);
46242 
46243  return SCIPsetFeasRound(scip->set, val);
46244 }
46245 
46246 /** returns fractional part of value, i.e. x - floor(x) in feasibility tolerance */
46248  SCIP* scip, /**< SCIP data structure */
46249  SCIP_Real val /**< value to process */
46250  )
46251 {
46252  assert(scip != NULL);
46253  assert(scip->set != NULL);
46254 
46255  return SCIPsetFeasFrac(scip->set, val);
46256 }
46257 
46258 /** checks, if relative difference of values is in range of dual feasibility tolerance */
46260  SCIP* scip, /**< SCIP data structure */
46261  SCIP_Real val1, /**< first value to be compared */
46262  SCIP_Real val2 /**< second value to be compared */
46263  )
46264 {
46265  assert(scip != NULL);
46266  assert(scip->set != NULL);
46267 
46268  return SCIPsetIsDualfeasEQ(scip->set, val1, val2);
46269 }
46270 
46271 /** checks, if relative difference val1 and val2 is lower than dual feasibility tolerance */
46273  SCIP* scip, /**< SCIP data structure */
46274  SCIP_Real val1, /**< first value to be compared */
46275  SCIP_Real val2 /**< second value to be compared */
46276  )
46277 {
46278  assert(scip != NULL);
46279  assert(scip->set != NULL);
46280 
46281  return SCIPsetIsDualfeasLT(scip->set, val1, val2);
46282 }
46283 
46284 /** checks, if relative difference of val1 and val2 is not greater than dual feasibility tolerance */
46286  SCIP* scip, /**< SCIP data structure */
46287  SCIP_Real val1, /**< first value to be compared */
46288  SCIP_Real val2 /**< second value to be compared */
46289  )
46290 {
46291  assert(scip != NULL);
46292  assert(scip->set != NULL);
46293 
46294  return SCIPsetIsDualfeasLE(scip->set, val1, val2);
46295 }
46296 
46297 /** checks, if relative difference of val1 and val2 is greater than dual feasibility tolerance */
46299  SCIP* scip, /**< SCIP data structure */
46300  SCIP_Real val1, /**< first value to be compared */
46301  SCIP_Real val2 /**< second value to be compared */
46302  )
46303 {
46304  assert(scip != NULL);
46305  assert(scip->set != NULL);
46306 
46307  return SCIPsetIsDualfeasGT(scip->set, val1, val2);
46308 }
46309 
46310 /** checks, if relative difference of val1 and val2 is not lower than -dual feasibility tolerance */
46312  SCIP* scip, /**< SCIP data structure */
46313  SCIP_Real val1, /**< first value to be compared */
46314  SCIP_Real val2 /**< second value to be compared */
46315  )
46316 {
46317  assert(scip != NULL);
46318  assert(scip->set != NULL);
46319 
46320  return SCIPsetIsDualfeasGE(scip->set, val1, val2);
46321 }
46322 
46323 /** checks, if value is in range dual feasibility tolerance of 0.0 */
46325  SCIP* scip, /**< SCIP data structure */
46326  SCIP_Real val /**< value to process */
46327  )
46328 {
46329  assert(scip != NULL);
46330  assert(scip->set != NULL);
46331 
46332  return SCIPsetIsDualfeasZero(scip->set, val);
46333 }
46334 
46335 /** checks, if value is greater than dual feasibility tolerance */
46337  SCIP* scip, /**< SCIP data structure */
46338  SCIP_Real val /**< value to process */
46339  )
46340 {
46341  assert(scip != NULL);
46342  assert(scip->set != NULL);
46343 
46344  return SCIPsetIsDualfeasPositive(scip->set, val);
46345 }
46346 
46347 /** checks, if value is lower than -dual feasibility tolerance */
46349  SCIP* scip, /**< SCIP data structure */
46350  SCIP_Real val /**< value to process */
46351  )
46352 {
46353  assert(scip != NULL);
46354  assert(scip->set != NULL);
46355 
46356  return SCIPsetIsDualfeasNegative(scip->set, val);
46357 }
46358 
46359 /** checks, if value is integral within the LP dual feasibility tolerance */
46361  SCIP* scip, /**< SCIP data structure */
46362  SCIP_Real val /**< value to process */
46363  )
46364 {
46365  assert(scip != NULL);
46366  assert(scip->set != NULL);
46367 
46368  return SCIPsetIsDualfeasIntegral(scip->set, val);
46369 }
46370 
46371 /** checks, if given fractional part is smaller than dual feasibility tolerance */
46373  SCIP* scip, /**< SCIP data structure */
46374  SCIP_Real val /**< value to process */
46375  )
46376 {
46377  assert(scip != NULL);
46378  assert(scip->set != NULL);
46379 
46380  return SCIPsetIsDualfeasFracIntegral(scip->set, val);
46381 }
46382 
46383 /** rounds value + dual feasibility tolerance down to the next integer */
46385  SCIP* scip, /**< SCIP data structure */
46386  SCIP_Real val /**< value to process */
46387  )
46388 {
46389  assert(scip != NULL);
46390  assert(scip->set != NULL);
46391 
46392  return SCIPsetDualfeasFloor(scip->set, val);
46393 }
46394 
46395 /** rounds value - dual feasibility tolerance up to the next integer */
46397  SCIP* scip, /**< SCIP data structure */
46398  SCIP_Real val /**< value to process */
46399  )
46400 {
46401  assert(scip != NULL);
46402  assert(scip->set != NULL);
46403 
46404  return SCIPsetDualfeasCeil(scip->set, val);
46405 }
46406 
46407 /** rounds value to the nearest integer in dual feasibility tolerance */
46409  SCIP* scip, /**< SCIP data structure */
46410  SCIP_Real val /**< value to process */
46411  )
46412 {
46413  assert(scip != NULL);
46414  assert(scip->set != NULL);
46415 
46416  return SCIPsetDualfeasRound(scip->set, val);
46417 }
46418 
46419 /** returns fractional part of value, i.e. x - floor(x) in dual feasibility tolerance */
46421  SCIP* scip, /**< SCIP data structure */
46422  SCIP_Real val /**< value to process */
46423  )
46424 {
46425  assert(scip != NULL);
46426  assert(scip->set != NULL);
46427 
46428  return SCIPsetDualfeasFrac(scip->set, val);
46429 }
46430 
46431 /** checks, if the given new lower bound is at least min(oldub - oldlb, |oldlb|) times the bound
46432  * strengthening epsilon better than the old one
46433  */
46435  SCIP* scip, /**< SCIP data structure */
46436  SCIP_Real newlb, /**< new lower bound */
46437  SCIP_Real oldlb, /**< old lower bound */
46438  SCIP_Real oldub /**< old upper bound */
46439  )
46440 {
46441  assert(scip != NULL);
46442 
46443  return SCIPsetIsLbBetter(scip->set, newlb, oldlb, oldub);
46444 }
46445 
46446 /** checks, if the given new upper bound is at least min(oldub - oldlb, |oldub|) times the bound
46447  * strengthening epsilon better than the old one
46448  */
46450  SCIP* scip, /**< SCIP data structure */
46451  SCIP_Real newub, /**< new upper bound */
46452  SCIP_Real oldlb, /**< old lower bound */
46453  SCIP_Real oldub /**< old upper bound */
46454  )
46455 {
46456  assert(scip != NULL);
46457 
46458  return SCIPsetIsUbBetter(scip->set, newub, oldlb, oldub);
46459 }
46460 
46461 /** checks, if relative difference of values is in range of epsilon */
46463  SCIP* scip, /**< SCIP data structure */
46464  SCIP_Real val1, /**< first value to be compared */
46465  SCIP_Real val2 /**< second value to be compared */
46466  )
46467 {
46468  assert(scip != NULL);
46469  assert(scip->set != NULL);
46470 
46471  return SCIPsetIsRelEQ(scip->set, val1, val2);
46472 }
46473 
46474 /** checks, if relative difference of val1 and val2 is lower than epsilon */
46476  SCIP* scip, /**< SCIP data structure */
46477  SCIP_Real val1, /**< first value to be compared */
46478  SCIP_Real val2 /**< second value to be compared */
46479  )
46480 {
46481  assert(scip != NULL);
46482  assert(scip->set != NULL);
46483 
46484  return SCIPsetIsRelLT(scip->set, val1, val2);
46485 }
46486 
46487 /** checks, if relative difference of val1 and val2 is not greater than epsilon */
46489  SCIP* scip, /**< SCIP data structure */
46490  SCIP_Real val1, /**< first value to be compared */
46491  SCIP_Real val2 /**< second value to be compared */
46492  )
46493 {
46494  assert(scip != NULL);
46495  assert(scip->set != NULL);
46496 
46497  return SCIPsetIsRelLE(scip->set, val1, val2);
46498 }
46499 
46500 /** checks, if relative difference of val1 and val2 is greater than epsilon */
46502  SCIP* scip, /**< SCIP data structure */
46503  SCIP_Real val1, /**< first value to be compared */
46504  SCIP_Real val2 /**< second value to be compared */
46505  )
46506 {
46507  assert(scip != NULL);
46508  assert(scip->set != NULL);
46509 
46510  return SCIPsetIsRelGT(scip->set, val1, val2);
46511 }
46512 
46513 /** checks, if relative difference of val1 and val2 is not lower than -epsilon */
46515  SCIP* scip, /**< SCIP data structure */
46516  SCIP_Real val1, /**< first value to be compared */
46517  SCIP_Real val2 /**< second value to be compared */
46518  )
46519 {
46520  assert(scip != NULL);
46521  assert(scip->set != NULL);
46522 
46523  return SCIPsetIsRelGE(scip->set, val1, val2);
46524 }
46525 
46526 /** checks, if relative difference of values is in range of sumepsilon */
46528  SCIP* scip, /**< SCIP data structure */
46529  SCIP_Real val1, /**< first value to be compared */
46530  SCIP_Real val2 /**< second value to be compared */
46531  )
46532 {
46533  assert(scip != NULL);
46534  assert(scip->set != NULL);
46535 
46536  return SCIPsetIsSumRelEQ(scip->set, val1, val2);
46537 }
46538 
46539 /** checks, if relative difference of val1 and val2 is lower than sumepsilon */
46541  SCIP* scip, /**< SCIP data structure */
46542  SCIP_Real val1, /**< first value to be compared */
46543  SCIP_Real val2 /**< second value to be compared */
46544  )
46545 {
46546  assert(scip != NULL);
46547  assert(scip->set != NULL);
46548 
46549  return SCIPsetIsSumRelLT(scip->set, val1, val2);
46550 }
46551 
46552 /** checks, if relative difference of val1 and val2 is not greater than sumepsilon */
46554  SCIP* scip, /**< SCIP data structure */
46555  SCIP_Real val1, /**< first value to be compared */
46556  SCIP_Real val2 /**< second value to be compared */
46557  )
46558 {
46559  assert(scip != NULL);
46560  assert(scip->set != NULL);
46561 
46562  return SCIPsetIsSumRelLE(scip->set, val1, val2);
46563 }
46564 
46565 /** checks, if relative difference of val1 and val2 is greater than sumepsilon */
46567  SCIP* scip, /**< SCIP data structure */
46568  SCIP_Real val1, /**< first value to be compared */
46569  SCIP_Real val2 /**< second value to be compared */
46570  )
46571 {
46572  assert(scip != NULL);
46573  assert(scip->set != NULL);
46574 
46575  return SCIPsetIsSumRelGT(scip->set, val1, val2);
46576 }
46577 
46578 /** checks, if relative difference of val1 and val2 is not lower than -sumepsilon */
46580  SCIP* scip, /**< SCIP data structure */
46581  SCIP_Real val1, /**< first value to be compared */
46582  SCIP_Real val2 /**< second value to be compared */
46583  )
46584 {
46585  assert(scip != NULL);
46586  assert(scip->set != NULL);
46587 
46588  return SCIPsetIsSumRelGE(scip->set, val1, val2);
46589 }
46590 
46591 /** converts the given real number representing an integer to an int; in optimized mode the function gets inlined for
46592  * performance; in debug mode we check some additional conditions
46593  */
46595  SCIP* scip, /**< SCIP data structure */
46596  SCIP_Real real /**< double bound to convert */
46597  )
46598 {
46599  assert(SCIPisFeasIntegral(scip, real));
46600  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(int)(real < 0 ? real - 0.5 : real + 0.5)));
46601  assert(real < INT_MAX);
46602  assert(real > INT_MIN);
46603 
46604  return (int)(real < 0 ? (real - 0.5) : (real + 0.5));
46605 }
46606 
46607 /** converts the given real number representing an integer to a long integer; in optimized mode the function gets inlined for
46608  * performance; in debug mode we check some additional conditions
46609  */
46611  SCIP* scip, /**< SCIP data structure */
46612  SCIP_Real real /**< double bound to convert */
46613  )
46614 {
46615  assert(SCIPisFeasIntegral(scip, real));
46616  assert(SCIPisFeasEQ(scip, real, (SCIP_Real)(SCIP_Longint)(real < 0 ? real - 0.5 : real + 0.5)));
46617  assert(real < SCIP_LONGINT_MAX);
46618  assert(real > SCIP_LONGINT_MIN);
46619 
46620  return (SCIP_Longint)(real < 0 ? (real - 0.5) : (real + 0.5));
46621 }
46622 
46623 /** Checks, if an iteratively updated value is reliable or should be recomputed from scratch.
46624  * This is useful, if the value, e.g., the activity of a linear constraint or the pseudo objective value, gets a high
46625  * absolute value during the optimization process which is later reduced significantly. In this case, the last digits
46626  * were canceled out when increasing the value and are random after decreasing it.
46627  * We do not consider the cancellations which can occur during increasing the absolute value because they just cannot
46628  * be expressed using fixed precision floating point arithmetic, anymore.
46629  * In order to get more reliable values, the idea is to always store the last reliable value, where increasing the
46630  * absolute of the value is viewed as preserving reliability. Then, after each update, the new absolute value can be
46631  * compared against the last reliable one with this method, checking whether it was decreased by a factor of at least
46632  * "lp/recompfac" and should be recomputed.
46633  */
46635  SCIP* scip, /**< SCIP data structure */
46636  SCIP_Real newvalue, /**< new value after update */
46637  SCIP_Real oldvalue /**< old value, i.e., last reliable value */
46638  )
46639 {
46640  assert(scip != NULL);
46641 
46642  SCIP_CALL_ABORT( checkStage(scip, "SCIPisUpdateUnreliable", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
46643 
46644  return SCIPsetIsUpdateUnreliable(scip->set, newvalue, oldvalue);
46645 }
46646 
46647 /** creates a dynamic array of real values
46648  *
46649  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46650  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46651  */
46653  SCIP* scip, /**< SCIP data structure */
46654  SCIP_REALARRAY** realarray /**< pointer to store the real array */
46655  )
46656 {
46657  assert(scip != NULL);
46658 
46659  SCIP_CALL( SCIPrealarrayCreate(realarray, SCIPblkmem(scip)) );
46660 
46661  return SCIP_OKAY;
46662 }
46663 
46664 /** frees a dynamic array of real values
46665  *
46666  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46667  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46668  */
46670  SCIP* scip, /**< SCIP data structure */
46671  SCIP_REALARRAY** realarray /**< pointer to the real array */
46672  )
46673 {
46674  assert(scip != NULL);
46675 
46676  SCIP_CALL( SCIPrealarrayFree(realarray) );
46677 
46678  return SCIP_OKAY;
46679 }
46680 
46681 /** extends dynamic array to be able to store indices from minidx to maxidx
46682  *
46683  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46684  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46685  */
46687  SCIP* scip, /**< SCIP data structure */
46688  SCIP_REALARRAY* realarray, /**< dynamic real array */
46689  int minidx, /**< smallest index to allocate storage for */
46690  int maxidx /**< largest index to allocate storage for */
46691  )
46692 {
46693  assert(scip != NULL);
46694 
46695  SCIP_CALL( SCIPrealarrayExtend(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
46696 
46697  return SCIP_OKAY;
46698 }
46699 
46700 /** clears a dynamic real array
46701  *
46702  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46703  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46704  */
46706  SCIP* scip, /**< SCIP data structure */
46707  SCIP_REALARRAY* realarray /**< dynamic real array */
46708  )
46709 {
46710  assert(scip != NULL);
46711 
46712  SCIP_CALL( SCIPrealarrayClear(realarray) );
46713 
46714  return SCIP_OKAY;
46715 }
46716 
46717 /** gets value of entry in dynamic array
46718  *
46719  * @return value of entry in dynamic array
46720  */
46722  SCIP* scip, /**< SCIP data structure */
46723  SCIP_REALARRAY* realarray, /**< dynamic real array */
46724  int idx /**< array index to get value for */
46725  )
46726 {
46727  assert(scip != NULL);
46728 
46729  return SCIPrealarrayGetVal(realarray, idx);
46730 }
46731 
46732 /** sets value of entry in dynamic array
46733  *
46734  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46735  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46736  */
46738  SCIP* scip, /**< SCIP data structure */
46739  SCIP_REALARRAY* realarray, /**< dynamic real array */
46740  int idx, /**< array index to set value for */
46741  SCIP_Real val /**< value to set array index to */
46742  )
46743 {
46744  assert(scip != NULL);
46745 
46746  SCIP_CALL( SCIPrealarraySetVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
46747 
46748  return SCIP_OKAY;
46749 }
46750 
46751 /** increases value of entry in dynamic array
46752  *
46753  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46754  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46755  */
46757  SCIP* scip, /**< SCIP data structure */
46758  SCIP_REALARRAY* realarray, /**< dynamic real array */
46759  int idx, /**< array index to increase value for */
46760  SCIP_Real incval /**< value to increase array index */
46761  )
46762 {
46763  assert(scip != NULL);
46764 
46765  SCIP_CALL( SCIPrealarrayIncVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
46766 
46767  return SCIP_OKAY;
46768 }
46769 
46770 /** returns the minimal index of all stored non-zero elements
46771  *
46772  * @return the minimal index of all stored non-zero elements
46773  */
46775  SCIP* scip, /**< SCIP data structure */
46776  SCIP_REALARRAY* realarray /**< dynamic real array */
46777  )
46778 {
46779  assert(scip != NULL);
46780 
46781  return SCIPrealarrayGetMinIdx(realarray);
46782 }
46783 
46784 /** returns the maximal index of all stored non-zero elements
46785  *
46786  * @return the maximal index of all stored non-zero elements
46787  */
46789  SCIP* scip, /**< SCIP data structure */
46790  SCIP_REALARRAY* realarray /**< dynamic real array */
46791  )
46792 {
46793  assert(scip != NULL);
46794 
46795  return SCIPrealarrayGetMaxIdx(realarray);
46796 }
46797 
46798 /** creates a dynamic array of int values
46799  *
46800  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46801  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46802  */
46804  SCIP* scip, /**< SCIP data structure */
46805  SCIP_INTARRAY** intarray /**< pointer to store the int array */
46806  )
46807 {
46808  assert(scip != NULL);
46809 
46810  SCIP_CALL( SCIPintarrayCreate(intarray, SCIPblkmem(scip)) );
46811 
46812  return SCIP_OKAY;
46813 }
46814 
46815 /** frees a dynamic array of int values
46816  *
46817  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46818  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46819  */
46821  SCIP* scip, /**< SCIP data structure */
46822  SCIP_INTARRAY** intarray /**< pointer to the int array */
46823  )
46824 {
46825  assert(scip != NULL);
46826 
46827  SCIP_CALL( SCIPintarrayFree(intarray) );
46828 
46829  return SCIP_OKAY;
46830 }
46831 
46832 /** extends dynamic array to be able to store indices from minidx to maxidx
46833  *
46834  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46835  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46836  */
46838  SCIP* scip, /**< SCIP data structure */
46839  SCIP_INTARRAY* intarray, /**< dynamic int array */
46840  int minidx, /**< smallest index to allocate storage for */
46841  int maxidx /**< largest index to allocate storage for */
46842  )
46843 {
46844  assert(scip != NULL);
46845 
46846  SCIP_CALL( SCIPintarrayExtend(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
46847 
46848  return SCIP_OKAY;
46849 }
46850 
46851 /** clears a dynamic int array
46852  *
46853  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46854  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46855  */
46857  SCIP* scip, /**< SCIP data structure */
46858  SCIP_INTARRAY* intarray /**< dynamic int array */
46859  )
46860 {
46861  assert(scip != NULL);
46862 
46863  SCIP_CALL( SCIPintarrayClear(intarray) );
46864 
46865  return SCIP_OKAY;
46866 }
46867 
46868 /** gets value of entry in dynamic array
46869  *
46870  * @return value of entry in dynamic array
46871  */
46873  SCIP* scip, /**< SCIP data structure */
46874  SCIP_INTARRAY* intarray, /**< dynamic int array */
46875  int idx /**< array index to get value for */
46876  )
46877 {
46878  assert(scip != NULL);
46879 
46880  return SCIPintarrayGetVal(intarray, idx);
46881 }
46882 
46883 /** sets value of entry in dynamic array
46884  *
46885  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46886  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46887  */
46889  SCIP* scip, /**< SCIP data structure */
46890  SCIP_INTARRAY* intarray, /**< dynamic int array */
46891  int idx, /**< array index to set value for */
46892  int val /**< value to set array index to */
46893  )
46894 {
46895  assert(scip != NULL);
46896 
46897  SCIP_CALL( SCIPintarraySetVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
46898 
46899  return SCIP_OKAY;
46900 }
46901 
46902 /** increases value of entry in dynamic array
46903  *
46904  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46905  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46906  */
46908  SCIP* scip, /**< SCIP data structure */
46909  SCIP_INTARRAY* intarray, /**< dynamic int array */
46910  int idx, /**< array index to increase value for */
46911  int incval /**< value to increase array index */
46912  )
46913 {
46914  assert(scip != NULL);
46915 
46916  SCIP_CALL( SCIPintarrayIncVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
46917 
46918  return SCIP_OKAY;
46919 }
46920 
46921 /** returns the minimal index of all stored non-zero elements
46922  *
46923  * @return the minimal index of all stored non-zero elements
46924  */
46926  SCIP* scip, /**< SCIP data structure */
46927  SCIP_INTARRAY* intarray /**< dynamic int array */
46928  )
46929 {
46930  assert(scip != NULL);
46931 
46932  return SCIPintarrayGetMinIdx(intarray);
46933 }
46934 
46935 /** returns the maximal index of all stored non-zero elements
46936  *
46937  * @return the maximal index of all stored non-zero elements
46938  */
46940  SCIP* scip, /**< SCIP data structure */
46941  SCIP_INTARRAY* intarray /**< dynamic int array */
46942  )
46943 {
46944  assert(scip != NULL);
46945 
46946  return SCIPintarrayGetMaxIdx(intarray);
46947 }
46948 
46949 /** creates a dynamic array of bool values
46950  *
46951  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46952  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46953  */
46955  SCIP* scip, /**< SCIP data structure */
46956  SCIP_BOOLARRAY** boolarray /**< pointer to store the bool array */
46957  )
46958 {
46959  assert(scip != NULL);
46960 
46961  SCIP_CALL( SCIPboolarrayCreate(boolarray, SCIPblkmem(scip)) );
46962 
46963  return SCIP_OKAY;
46964 }
46965 
46966 /** frees a dynamic array of bool values
46967  *
46968  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46969  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46970  */
46972  SCIP* scip, /**< SCIP data structure */
46973  SCIP_BOOLARRAY** boolarray /**< pointer to the bool array */
46974  )
46975 {
46976  assert(scip != NULL);
46977 
46978  SCIP_CALL( SCIPboolarrayFree(boolarray) );
46979 
46980  return SCIP_OKAY;
46981 }
46982 
46983 /** extends dynamic array to be able to store indices from minidx to maxidx
46984  *
46985  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
46986  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
46987  */
46989  SCIP* scip, /**< SCIP data structure */
46990  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
46991  int minidx, /**< smallest index to allocate storage for */
46992  int maxidx /**< largest index to allocate storage for */
46993  )
46994 {
46995  assert(scip != NULL);
46996 
46997  SCIP_CALL( SCIPboolarrayExtend(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
46998 
46999  return SCIP_OKAY;
47000 }
47001 
47002 /** clears a dynamic bool array
47003  *
47004  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47005  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47006  */
47008  SCIP* scip, /**< SCIP data structure */
47009  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
47010  )
47011 {
47012  assert(scip != NULL);
47013 
47014  SCIP_CALL( SCIPboolarrayClear(boolarray) );
47015 
47016  return SCIP_OKAY;
47017 }
47018 
47019 /** gets value of entry in dynamic array
47020  *
47021  * @return value of entry in dynamic array at position idx
47022  */
47024  SCIP* scip, /**< SCIP data structure */
47025  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
47026  int idx /**< array index to get value for */
47027  )
47028 {
47029  assert(scip != NULL);
47030 
47031  return SCIPboolarrayGetVal(boolarray, idx);
47032 }
47033 
47034 /** sets value of entry in dynamic array
47035  *
47036  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47037  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47038  */
47040  SCIP* scip, /**< SCIP data structure */
47041  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
47042  int idx, /**< array index to set value for */
47043  SCIP_Bool val /**< value to set array index to */
47044  )
47045 {
47046  assert(scip != NULL);
47047 
47048  SCIP_CALL( SCIPboolarraySetVal(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
47049 
47050  return SCIP_OKAY;
47051 }
47052 
47053 /** returns the minimal index of all stored non-zero elements
47054  *
47055  * @return the minimal index of all stored non-zero elements
47056  */
47058  SCIP* scip, /**< SCIP data structure */
47059  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
47060  )
47061 {
47062  assert(scip != NULL);
47063 
47064  return SCIPboolarrayGetMinIdx(boolarray);
47065 }
47066 
47067 /** returns the maximal index of all stored non-zero elements
47068  *
47069  * @return the maximal index of all stored non-zero elements
47070  */
47072  SCIP* scip, /**< SCIP data structure */
47073  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
47074  )
47075 {
47076  assert(scip != NULL);
47077 
47078  return SCIPboolarrayGetMaxIdx(boolarray);
47079 }
47080 
47081 /** creates a dynamic array of pointers
47082  *
47083  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47084  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47085  */
47087  SCIP* scip, /**< SCIP data structure */
47088  SCIP_PTRARRAY** ptrarray /**< pointer to store the int array */
47089  )
47090 {
47091  assert(scip != NULL);
47092 
47093  SCIP_CALL( SCIPptrarrayCreate(ptrarray, SCIPblkmem(scip)) );
47094 
47095  return SCIP_OKAY;
47096 }
47097 
47098 /** frees a dynamic array of pointers
47099  *
47100  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47101  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47102  */
47104  SCIP* scip, /**< SCIP data structure */
47105  SCIP_PTRARRAY** ptrarray /**< pointer to the int array */
47106  )
47107 {
47108  assert(scip != NULL);
47109 
47110  SCIP_CALL( SCIPptrarrayFree(ptrarray) );
47111 
47112  return SCIP_OKAY;
47113 }
47114 
47115 /** extends dynamic array to be able to store indices from minidx to maxidx
47116  *
47117  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47118  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47119  */
47121  SCIP* scip, /**< SCIP data structure */
47122  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
47123  int minidx, /**< smallest index to allocate storage for */
47124  int maxidx /**< largest index to allocate storage for */
47125  )
47126 {
47127  assert(scip != NULL);
47128 
47129  SCIP_CALL( SCIPptrarrayExtend(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
47130 
47131  return SCIP_OKAY;
47132 }
47133 
47134 /** clears a dynamic pointer array
47135  *
47136  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47137  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47138  */
47140  SCIP* scip, /**< SCIP data structure */
47141  SCIP_PTRARRAY* ptrarray /**< dynamic int array */
47142  )
47143 {
47144  assert(scip != NULL);
47145 
47146  SCIP_CALL( SCIPptrarrayClear(ptrarray) );
47147 
47148  return SCIP_OKAY;
47149 }
47150 
47151 /** gets value of entry in dynamic array */
47153  SCIP* scip, /**< SCIP data structure */
47154  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
47155  int idx /**< array index to get value for */
47156  )
47157 {
47158  assert(scip != NULL);
47159 
47160  return SCIPptrarrayGetVal(ptrarray, idx);
47161 }
47162 
47163 /** sets value of entry in dynamic array
47164  *
47165  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
47166  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
47167  */
47169  SCIP* scip, /**< SCIP data structure */
47170  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
47171  int idx, /**< array index to set value for */
47172  void* val /**< value to set array index to */
47173  )
47174 {
47175  assert(scip != NULL);
47176 
47177  SCIP_CALL( SCIPptrarraySetVal(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
47178 
47179  return SCIP_OKAY;
47180 }
47181 
47182 /** returns the minimal index of all stored non-zero elements
47183  *
47184  * @return the minimal index of all stored non-zero elements
47185  */
47187  SCIP* scip, /**< SCIP data structure */
47188  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
47189  )
47190 {
47191  assert(scip != NULL);
47192 
47193  return SCIPptrarrayGetMinIdx(ptrarray);
47194 }
47195 
47196 /** returns the maximal index of all stored non-zero elements
47197  *
47198  * @return the maximal index of all stored non-zero elements
47199  */
47201  SCIP* scip, /**< SCIP data structure */
47202  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
47203  )
47204 {
47205  assert(scip != NULL);
47206 
47207  return SCIPptrarrayGetMaxIdx(ptrarray);
47208 }
int nconcsolvertypes
Definition: struct_set.h:124
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:28488
SCIP_RETCODE SCIPaddLinearCoefsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:32016
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:8103
void SCIPsepaSetFree(SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: sepa.c:577
SCIP_RETCODE SCIPsetInitprePlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4866
SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
Definition: sol.c:2299
SCIP_RETCODE SCIPclearConflictStore(SCIP *scip, SCIP_EVENT *event)
Definition: scip.c:12923
SCIP_RETCODE SCIPsetNodeselCopy(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: scip.c:8776
SCIP_Real SCIPdualfeasRound(SCIP *scip, SCIP_Real val)
Definition: scip.c:46408
SCIP_RETCODE SCIPcreatePartialSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37182
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: scip.c:8124
SCIP_RETCODE SCIPsetIncludePresol(SCIP_SET *set, SCIP_PRESOL *presol)
Definition: set.c:3725
SCIP_RETCODE SCIPnlpSetRealPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: nlp.c:6064
SCIP_RETCODE SCIPsetPropPresol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPPRESOL((*proppresol)), int presolpriority, int presolmaxrounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip.c:7738
SCIP_RETCODE SCIPprintReoptStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44535
SCIP_Longint nlexduallps
Definition: struct_stat.h:176
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:38997
SCIP_Real SCIPsetFeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6109
SCIP_RETCODE SCIPtreeClear(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:4779
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
Definition: scip.c:36128
internal methods for separators
SCIP_Bool SCIPsetIsUpdateUnreliable(SCIP_SET *set, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: set.c:6637
SCIP_RETCODE SCIPsetExitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_Bool restart)
Definition: set.c:5014
SCIP_Longint nprimallps
Definition: struct_stat.h:172
SCIP_Longint SCIPconflictGetNStrongbranchSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:7815
SCIP_RETCODE SCIPsetPricerPriority(SCIP *scip, SCIP_PRICER *pricer, int priority)
Definition: scip.c:5666
SCIP_RETCODE SCIPconsSetChecked(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool check)
Definition: cons.c:6473
int SCIPrealarrayGetMaxIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:3545
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:30360
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:6854
void SCIPsetSortPropsName(SCIP_SET *set)
Definition: set.c:4023
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:42796
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:6833
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:29200
void SCIPnodeselSetFree(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: nodesel.c:1095
SCIP_RETCODE SCIPeventfilterCreate(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem)
Definition: event.c:1693
int ndisps
Definition: struct_set.h:118
SCIP_RETCODE SCIPclearCuts(SCIP *scip)
Definition: scip.c:34404
SCIP_RETCODE SCIPsetSetEmphasis(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: set.c:3274
int SCIPgetNIntVars(SCIP *scip)
Definition: scip.c:11721
SCIP_Real SCIPgetFirstPrimalBound(SCIP *scip)
Definition: scip.c:42426
SCIP_Longint ndualresolvelpiterations
Definition: struct_stat.h:61
SCIP_RETCODE SCIPcutsCalcStrongCG(SCIP *scip, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, int *inds, int ninds, SCIP_Real scale, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: cuts.c:3176
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:29924
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:46151
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:30111
SCIP_RETCODE SCIPtreeAddDiveBoundChange(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: tree.c:6145
SCIP_PARAM ** SCIPgetParams(SCIP *scip)
Definition: scip.c:5115
void SCIPcolMarkNotRemovableLocal(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4597
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
Definition: scip.c:4464
int SCIPgetNPrioPseudoBranchBins(SCIP *scip)
Definition: scip.c:36529
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:27934
void SCIPeventhdlrSetInit(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: event.c:331
int SCIPbranchcandGetNPrioExternBins(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:496
void SCIPconflicthdlrSetInit(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINIT((*conflictinit)))
Definition: conflict.c:670
int SCIPgetFocusDepth(SCIP *scip)
Definition: scip.c:42120
SCIP_Real SCIProwGetSolFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6328
static SCIP_RETCODE compressReoptTree(SCIP *scip)
Definition: scip.c:15454
SCIP_RETCODE SCIPsetRelaxCopy(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: scip.c:7122
int SCIPgetNCheckConss(SCIP *scip)
Definition: scip.c:12821
SCIP_Real sbup
Definition: struct_lp.h:143
SCIP_NODE ** SCIPnodepqNodes(const SCIP_NODEPQ *nodepq)
Definition: nodesel.c:540
static SCIP_RETCODE freeTransform(SCIP *scip)
Definition: scip.c:15176
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:4884
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
Definition: scip.c:27905
void SCIPlpInvalidateRootObjval(SCIP_LP *lp)
Definition: lp.c:12540
SCIP_RETCODE SCIPrandomCreate(SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
Definition: misc.c:8693
SCIP_Longint SCIPconflictGetNLocalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:2527
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:4553
SCIP_RETCODE SCIPreoptApplyGlbConss(SCIP *scip, SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem)
Definition: reopt.c:7544
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:604
SCIP_Real SCIPvarGetAvgConflictlengthCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:14706
void SCIPheurSetInitsol(SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: heur.c:1159
SCIP_RETCODE SCIPflattenVarAggregationGraph(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:18829
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:4274
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:986
SCIP_RETCODE SCIPgetCharParam(SCIP *scip, const char *name, char *value)
Definition: scip.c:4445
SCIP_Bool SCIPinRepropagation(SCIP *scip)
Definition: scip.c:40508
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: scip.c:6228
#define SCIP_DECL_NODESELCOMP(x)
Definition: type_nodesel.h:126
SCIP_Longint nsbdivinglps
Definition: struct_stat.h:186
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:1231
int npresoladdconss
Definition: struct_stat.h:227
int SCIPgetNNLPNlRows(SCIP *scip)
Definition: scip.c:31064
SCIP_Real SCIPreoptGetSimToPrevious(SCIP_REOPT *reopt)
Definition: reopt.c:5549
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29309
SCIP_RETCODE SCIPchgVarLbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21877
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:5522
SCIP_RETCODE SCIPsolRound(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool *success)
Definition: sol.c:1701
SCIP_RETCODE SCIPprimalClear(SCIP_PRIMAL **primal, BMS_BLKMEM *blkmem)
Definition: primal.c:189
SCIP_Bool SCIPsetIsSumGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5825
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:6175
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37672
int SCIPpresolGetNDelConss(SCIP_PRESOL *presol)
Definition: presol.c:721
void SCIPrelaxationUpdateVarObj(SCIP_RELAXATION *relaxation, SCIP_SET *set, SCIP_VAR *var, SCIP_Real oldobj, SCIP_Real newobj)
Definition: relax.c:748
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip.c:45137
SCIP_Longint SCIPgetNRootLPIterations(SCIP *scip)
Definition: scip.c:41426
SCIP_RETCODE SCIPsolCreatePartial(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_HEUR *heur)
Definition: sol.c:674
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:37
#define SCIP_DECL_HEURINITSOL(x)
Definition: type_heur.h:95
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:7220
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
SCIP_Real firstlpdualbound
Definition: struct_stat.h:115
SCIP_RETCODE SCIPgetNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *pseudoactivity)
Definition: scip.c:32407
SCIP_Real SCIPgetAvgPseudocostScoreCurrentRun(SCIP *scip)
Definition: scip.c:42889
SCIP_RETCODE SCIPdisableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28074
SCIP_Bool SCIPmessagehdlrIsQuiet(SCIP_MESSAGEHDLR *messagehdlr)
Definition: message.c:900
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5095
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:6654
int npresolroundsfast
Definition: struct_stat.h:218
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:8953
SCIP_RETCODE SCIPincIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int incval)
Definition: scip.c:46907
SCIP_RETCODE SCIPsetComprFree(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRFREE((*comprfree)))
Definition: scip.c:8294
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:13424
internal methods for managing events
SCIP_Longint SCIPconflictGetNPropConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:4448
void SCIPpricerSetInit(SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: pricer.c:506
SCIP_Bool SCIPisDualfeasIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:46360
enum SCIP_NlpTermStat SCIP_NLPTERMSTAT
Definition: type_nlpi.h:85
SCIP_Bool SCIPparamIsValidInt(SCIP_PARAM *param, int value)
Definition: paramset.c:4234
int SCIPreoptGetNLeaves(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5847
SCIP_READER ** readers
Definition: struct_set.h:65
SCIP_Real SCIPfeastol(SCIP *scip)
Definition: scip.c:45274
const char * SCIPexprintGetName(void)
SCIP_Bool SCIPlpDivingRowsChanged(SCIP_LP *lp)
Definition: lp.c:16841
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:7230
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
Definition: cons.c:7978
SCIP_RETCODE SCIPcutsCalcLpMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, SCIP_Real maxweight, int *weightinds, int nweightinds, int rowlensum, int *sidetypes, SCIP_Real scale, SCIP_Real *mksetcoefs, SCIP_Bool *mksetcoefsvalid, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: cuts.c:3216
int SCIPdivesetGetMinSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:432
default message handler
SCIP_Real SCIPgetVarAvgInferences(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26198
SCIP_VAR * SCIPprobFindVar(SCIP_PROB *prob, const char *name)
Definition: prob.c:2054
SCIP_Longint nnodelpiterations
Definition: struct_stat.h:63
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:14833
void SCIPinterruptCapture(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:99
SCIP_Real SCIPheurGetSetupTime(SCIP_HEUR *heur)
Definition: heur.c:1359
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
Definition: var.c:10785
SCIP_RETCODE SCIPsolLinkPseudoSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:897
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:954
SCIP_Real SCIPgetVarAvgCutoffs(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26452
static void printTreeStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44073
SCIP_RETCODE SCIPcomputeLPRelIntPoint(SCIP *scip, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_SOL **point)
Definition: scip.c:29762
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
Definition: implics.c:3305
int SCIPgetPlungeDepth(SCIP *scip)
Definition: scip.c:42209
SCIP_Bool SCIPsetIsLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5580
SCIP_Bool SCIPlpiIsDualFeasible(SCIP_LPI *lpi)
Definition: lpi_clp.cpp:2507
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:30835
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:5300
trivialnegation primal heuristic
SCIP_Bool SCIPsetIsFeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6030
int SCIPgetNDelayedPoolCuts(SCIP *scip)
Definition: scip.c:34297
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:3101
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:14353
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:22118
SCIP_Real * SCIPnlpGetVarsLbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5897
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30233
int nnodesels
Definition: struct_set.h:114
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:9902
SCIP_Bool SCIPisDualfeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46298
SCIP_Bool SCIPisSumRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46540
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:8670
void SCIPvarUpdateBestRootSol(SCIP_VAR *var, SCIP_SET *set, SCIP_Real rootsol, SCIP_Real rootredcost, SCIP_Real rootlpobjval)
Definition: var.c:12584
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19263
SCIP_RETCODE SCIPlinkCurrentSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37777
SCIP_Bool misc_estimexternmem
Definition: struct_set.h:350
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:3919
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: scip.c:6905
void SCIPbranchruleSetCopy(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHCOPY((*branchcopy)))
Definition: branch.c:1795
SCIP_STATUS status
Definition: struct_stat.h:164
SCIP_Bool compr_enable
Definition: struct_set.h:525
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46086
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:491
int random_permutationseed
Definition: struct_set.h:363
SCIP_Bool SCIPlpDiving(SCIP_LP *lp)
Definition: lp.c:16799
SCIP_RETCODE SCIPsetEventhdlrInitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINITSOL((*eventinitsol)))
Definition: scip.c:8614
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:30902
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:5876
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
Definition: scip.c:40453
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip.c:814
int SCIPgetSolRunnum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38276
SCIP_Longint SCIPconflictGetNDualrayInfeasibleNonzeros(SCIP_CONFLICT *conflict)
Definition: conflict.c:7795
SCIP_Real SCIPgetFirstLPLowerboundRoot(SCIP *scip)
Definition: scip.c:42413
#define SCIP_DECL_CONCSOLVERSYNCREAD(x)
BMS_BUFMEM * cleanbuffer
Definition: struct_mem.h:42
SCIP_Real * origobjvals
Definition: struct_tree.h:52
SCIP_RETCODE SCIPextendBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray, int minidx, int maxidx)
Definition: scip.c:46988
methods to interpret (evaluate) an expression tree "fast"
SCIP_RETCODE SCIPchgBarrierconvtol(SCIP *scip, SCIP_Real barrierconvtol)
Definition: scip.c:45414
SCIP_NODESEL ** SCIPgetNodesels(SCIP *scip)
Definition: scip.c:8885
void SCIPlpSetIsRelax(SCIP_LP *lp, SCIP_Bool relax)
Definition: lp.c:16756
SCIP_Longint externmemestim
Definition: struct_stat.h:113
struct SCIP_DispData SCIP_DISPDATA
Definition: type_disp.h:62
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
Definition: cons.c:8140
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
Definition: var.c:16958
SCIP_RETCODE SCIPincSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real incval)
Definition: scip.c:37964
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
Definition: scip.c:6251
SCIP_Real SCIPrelaxationGetSolObj(SCIP_RELAXATION *relaxation)
Definition: relax.c:696
SCIP_RETCODE SCIPgetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int *ival)
Definition: scip.c:31369
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
Definition: scip.c:18733
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:631
SCIP_RETCODE SCIPbacktrackProbing(SCIP *scip, int probingdepth)
Definition: scip.c:35152
SCIP_CONFLICTHDLR ** conflicthdlrs
Definition: struct_set.h:71
SCIP_RETCODE SCIPsetBranchruleExecPs(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: scip.c:9168
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:41382
SCIP_RETCODE SCIPcopyOrigProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name)
Definition: scip.c:1783
SCIP_Longint nfeasleaves
Definition: struct_stat.h:74
SCIP_Real SCIPgetVarAvgInferenceCutoffScore(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffweight)
Definition: scip.c:26569
SCIP_Bool SCIPsetIsSumZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5843
int SCIPgetNRelaxs(SCIP *scip)
Definition: scip.c:7245
SCIP_Real SCIPtreeCalcChildEstimate(SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real targetvalue)
Definition: tree.c:5241
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:30080
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46099
SCIP_NLPI * SCIPsetFindNlpi(SCIP_SET *set, const char *name)
Definition: set.c:4599
SCIP_RETCODE SCIPaddVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real addobj)
Definition: scip.c:21497
SCIP_Real SCIPvarGetAvgCutoffsCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15606
SCIP_Bool SCIPprobIsConsCompressionEnabled(SCIP_PROB *prob)
Definition: prob.c:2324
SCIP_RETCODE SCIPrecalcRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30543
SCIP_Bool SCIPisSumGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46037
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:5632
SCIP_Real SCIPsetFeastol(SCIP_SET *set)
Definition: set.c:5426
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:39337
SCIP_Real SCIProwGetMinval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6495
SCIP_Real SCIPvarGetBranchFactor(SCIP_VAR *var)
Definition: var.c:17326
void SCIPdialogMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip.c:1319
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46462
#define SCIP_DECL_COMPREXEC(x)
Definition: type_compr.h:111
void SCIPtreeSetFocusNodeLP(SCIP_TREE *tree, SCIP_Bool solvelp)
Definition: tree.c:8055
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:6131
void SCIPprobSetData(SCIP_PROB *prob, SCIP_PROBDATA *probdata)
Definition: prob.c:689
SCIP_Longint SCIPconflictGetNPropSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:4438
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19123
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:3440
void SCIPconflicthdlrSetExit(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXIT((*conflictexit)))
Definition: conflict.c:681
SCIP_PROBDATA * SCIPprobGetData(SCIP_PROB *prob)
Definition: prob.c:2224
SCIP_RETCODE SCIPbranchVarHole(SCIP *scip, SCIP_VAR *var, SCIP_Real left, SCIP_Real right, SCIP_NODE **downchild, SCIP_NODE **upchild)
Definition: scip.c:36778
void SCIPlpEndStrongbranchProbing(SCIP_LP *lp)
Definition: lp.c:15406
SCIP_Longint SCIPdivesetGetNBacktracks(SCIP_DIVESET *diveset)
Definition: heur.c:482
SCIP_RETCODE SCIPcreateBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
Definition: scip.c:46954
SCIP_RETCODE SCIPgetNLPNlRowsData(SCIP *scip, SCIP_NLROW ***nlrows, int *nnlrows)
Definition: scip.c:31014
SCIP_Bool misc_allowdualreds
Definition: struct_set.h:357
SCIP_RETCODE SCIPgetSolVarsData(SCIP *scip, SCIP_SOL *sol, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:12260
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:7964
SCIP_RETCODE SCIPsetClockTime(SCIP *scip, SCIP_CLOCK *clck, SCIP_Real sec)
Definition: scip.c:45093
#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:16886
SCIP_Bool misc_finitesolstore
Definition: struct_set.h:355
void SCIPnodeselSetInit(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: nodesel.c:1106
BMS_BUFMEM * buffer
Definition: struct_mem.h:41
SCIP_RETCODE SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
Definition: scip.c:10946
static SCIP_RETCODE initPresolve(SCIP *scip)
Definition: scip.c:13887
int npricerounds
Definition: struct_stat.h:208
int SCIPpricestoreGetNVars(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:601
SCIP_RETCODE SCIPaddDialogEntry(SCIP *scip, SCIP_DIALOG *dialog, SCIP_DIALOG *subdialog)
Definition: scip.c:9669
SCIP_Real SCIPgetVarAvgInferencesCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26226
SCIP_Real SCIPgetDualboundRoot(SCIP *scip)
Definition: scip.c:42344
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:40275
SCIP_RETCODE SCIPlpFlush(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue)
Definition: lp.c:8397
SCIP_RETCODE SCIPlpGetBInvCol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9545
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
Definition: scip.c:6541
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:35125
SCIP_RETCODE SCIPsetPresolExit(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: scip.c:6937
SCIP_NODE * SCIPtreeGetLowerboundNode(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6994
SCIP_Real SCIPgetReadingTime(SCIP *scip)
Definition: scip.c:45164
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:29569
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
Definition: scip.c:42499
SCIP_Real SCIPgetVarConflictlengthScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26113
SCIP_Real SCIPsetFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5709
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30256
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5920
SCIP_Real SCIPgetPrimalbound(SCIP *scip)
Definition: scip.c:42448
SCIP_RETCODE SCIPsetSetRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Real value)
Definition: set.c:3118
#define SCIPallocClearBufferArray(scip, ptr, num)
Definition: scip.h:21927
#define SCIPsetDuplicateBufferArray(set, ptr, source, num)
Definition: set.h:1836
SCIP_Real SCIPvarGetWorstBoundGlobal(SCIP_VAR *var)
Definition: var.c:17209
SCIP_RETCODE SCIPintarrayIncVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int incval)
Definition: misc.c:3887
void SCIPconflicthdlrSetInitsol(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)))
Definition: conflict.c:692
#define SCIP_DECL_VARTRANS(x)
Definition: type_var.h:129
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:7473
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
Definition: scip.c:46449
int SCIPpricestoreGetNProbvarsFound(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:643
SCIP_Longint SCIPmemGetUsed(SCIP_MEM *mem)
Definition: mem.c:85
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:6720
SCIP_REOPTNODE * SCIPreoptGetReoptnode(SCIP_REOPT *reopt, unsigned int id)
Definition: reopt.c:5600
SCIP_RETCODE SCIPapplyCutsProbing(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:35805
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:14088
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:33265
SCIP_Bool SCIPvarDoNotMultaggr(SCIP_VAR *var)
Definition: var.c:5492
SCIP_Real SCIProwGetPseudoActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6242
SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
Definition: lpi_clp.cpp:2790
#define SCIP_DECL_PROBINITSOL(x)
Definition: type_prob.h:97
SCIP_RETCODE SCIPcalcStrongCG(SCIP *scip, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, int *inds, int ninds, SCIP_Real scale, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: scip.c:29529
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:2036
int SCIPgetIntarrayMaxIdx(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:46939
SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
Definition: tree.c:7163
SCIP_PARAMDATA * SCIPparamGetData(SCIP_PARAM *param)
Definition: paramset.c:661
SCIP_Longint SCIPcutpoolGetNCutsFound(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:892
SCIP_NODESEL ** nodesels
Definition: struct_set.h:80
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:170
SCIP_Real SCIPvarGetPseudocostCountCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:13918
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:38378
methods for implications, variable bounds, and cliques
SCIP_Real * SCIPgetNLPVarsUbDualsol(SCIP *scip)
Definition: scip.c:30992
SCIP_Bool SCIPisFeasFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:46199
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
Definition: scip.c:7788
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:8680
SCIP_Longint SCIPbranchruleGetNChildren(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2088
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17166
SCIP_Longint SCIPconflictGetNAppliedGlobalConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:2507
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:29958
SCIP_Longint SCIPconshdlrGetNDomredsFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4819
int presol_maxrounds
Definition: struct_set.h:393
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:816
#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:6481
SCIP_Real SCIPpricestoreGetProbPricingTime(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:623
SCIP_Real SCIPvarGetAvgBranchdepth(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15089
SCIP_Longint SCIPpropGetNRespropCalls(SCIP_PROP *prop)
Definition: prop.c:1052
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
Definition: var.c:11616
SCIP_Real SCIPgetLocalTransEstimate(SCIP *scip)
Definition: scip.c:13183
SCIP_Longint SCIPconflictGetNBoundexceedingLPIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:7513
SCIP_LPALGO lastlpalgo
Definition: struct_lp.h:330
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip.c:4426
SCIP_CLOCK * conflictlptime
Definition: struct_stat.h:149
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:8310
SCIP_Bool SCIPvarIsPscostRelerrorReliable(SCIP_VAR *var, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
Definition: var.c:14085
int nrunsbeforefirst
Definition: struct_stat.h:246
SCIP_RETCODE SCIPupdateCutoffbound(SCIP *scip, SCIP_Real cutoffbound)
Definition: scip.c:42527
#define SCIP_MAXSTRLEN
Definition: def.h:215
SCIP_Bool conf_usesb
Definition: struct_set.h:193
SCIP_Longint SCIPconshdlrGetNCutoffs(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4759
SCIP_RETCODE SCIPgetLeaves(SCIP *scip, SCIP_NODE ***leaves, int *nleaves)
Definition: scip.c:40610
SCIP_SEPA * SCIPfindSepa(SCIP *scip, const char *name)
Definition: scip.c:7463
SCIP_RETCODE SCIPsetMessagehdlr(SCIP *scip, SCIP_MESSAGEHDLR *messagehdlr)
Definition: scip.c:1193
SCIP_Real SCIPgetVarPseudocostVal(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip.c:25593
int concurrent_initseed
Definition: struct_set.h:505
#define SCIP_DECL_PROBDELORIG(x)
Definition: type_prob.h:55
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1327
SCIP_Real rootlowerbound
Definition: struct_stat.h:116
#define SCIP_DECL_CONSINITPRE(x)
Definition: type_cons.h:114
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:9965
SCIP_RETCODE SCIPsetEventhdlrExitsol(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXITSOL((*eventexitsol)))
Definition: scip.c:8628
int SCIPnlpiGetPriority(SCIP_NLPI *nlpi)
Definition: nlpi.c:760
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
Definition: scip.c:45471
void SCIProwRecalcLPActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:5992
SCIP_PRIMAL * origprimal
Definition: struct_scip.h:71
SCIP_Bool SCIPsetIsDualfeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6219
int SCIPgetNPrioPseudoBranchImpls(SCIP *scip)
Definition: scip.c:36565
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:42664
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:41535
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:39639
SCIP_Longint SCIPconflictGetNPseudoReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8092
void SCIPlpRecalculateObjSqrNorm(SCIP_SET *set, SCIP_LP *lp)
Definition: lp.c:16648
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:1434
internal methods for clocks and timing issues
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
Definition: scip.c:5973
SCIP_Longint ntotalnodes
Definition: struct_stat.h:76
int SCIPbranchcandGetNPseudoCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:821
SCIP_Bool SCIPsetIsSumGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5807
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:9778
SCIP_RETCODE SCIPsetCreate(SCIP_SET **set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP *scip)
Definition: set.c:1052
SCIP_Longint SCIPconflictGetNGlobalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:2497
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:27962
#define SCIP_VARTYPE_INTEGER_CHAR
Definition: def.h:107
SCIP_RETCODE SCIPvarChgLbOriginal(SCIP_VAR *var, SCIP_SET *set, SCIP_Real newbound)
Definition: var.c:6102
SCIP_RETCODE SCIPchgConsName(SCIP *scip, SCIP_CONS *cons, const char *name)
Definition: scip.c:27374
SCIP_RETCODE SCIPsetParam(SCIP *scip, const char *name, void *value)
Definition: scip.c:4522
#define SCIP_DECL_CONSGETDIVEBDCHGS(x)
Definition: type_cons.h:867
SCIP_Real SCIPcomprGetTime(SCIP_COMPR *compr)
Definition: compr.c:503
#define SCIP_DECL_CONSPRESOL(x)
Definition: type_cons.h:511
SCIP_Longint SCIPcolGetStrongbranchNode(SCIP_COL *col)
Definition: lp.c:16202
int npresolaggrvars
Definition: struct_stat.h:222
SCIP_RETCODE SCIPsetEventhdlrExit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: scip.c:8600
SCIP_RETCODE SCIPsetIncludeRelax(SCIP_SET *set, SCIP_RELAX *relax)
Definition: set.c:3798
void SCIPconshdlrSetDeactive(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
Definition: cons.c:4381
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:12481
SCIP_ROW ** SCIPsepastoreGetCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1318
SCIP_Bool SCIPsetIsPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5645
SCIP_EVENTHDLR * SCIPsetFindEventhdlr(SCIP_SET *set, const char *name)
Definition: set.c:4297
int SCIPintarrayGetMinIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:3899
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: scip.c:8092
SCIP_RETCODE SCIPsetRelaxInit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: scip.c:7154
int SCIPcalcMemGrowSize(SCIP *scip, int num)
Definition: scip.c:45601
static long bound
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
Definition: var.c:16946
SCIP_Bool SCIPisSumPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:46062
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:30288
SCIP_RETCODE SCIPrecomputeSolObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38168
static SCIP_DECL_PARAMCHGD(paramChgdNlpiPriority)
Definition: scip.c:9368
SCIP_RETCODE SCIPcreateCPUClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:44861
SCIP_Real SCIPgetVarRedcost(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:18997
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:3183
SCIP_Bool concurrent_changeseeds
Definition: struct_set.h:501
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:16232
SCIP_RETCODE SCIPevalExprtreeGlobalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip.c:32768
SCIP_RETCODE SCIPsetConsPropagated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool propagate)
Definition: scip.c:27521
int SCIPtreeGetProbingDepth(SCIP_TREE *tree)
Definition: tree.c:8131
SCIP_Longint nrootfirstlpiterations
Definition: struct_stat.h:55
int nprops
Definition: struct_set.h:106
void SCIPheurSetExitsol(SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
Definition: heur.c:1170
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:1578
static SCIP_RETCODE analyzeStrongbranch(SCIP *scip, SCIP_VAR *var, SCIP_Bool *downinf, SCIP_Bool *upinf, SCIP_Bool *downconflict, SCIP_Bool *upconflict)
Definition: scip.c:19932
struct SCIP_ParamData SCIP_PARAMDATA
Definition: type_paramset.h:76
SCIP_Real SCIPgetRowPseudoFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30633
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:8072
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:45876
SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46527
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:3555
SCIP_RETCODE SCIPgetNegatedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **negvars)
Definition: scip.c:18696
void SCIPbranchruleSetFree(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: branch.c:1806
SCIP_Bool SCIPboolarrayGetVal(SCIP_BOOLARRAY *boolarray, int idx)
Definition: misc.c:4166
SCIP_Bool presol_donotaggr
Definition: struct_set.h:404
int SCIPgetNOrigVars(SCIP *scip)
Definition: scip.c:12071
#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:1739
int SCIPgetNSiblings(SCIP *scip)
Definition: scip.c:40592
void SCIPconflicthdlrSetCopy(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTCOPY((*conflictcopy)))
Definition: conflict.c:648
SCIP_Longint ndivinglps
Definition: struct_stat.h:184
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:1851
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17222
SCIP_Bool SCIPisStringParamValid(SCIP *scip, SCIP_PARAM *param, const char *value)
Definition: scip.c:4872
SCIP_Bool SCIPisUpdateUnreliable(SCIP *scip, SCIP_Real newvalue, SCIP_Real oldvalue)
Definition: scip.c:46634
SCIP_RETCODE SCIPvarChgLbLazy(SCIP_VAR *var, SCIP_SET *set, SCIP_Real lazylb)
Definition: var.c:7004
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:348
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:21112
SCIP_Real SCIPgetColRedcost(SCIP *scip, SCIP_COL *col)
Definition: scip.c:29820
SCIP_CUT ** SCIPgetDelayedPoolCuts(SCIP *scip)
Definition: scip.c:34281
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26950
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:31946
SCIP_Longint SCIPconflictGetNInfeasibleLPSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:7383
SCIP_RELAX ** SCIPgetRelaxs(SCIP *scip)
Definition: scip.c:7232
int SCIPgetNPseudoBranchCands(SCIP *scip)
Definition: scip.c:36492
SCIP_Real constant
Definition: struct_var.h:183
SCIP_RETCODE SCIPreoptGetLeaves(SCIP_REOPT *reopt, SCIP_NODE *node, unsigned int *leaves, int leavessize, int *nleaves)
Definition: reopt.c:6338
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:8740
int nconcsolvers
Definition: struct_set.h:126
void SCIPsetSortComprsName(SCIP_SET *set)
Definition: set.c:4259
void SCIProwCapture(SCIP_ROW *row)
Definition: lp.c:5159
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45803
SCIP_Bool SCIPsetIsSumRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6583
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:9501
SCIP_RETCODE SCIPsetIncludeConshdlr(SCIP_SET *set, SCIP_CONSHDLR *conshdlr)
Definition: set.c:3490
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:130
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:22806
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28131
#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:6343
SCIP_Longint SCIPconflictGetNPropCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:4428
int SCIPgetNLeaves(SCIP *scip)
Definition: scip.c:40634
SCIP_Longint SCIPconflictGetNDualrayInfSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:7775
SCIP_Real SCIPvarGetMultaggrLbGlobal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8095
SCIP_RETCODE SCIPchgVarLbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21781
SCIP_Longint SCIPsepaGetNDomredsFound(SCIP_SEPA *sepa)
Definition: sepa.c:849
SCIP_RETCODE SCIPtreeCreate(SCIP_TREE **tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_NODESEL *nodesel)
Definition: tree.c:4656
int nintvars
Definition: struct_prob.h:63
void SCIPrelaxationSetSolValid(SCIP_RELAXATION *relaxation, SCIP_Bool isvalid)
Definition: relax.c:664
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
Definition: cons.c:8250
int npresolfixedvars
Definition: struct_stat.h:221
SCIP_Bool SCIPreoptimizeNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:17077
SCIP_Real SCIPgetAvgCutoffScoreCurrentRun(SCIP *scip)
Definition: scip.c:43157
SCIP_CLOCK * totaltime
Definition: struct_scip.h:66
SCIP_RETCODE SCIPsetGetStringParam(SCIP_SET *set, const char *name, char **value)
Definition: set.c:2910
SCIP_Bool SCIPisDualfeasFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:46372
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
Definition: scip.c:8526
SCIP_RETCODE SCIPdelConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons)
Definition: scip.c:13061
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:46652
SCIP_RETCODE SCIPbranchcandCreate(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:132
SCIP_PRIMAL * primal
Definition: struct_scip.h:83
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
Definition: scip.c:31218
void SCIPstatDisableVarHistory(SCIP_STAT *stat)
Definition: stat.c:151
#define SCIP_SUBVERSION
Definition: def.h:98
const char * SCIProwGetName(SCIP_ROW *row)
Definition: lp.c:16370
SCIP_Bool SCIPpscostThresholdProbabilityTest(SCIP *scip, SCIP_VAR *var, SCIP_Real frac, SCIP_Real threshold, SCIP_BRANCHDIR dir, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:25838
SCIP_CUTPOOL * delayedcutpool
Definition: struct_scip.h:94
enum SCIP_DispMode SCIP_DISPMODE
Definition: type_disp.h:59
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:84
void SCIPprobAddObjoffset(SCIP_PROB *prob, SCIP_Real addval)
Definition: prob.c:1419
SCIP_DIVESET ** SCIPheurGetDivesets(SCIP_HEUR *heur)
Definition: heur.c:1379
SCIP_RETCODE SCIPsolLinkLPSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:758
SCIP_RETCODE SCIPvarChgUbOriginal(SCIP_VAR *var, SCIP_SET *set, SCIP_Real newbound)
Definition: var.c:6161
SCIP_Real SCIPgetAvgConflictScore(SCIP *scip)
Definition: scip.c:42912
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:18575
void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
Definition: misc.c:9529
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:40361
SCIP_RETCODE SCIPprintTransProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:43309
SCIP_Real lastsolgap
Definition: struct_stat.h:121
SCIP_RETCODE SCIPaddNewRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34139
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:5215
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
Definition: scip.c:46235
void SCIPrelaxSetPriority(SCIP_RELAX *relax, SCIP_SET *set, int priority)
Definition: relax.c:476
SCIP_RETCODE SCIPsetResetParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:3251
SCIP_Longint SCIPconflictGetNStrongbranchIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:7865
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
Definition: scip.c:27674
SCIP_RETCODE SCIPsetNlRowExprtreeParam(SCIP *scip, SCIP_NLROW *nlrow, int paramidx, SCIP_Real paramval)
Definition: scip.c:32256
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:5268
SCIP_Longint nrootstrongbranchs
Definition: struct_stat.h:188
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:17656
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:9102
static void printSeparatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43712
static SCIP_Real getPrimalbound(SCIP *scip)
Definition: scip.c:502
SCIP_RETCODE SCIPextendIntarray(SCIP *scip, SCIP_INTARRAY *intarray, int minidx, int maxidx)
Definition: scip.c:46837
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:707
SCIP_Longint SCIPgetNDualLPs(SCIP *scip)
Definition: scip.c:41499
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
Definition: scip.c:18384
interface methods for specific LP solvers
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
Definition: var.c:16732
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:1216
SCIP_RETCODE SCIPchgVarObjDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real coef)
Definition: scip.c:31668
SCIP_Bool SCIPsetIsScalingIntegral(SCIP_SET *set, SCIP_Real val, SCIP_Real scalar)
Definition: set.c:5678
SCIP_NODE * SCIPtreeGetBestNode(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6922
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5384
SCIP_Real SCIPgetBranchingPoint(SCIP *scip, SCIP_VAR *var, SCIP_Real suggestion)
Definition: scip.c:36631
SCIP_Bool time_reading
Definition: struct_set.h:520
int SCIPintarrayGetVal(SCIP_INTARRAY *intarray, int idx)
Definition: misc.c:3798
SCIP_RETCODE SCIPgetOpenNodesData(SCIP *scip, SCIP_NODE ***leaves, SCIP_NODE ***children, SCIP_NODE ***siblings, int *nleaves, int *nchildren, int *nsiblings)
Definition: scip.c:40760
SCIP_RETCODE SCIPreoptAddCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons)
Definition: reopt.c:8028
#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:6142
SCIP_CONCURRENT * concurrent
Definition: struct_scip.h:98
SCIP_RETCODE SCIPstopClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:44946
SCIP_Bool history_allowmerge
Definition: struct_set.h:256
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:1265
SCIP_RETCODE SCIPaddRowDive(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34706
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:46175
SCIP_RETCODE SCIPgetLPI(SCIP *scip, SCIP_LPI **lpi)
Definition: scip.c:29653
SCIP_RETCODE SCIPsolLinkCurrentSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
Definition: sol.c:926
SCIP_RETCODE SCIPsetBranchruleExit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: scip.c:9086
int nreoptruns
Definition: struct_stat.h:249
SCIP_Real SCIPlpGetGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12619
SCIP_Real SCIPvarGetSol(SCIP_VAR *var, SCIP_Bool getlpval)
Definition: var.c:12561
SCIP_RETCODE SCIPaddDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34243
SCIP_RETCODE SCIProwEnsureSize(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: lp.c:580
SCIP_NODE * SCIPtreeGetBestChild(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6858
SCIP_RETCODE SCIPchgVarUbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazyub)
Definition: scip.c:22084
int SCIPbranchcandGetNPrioExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:486
SCIP_DECL_CONSENFOPS(ConshdlrSubtour::scip_enfops)
SCIP_RETCODE SCIPsetIncludeDialog(SCIP_SET *set, SCIP_DIALOG *dialog)
Definition: set.c:4532
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:46756
SCIP_RETCODE SCIPnlpGetStatistics(SCIP_NLP *nlp, SCIP_NLPSTATISTICS *statistics)
Definition: nlp.c:5987
void SCIPconsMarkConflict(SCIP_CONS *cons)
Definition: cons.c:6900
SCIP_Real SCIPdualfeastol(SCIP *scip)
Definition: scip.c:45302
int SCIPnodepqLen(const SCIP_NODEPQ *nodepq)
Definition: nodesel.c:550
SCIP_RETCODE SCIPsetRelaxExitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: scip.c:7202
SCIP_SOL ** sols
Definition: struct_primal.h:48
void SCIPmessagehdlrCapture(SCIP_MESSAGEHDLR *messagehdlr)
Definition: message.c:329
int npresoldelconss
Definition: struct_stat.h:226
void SCIPgmlWriteClosing(FILE *file)
Definition: misc.c:687
int SCIPgetMaxDepth(SCIP *scip)
Definition: scip.c:42144
SCIP_RETCODE SCIPconvertCutsToConss(SCIP *scip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:2996
SCIP_Real SCIPbranchGetScore(SCIP_SET *set, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: branch.c:2115
SCIP_RETCODE SCIPvarMarkDoNotMultaggr(SCIP_VAR *var)
Definition: var.c:5715
SCIP_Real SCIPvarGetLbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12238
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip.c:27775
SCIP_Real SCIPgetVarPseudocostCountCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:25729
SCIP_RETCODE SCIPsetNlRowExprtree(SCIP *scip, SCIP_NLROW *nlrow, SCIP_EXPRTREE *exprtree)
Definition: scip.c:32230
SCIP_BOUNDTYPE SCIPboundchgGetBoundtype(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16479
#define SCIP_DECL_PROBDELTRANS(x)
Definition: type_prob.h:86
SCIP_Longint nstrongbranchs
Definition: struct_stat.h:187
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:17666
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:32053
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:36068
SCIP_Longint SCIPpropGetNCalls(SCIP_PROP *prop)
Definition: prop.c:1042
SCIP_Real SCIPgetVarPseudocostScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
Definition: scip.c:25920
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46138
SCIP_RETCODE SCIPextendRealarray(SCIP *scip, SCIP_REALARRAY *realarray, int minidx, int maxidx)
Definition: scip.c:46686
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:23908
SCIP_RETCODE SCIPreoptnodeDelete(SCIP_REOPTNODE **reoptnode, BMS_BLKMEM *blkmem)
Definition: reopt.c:7895
SCIP_Bool SCIPlpiWasSolved(SCIP_LPI *lpi)
Definition: lpi_clp.cpp:2292
SCIP_RETCODE SCIPsetBranchruleFree(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHFREE((*branchfree)))
Definition: scip.c:9054
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
Definition: scip.c:44712
#define SCIP_DECL_BRANCHFREE(x)
Definition: type_branch.h:60
int SCIPmajorVersion(void)
Definition: scip.c:565
SCIP_Real SCIPsepaGetSetupTime(SCIP_SEPA *sepa)
Definition: sepa.c:729
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:11505
int lastnpresolchgvartypes
Definition: struct_stat.h:233
int SCIPsepastoreGetNCutsApplied(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1358
SCIP_Real SCIPgetRelaxFeastolFactor(SCIP *scip)
Definition: scip.c:34449
SCIP_Bool time_statistictiming
Definition: struct_set.h:522
SCIP_Longint SCIPgetNPrimalResolveLPs(SCIP *scip)
Definition: scip.c:41609
#define SCIP_DECL_CONSRESPROP(x)
Definition: type_cons.h:562
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:5043
SCIP_RETCODE SCIPsetProbExitsol(SCIP *scip, SCIP_DECL_PROBEXITSOL((*probexitsol)))
Definition: scip.c:9944
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_Longint nrootsblpiterations
Definition: struct_stat.h:69
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:7413
SCIP_Bool SCIPisSumNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:46074
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4485
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:7423
SCIP_RETCODE SCIPchgReoptObjective(SCIP *scip, SCIP_OBJSENSE objsense, SCIP_VAR **vars, SCIP_Real *coefs, int nvars)
Definition: scip.c:10776
SCIP_SOL ** SCIPgetSols(SCIP *scip)
Definition: scip.c:38881
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:4519
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
Definition: lp.c:16311
void SCIPsetSortHeurs(SCIP_SET *set)
Definition: set.c:4170
#define FALSE
Definition: def.h:64
SCIP_SEPA ** sepas
Definition: struct_set.h:74
SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub)
Definition: scip.c:21580
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:6348
SCIP_Real SCIPgetDeterministicTime(SCIP *scip)
Definition: scip.c:43182
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2765
SCIP_RETCODE SCIPlpWrite(SCIP_LP *lp, const char *fname)
Definition: lp.c:15575
void SCIPpropSetExitsol(SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: prop.c:811
SCIP_Longint SCIPgetNStrongbranchs(SCIP *scip)
Definition: scip.c:41793
SCIP_RETCODE SCIPnlpGetVarsNonlinearity(SCIP_NLP *nlp, int *nlcount)
Definition: nlp.c:5800
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:618
SCIP_RETCODE SCIPsetNodeselMemsavePriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip.c:8922
SCIP_Bool SCIPlpIsSolBasic(SCIP_LP *lp)
Definition: lp.c:16789
common methods used to generate and strengthen cuts
char sepa_cutselrestart
Definition: struct_set.h:479
#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:36876
SCIP_Longint SCIPbranchruleGetNDomredsFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2078
int SCIPboolarrayGetMaxIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4265
SCIP_Bool SCIPsetIsFeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6063
SCIP_Real SCIPgetVarVSIDS(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:25956
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:4350
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:4230
SCIP_Real objoffset
Definition: struct_prob.h:41
static void printHeuristicStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43812
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:4368
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:8197
SCIP_Bool SCIPhasNLPContinuousNonlinearity(SCIP *scip)
Definition: scip.c:30850
SCIP_Bool solved
Definition: struct_lp.h:343
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:23027
#define SCIP_DECL_RELAXINIT(x)
Definition: type_relax.h:63
SCIP_RETCODE SCIPcopyLimits(SCIP *sourcescip, SCIP *targetscip)
Definition: scip.c:4126
SCIP_NODE * SCIPgetBestSibling(SCIP *scip)
Definition: scip.c:40698
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:2642
#define SCIP_DECL_RELAXINITSOL(x)
Definition: type_relax.h:82
int SCIPgetSubscipDepth(SCIP *scip)
Definition: scip.c:3533
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:5831
int SCIPgetNPartialSols(SCIP *scip)
Definition: scip.c:40002
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
SCIP_RETCODE SCIPdelPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:33984
SCIP_Bool SCIPisIntParamValid(SCIP *scip, SCIP_PARAM *param, int value)
Definition: scip.c:4640
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:27230
int SCIPgetNActivePricers(SCIP *scip)
Definition: scip.c:5655
SCIP_Real SCIPgetVarMultaggrUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23498
SCIP_COMPR * SCIPfindCompr(SCIP *scip, const char *name)
Definition: scip.c:8374
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:273
SCIP_PROP * SCIPsetFindProp(SCIP_SET *set, const char *name)
Definition: set.c:3973
SCIP_RETCODE SCIPreoptApplyCompression(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE **representatives, int nrepresentatives, SCIP_Bool *success)
Definition: reopt.c:6606
SCIP_RETCODE SCIPaddQuadElementToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_QUADELEM quadelem)
Definition: scip.c:32140
SCIP_RETCODE SCIPsetNodeselExit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: scip.c:8824
SCIP_RETCODE SCIPpropagateProbingImplications(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:35583
void SCIPprintExternalCodes(SCIP *scip, FILE *file)
Definition: scip.c:9526
int SCIPbranchcandGetNPrioPseudoImpls(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:861
SCIP_Real primaldualintegral
Definition: struct_stat.h:129
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:3843
SCIP_RETCODE SCIPcutoffNode(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:40796
int parallel_maxnthreads
Definition: struct_set.h:498
SCIP_RETCODE SCIPsolCopy(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_SOL *sourcesol)
Definition: sol.c:341
SCIP_Real SCIPinfinity(SCIP *scip)
Definition: scip.c:45816
SCIP_Real SCIPgetVarPseudocostValCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real solvaldelta)
Definition: scip.c:25621
SCIP_Real constant
Definition: struct_var.h:193
SCIP_VERBLEVEL SCIPgetVerbLevel(SCIP *scip)
Definition: scip.c:1377
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:9340
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5634
SCIP_STAGE stage
Definition: struct_set.h:60
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:45888
SCIP_RETCODE SCIPenableConsSeparation(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28046
SCIP_Bool SCIPexistsDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:9590
SCIP_PRICER * SCIPfindPricer(SCIP *scip, const char *name)
Definition: scip.c:5618
void SCIPclearExternBranchCands(SCIP *scip)
Definition: scip.c:36423
void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randnumgen, void **array, int begin, int end)
Definition: misc.c:8794
#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:8240
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
Definition: sepa.c:632
SCIP_Real SCIPcutGetLPActivityQuot(SCIP_CUT *cut)
Definition: cutpool.c:381
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28192
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:14662
SCIP_Real SCIPgetConflictVarUb(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:27036
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:9038
void SCIPprobMarkNConss(SCIP_PROB *prob)
Definition: prob.c:1393
#define SCIP_DECL_HEURCOPY(x)
Definition: type_heur.h:60
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Longint SCIPconflictGetNPropConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:4458
SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
Definition: scip.c:13222
SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
Definition: implics.c:3347
#define SCIP_DECL_PROPEXITPRE(x)
Definition: type_prop.h:100
#define SCIP_DECL_HEUREXEC(x)
Definition: type_heur.h:126
SCIP_RETCODE SCIPnlpCreate(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, const char *name, int nvars_estimate)
Definition: nlp.c:5052
SCIP_Real SCIPgetSolTime(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38249
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:26813
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
Definition: scip.c:31195
SCIP_RETCODE SCIPcliquetableCreate(SCIP_CLIQUETABLE **cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: implics.c:1768
#define SCIP_DECL_CONSGETNVARS(x)
Definition: type_cons.h:832
SCIP_PRESOL * SCIPsetFindPresol(SCIP_SET *set, const char *name)
Definition: set.c:3748
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
Definition: scip.c:21255
int nenabledconss
Definition: struct_stat.h:215
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
Definition: cons.c:8160
SCIP_Longint SCIPgetVarStrongbranchNode(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21156
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:46803
#define SCIP_PRESOLTIMING_EXHAUSTIVE
Definition: type_timing.h:45
SCIP_Longint SCIPcutpoolGetNCalls(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:882
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:7949
SCIP_Real SCIPsepaGetTime(SCIP_SEPA *sepa)
Definition: sepa.c:739
SCIP_Real SCIProwGetLPEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6543
SCIP_RETCODE SCIPwriteOrigProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:10268
SCIP_Real SCIPgetBranchScoreMultiple(SCIP *scip, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: scip.c:36606
SCIP_RETCODE SCIPsolveConcurrent(SCIP *scip)
Definition: concurrent.c:474
SCIP_Longint SCIPconcsolverGetNSolsShared(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:538
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5069
SCIP_Longint nnlps
Definition: struct_stat.h:190
SCIP_RETCODE SCIPnlpChgVarsBoundsDive(SCIP_NLP *nlp, SCIP_SET *set, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: nlp.c:6296
SCIP_RETCODE SCIPsetComprInitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRINITSOL((*comprinitsol)))
Definition: scip.c:8342
#define SCIP_MEM_NOLIMIT
Definition: def.h:236
SCIP_Real SCIPlpGetRootColumnObjval(SCIP_LP *lp)
Definition: lp.c:16724
void SCIPconflicthdlrSetPriority(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_SET *set, int priority)
Definition: conflict.c:744
SCIP_Real SCIPprobInternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:2032
void SCIPlpStartStrongbranchProbing(SCIP_LP *lp)
Definition: lp.c:15393
enum SCIP_Varstatus SCIP_VARSTATUS
Definition: type_var.h:48
SCIP_Real SCIPconshdlrGetEnfoLPTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4619
int SCIPgetNReoptnodes(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:16440
SCIP_BRANCHRULE * SCIPfindBranchrule(SCIP *scip, const char *name)
Definition: scip.c:9184
SCIP_Longint nbacktracks
Definition: struct_stat.h:85
#define SCIPsetAllocBufferArray(set, ptr, num)
Definition: set.h:1834
int SCIPtreeGetCurrentDepth(SCIP_TREE *tree)
Definition: tree.c:8103
char ** SCIPgetExternalCodeNames(SCIP *scip)
Definition: scip.c:9487
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:1411
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:1993
SCIP_HEUR ** SCIPgetHeurs(SCIP *scip)
Definition: scip.c:8153
SCIP_Longint SCIPconshdlrGetNCutsApplied(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4779
SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
Definition: scip.c:10671
SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:34642
SCIP_RETCODE SCIPsetSetParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, void *value)
Definition: set.c:2938
void SCIPsepaSetExit(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: sepa.c:599
SCIP_Longint SCIPbranchruleGetNCutoffs(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2046
int SCIPnlrowGetNQuadVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3275
SCIP_Bool branch_checksbsol
Definition: struct_set.h:164
void SCIPrelaxSetCopy(SCIP_RELAX *relax, SCIP_DECL_RELAXCOPY((*relaxcopy)))
Definition: relax.c:380
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:16859
void SCIPpropSetFree(SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: prop.c:767
SCIP_RETCODE SCIPfreeIntarray(SCIP *scip, SCIP_INTARRAY **intarray)
Definition: scip.c:46820
int SCIPgetNPrioPseudoBranchInts(SCIP *scip)
Definition: scip.c:36547
SCIP_RETCODE SCIPptrarrayExtend(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:4333
SCIP_Real SCIPgetAvgLowerbound(SCIP *scip)
Definition: scip.c:42280
SCIP_Bool branch_divingpscost
Definition: struct_set.h:161
SCIP_Longint SCIPgetNRootFirstLPIterations(SCIP *scip)
Definition: scip.c:41445
SCIP_RETCODE SCIPgetLPBInvCol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29344
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:10257
#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:177
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:1252
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:2796
SCIP_RETCODE SCIPreoptFree(SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
Definition: reopt.c:5071
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:1961
SCIP_RETCODE SCIPvarChgLbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:7778
SCIP_Longint SCIPsepaGetNCutsFound(SCIP_SEPA *sepa)
Definition: sepa.c:779
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:7937
void SCIPbranchcandClearExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:668
SCIP_Real SCIPsetCutoffbounddelta(SCIP_SET *set)
Definition: set.c:5497
const char * SCIPexprintGetDesc(void)
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
Definition: set.c:5096
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:17317
SCIP_Longint SCIPgetNNZs(SCIP *scip)
Definition: scip.c:41408
const char * SCIPnlpiGetName(SCIP_NLPI *nlpi)
Definition: nlpi.c:740
SCIP_RETCODE SCIPisConflictVarUsed(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool *used)
Definition: scip.c:26984
SCIP_Real SCIPgetVarAvgCutoffsCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26480
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:33793
SCIP_Bool presol_donotmultaggr
Definition: struct_set.h:403
SCIP_Bool SCIPsetIsSumLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5771
datastructures for concurrent solvers
SCIP_PARAM ** SCIPsetGetParams(SCIP_SET *set)
Definition: set.c:3355
SCIP_Bool SCIPisDualfeasZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:46324
static void printPricerStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43748
SCIP_Real SCIPsetRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5731
SCIP_Real SCIPsolGetTime(SCIP_SOL *sol)
Definition: sol.c:2342
void SCIPreoptResetSolMarks(SCIP_REOPT *reopt)
Definition: reopt.c:5674
SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
Definition: scip.c:12044
SCIP_Real SCIPgetVarVSIDSCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:25988
SCIP_RETCODE SCIPchgRealParam(SCIP *scip, SCIP_PARAM *param, SCIP_Real value)
Definition: scip.c:4715
#define infty2infty(infty1, infty2, val)
Definition: scip.c:32652
SCIP_Real SCIPvarGetAggrScalar(SCIP_VAR *var)
Definition: var.c:16912
int SCIPnlrowGetNLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3245
SCIP_RETCODE SCIPprobInitSolve(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1845
SCIP_RETCODE SCIPconsEnableSeparation(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6782
SCIP_NODE * SCIPtreeGetFocusNode(SCIP_TREE *tree)
Definition: tree.c:8011
static void printRootStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44306
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
Definition: cons.c:8190
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:6863
SCIP_NLPTERMSTAT SCIPnlpGetTermstat(SCIP_NLP *nlp)
Definition: nlp.c:5977
SCIP_Real SCIPgetVarAvgCutoffScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26537
struct SCIP_HeurData SCIP_HEURDATA
Definition: type_heur.h:51
#define BMSdisplayBlockMemory(mem)
Definition: memory.h:434
SCIP_Longint SCIPgetNRootStrongbranchLPIterations(SCIP *scip)
Definition: scip.c:41847
#define SCIP_DECL_CONSEXITSOL(x)
Definition: type_cons.h:174
int SCIPgetNActiveConss(SCIP *scip)
Definition: scip.c:42226
void SCIPconshdlrSetCopy(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: cons.c:4205
int SCIPgetNNodesLeft(SCIP *scip)
Definition: scip.c:41227
SCIP_Longint SCIPdivesetGetNLPIterations(SCIP_DIVESET *diveset)
Definition: heur.c:462
SCIP_RETCODE SCIPevalExprtreeSol(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_SOL *sol, SCIP_Real *val)
Definition: scip.c:32713
void SCIPdebugMessagePrint(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1303
SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, SCIP_Real maxweight, int *weightinds, int nweightinds, int rowlensum, int *sidetypes, SCIP_Real scale, SCIP_Real *mksetcoefs, SCIP_Bool *mksetcoefsvalid, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank)
Definition: scip.c:29473
SCIP_RETCODE SCIPsetSepaPriority(SCIP *scip, SCIP_SEPA *sepa, int priority)
Definition: scip.c:7500
SCIP_VAR ** fixedvars
Definition: struct_prob.h:56
SCIP_RETCODE SCIPaddConflictRelaxedLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedlb)
Definition: scip.c:26780
SCIP_RETCODE SCIPeventqueueFree(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2072
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:15158
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:5801
SCIP_Real mem_arraygrowfac
Definition: struct_set.h:331
SCIP_RETCODE SCIPaddDiveBoundChange(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Real value, SCIP_Bool preferred)
Definition: scip.c:36042
SCIP_Bool SCIPisVarPscostRelerrorReliable(SCIP *scip, SCIP_VAR *var, SCIP_Real threshold, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:25857
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:6737
SCIP_Bool SCIPsetIsDualfeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6175
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
Definition: scip.c:26717
SCIP_RETCODE SCIPclearRelaxSolVals(SCIP *scip)
Definition: scip.c:19503
SCIP_Longint nsolsfound
Definition: struct_primal.h:39
SCIP_Longint SCIPgetNBacktracks(SCIP *scip)
Definition: scip.c:42192
int nheurs
Definition: struct_set.h:108
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:22234
SCIP_Real SCIPconshdlrGetEnfoPSTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4629
SCIP_Longint SCIPgetNDivingLPIterations(SCIP *scip)
Definition: scip.c:41775
XML_NODE * xmlProcess(const char *filename)
Definition: xmlparse.c:1069
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:1583
#define SCIP_DECL_BRANCHEXECEXT(x)
Definition: type_branch.h:140
SCIP_Real SCIPgetRelaxSolObj(SCIP *scip)
Definition: scip.c:19751
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:7999
SCIP_RETCODE SCIPsetIncludeNlpi(SCIP_SET *set, SCIP_NLPI *nlpi)
Definition: set.c:4576
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:4313
SCIP_Bool SCIPgetVarWasFixedAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19421
SCIP_RETCODE SCIPenableOrDisableStatisticTiming(SCIP *scip)
Definition: scip.c:44986
int maxtotaldepth
Definition: struct_stat.h:212
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:15361
SCIP_Real SCIPreoptGetOldObjCoef(SCIP_REOPT *reopt, int run, int idx)
Definition: reopt.c:5614
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:11903
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
Definition: scip.c:5327
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:28101
SCIP_RETCODE SCIPcliquetableFree(SCIP_CLIQUETABLE **cliquetable, BMS_BLKMEM *blkmem)
Definition: implics.c:1802
SCIP_CLOCK * barrierlptime
Definition: struct_stat.h:146
SCIP_Bool SCIPallVarsInProb(SCIP *scip)
Definition: scip.c:12383
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:33011
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:16584
SCIP_Bool diving
Definition: struct_lp.h:354
SCIP_RETCODE SCIPinterruptCreate(SCIP_INTERRUPT **interrupt)
Definition: interrupt.c:76
SCIP_RETCODE SCIPconflictFree(SCIP_CONFLICT **conflict, BMS_BLKMEM *blkmem)
Definition: conflict.c:2699
SCIP_RETCODE SCIPinitRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:16603
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randnumgen, int minrandval, int maxrandval)
Definition: misc.c:8723
SCIP_Real SCIPgetVarPseudocost(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:25647
const XML_NODE * xmlFirstChild(const XML_NODE *node)
Definition: xmlparse.c:1453
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:5885
SCIP_RETCODE SCIPrecalcRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30651
SCIP_RETCODE SCIPchgVarLbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35220
SCIP_Real SCIPlpGetPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12648
#define SCIP_DECL_PRICEREXITSOL(x)
Definition: type_pricer.h:92
int SCIPgetPtrarrayMaxIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:47200
int SCIPpresolGetNFixedVars(SCIP_PRESOL *presol)
Definition: presol.c:671
SCIP_RETCODE SCIPnlpiSetMessageHdlr(SCIP_NLPI *nlpi, SCIP_MESSAGEHDLR *messagehdlr)
Definition: nlpi.c:717
SCIP_RETCODE SCIPgetOrigVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
Definition: scip.c:11996
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:32537
SCIP_RETCODE SCIPvarsGetActiveVars(SCIP_SET *set, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
Definition: var.c:11313
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:383
SCIP_RETCODE SCIPwriteParam(SCIP *scip, SCIP_PARAM *param, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: scip.c:4907
SCIP_RETCODE SCIPgetNLPVarsNonlinearity(SCIP *scip, int *nlcount)
Definition: scip.c:30946
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
Definition: scip.c:8656
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:3393
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
Definition: scip.c:1228
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:9001
void SCIPprintReal(SCIP *scip, FILE *file, SCIP_Real val, int width, int precision)
Definition: scip.c:45444
SCIP_DECL_CONSSEPASOL(ConshdlrSubtour::scip_sepasol)
SCIP_RETCODE SCIPsetPricerExit(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICEREXIT((*pricerexit)))
Definition: scip.c:5554
#define SCIP_DECL_SEPAEXECLP(x)
Definition: type_sepa.h:115
SCIP_RETCODE SCIPchgVarUbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21825
static SCIP_RETCODE exitPresolve(SCIP *scip, SCIP_Bool solved, SCIP_Bool *infeasible)
Definition: scip.c:13936
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:17527
int nimplvars
Definition: struct_prob.h:64
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:511
void SCIPresetReoptSolMarks(SCIP *scip)
Definition: scip.c:17017
SCIP_RETCODE SCIPsetPricerExitsol(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICEREXITSOL((*pricerexitsol)))
Definition: scip.c:5602
SCIP_Real SCIPconshdlrGetStrongBranchPropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4659
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip.h:21933
SCIP_Real SCIPgetVarMultaggrUbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23468
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:44895
SCIP_Bool probingsolvedlp
Definition: struct_tree.h:222
int limit_maxsol
Definition: struct_set.h:272
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip.c:45519
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:31110
int SCIPgetNCutsFoundRound(SCIP *scip)
Definition: scip.c:41969
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:4947
SCIP_Longint SCIPbranchruleGetNExternCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2026
SCIP_CONS ** SCIPgetConss(SCIP *scip)
Definition: scip.c:12725
SCIP_RETCODE SCIPsetNLPIntPar(SCIP *scip, SCIP_NLPPARAM type, int ival)
Definition: scip.c:31397
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:675
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:29992
SCIP_RETCODE SCIPchgVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21611
SCIP_RETCODE SCIPsetIncludeConcsolverType(SCIP_SET *set, SCIP_CONCSOLVERTYPE *concsolvertype)
Definition: set.c:4038
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2903
int npresolroundsext
Definition: struct_stat.h:220
int SCIPgetNPresols(SCIP *scip)
Definition: scip.c:7011
SCIP_Real constant
Definition: struct_var.h:176
SCIP_Bool conf_enable
Definition: struct_set.h:184
SCIP_Real SCIPfeasFrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:46247
SCIP_RETCODE SCIPsetNLPStringPar(SCIP *scip, SCIP_NLPPARAM type, const char *sval)
Definition: scip.c:31509
SCIP_Bool SCIPsetIsNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5656
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45751
SCIP_NODE ** siblings
Definition: struct_tree.h:182
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:23568
int SCIPnodeGetDepth(SCIP_NODE *node)
Definition: tree.c:7153
SCIP_PRESOL ** presols
Definition: struct_set.h:72
SCIP_RETCODE SCIPconstructLP(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:28810
void SCIPconflicthdlrSetExitsol(SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)))
Definition: conflict.c:703
int SCIPdivesetGetNSolutionCalls(SCIP_DIVESET *diveset)
Definition: heur.c:392
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:36244
methods for creating output for visualization tools (VBC, BAK)
SCIP_CLOCK * copyclock
Definition: struct_stat.h:156
nodereopt branching rule
#define SCIP_LONGINT_MAX
Definition: def.h:121
#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:952
SCIP_RETCODE SCIPcaptureDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:9605
SCIP_RETCODE SCIPcreateLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37047
int SCIPptrarrayGetMinIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:4608
SCIP_RETCODE SCIPnlpGetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int *ival)
Definition: nlp.c:6014
SCIP_Real SCIPdivesetGetAvgSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:452
int SCIPcutpoolGetMaxNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:862
SCIP_RETCODE SCIPmarkRelaxSolInvalid(SCIP *scip)
Definition: scip.c:19701
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:676
SCIP_DECL_CONSDELETE(ConshdlrSubtour::scip_delete)
SCIP_Real rootlpbestestimate
Definition: struct_stat.h:136
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip.h:21937
static void printCompressionStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43897
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:73
SCIP_RETCODE SCIPvarUpdatePseudocost(SCIP_VAR *var, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real solvaldelta, SCIP_Real objdelta, SCIP_Real weight)
Definition: var.c:13679
SCIP_Real SCIPconflictGetGlobalApplTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:4408
#define SCIPsetFreeBufferArray(set, ptr)
Definition: set.h:1841
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
Definition: scip.c:21548
enum SCIP_LPSolStat SCIP_LPSOLSTAT
Definition: type_lp.h:42
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:696
#define BMSfreeMemory(ptr)
Definition: memory.h:100
SCIP_RETCODE SCIPaddCurrentSol(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool *stored)
Definition: scip.c:39709
void SCIPvarAdjustLb(SCIP_VAR *var, SCIP_SET *set, SCIP_Real *lb)
Definition: var.c:6052
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:6625
#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:21890
#define SCIPdebugPrintCons(x, y, z)
Definition: pub_message.h:83
SCIP_Bool SCIPconsIsLockedNeg(SCIP_CONS *cons)
Definition: cons.c:8210
int maxdepth
Definition: struct_stat.h:211
SCIP_Bool SCIPisTransformed(SCIP *scip)
Definition: scip.c:1010
SCIP_RETCODE SCIPcutpoolFree(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:439
int SCIPgetNLPBranchCands(SCIP *scip)
Definition: scip.c:36161
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
Definition: scip.c:29087
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:23627
SCIP_Bool SCIPpressedCtrlC(SCIP *scip)
Definition: scip.c:1125
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: scip.c:7367
SCIP_RETCODE SCIPsetConshdlrDelvars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: scip.c:6412
SCIP_RETCODE SCIPdropRowEvent(SCIP *scip, SCIP_ROW *row, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:40401
SCIP_RETCODE SCIPvarChgBranchDirection(SCIP_VAR *var, SCIP_BRANCHDIR branchdirection)
Definition: var.c:11126
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:16992
void SCIPvisualExit(SCIP_VISUAL *visual, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:176
static void printLPStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43927
SCIP_RETCODE SCIPsetRealParam(SCIP *scip, const char *name, SCIP_Real value)
Definition: scip.c:4741
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
Definition: cons.c:8150
SCIP_Longint SCIPconshdlrGetNCheckCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4739
SCIP_Bool branch_forceall
Definition: struct_set.h:162
#define SCIP_LONGINT_MIN
Definition: def.h:122
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:7855
#define SCIP_DECL_DIVESETGETSCORE(x)
Definition: type_heur.h:147
SCIP_RETCODE SCIPchgStringParam(SCIP *scip, SCIP_PARAM *param, const char *value)
Definition: scip.c:4831
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
Definition: scip.c:6274
SCIP_Real SCIPconflictGetPseudoTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:8032
SCIP_NODE * SCIPgetRootNode(SCIP *scip)
Definition: scip.c:40472
SCIP_CLOCK * nlpsoltime
Definition: struct_stat.h:155
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip.c:1260
SCIP_SOL ** SCIPgetPartialSols(SCIP *scip)
Definition: scip.c:39979
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:506
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:36357
SCIP_Longint SCIPrelaxGetNCalls(SCIP_RELAX *relax)
Definition: relax.c:553
int SCIPreoptGetLastRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4902
SCIP_RETCODE SCIPchgVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21964
#define SCIPdebugMsg
Definition: scip.h:451
#define SCIP_DECL_NODESELEXITSOL(x)
Definition: type_nodesel.h:94
#define SCIP_DECL_CONFLICTEXIT(x)
Definition: type_conflict.h:85
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:4202
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:7403
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip.c:18616
#define SCIP_DECL_COMPRINIT(x)
Definition: type_compr.h:65
SCIP_RETCODE SCIPcopyParamSettings(SCIP *sourcescip, SCIP *targetscip)
Definition: scip.c:3492
SCIP_Bool SCIPisRootLPRelax(SCIP *scip)
Definition: scip.c:29001
SCIP_Longint SCIPconflictGetNPropReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:4468
SCIP_Bool SCIPisSumZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:46050
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
Definition: lp.c:12452
SCIP_VISUAL * visual
Definition: struct_stat.h:162
SCIP_Real SCIPsetCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5720
int lastnpresoladdconss
Definition: struct_stat.h:237
int SCIPgetIntarrayMinIdx(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:46925
SCIP_RETCODE SCIPaddLinearCoefToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:31992
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint nlpbestsolsfound
Definition: struct_stat.h:94
SCIP_CUT ** SCIPgetPoolCuts(SCIP *scip)
Definition: scip.c:34005
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
Definition: scip.c:6458
SCIP_RETCODE SCIPfreeReoptSolve(SCIP *scip)
Definition: scip.c:16807
SCIP_Longint SCIPcolGetStrongbranchLPAge(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4585
SCIP_Real SCIPgetPresolvingTime(SCIP *scip)
Definition: scip.c:45201
SCIP_Real SCIPsetGetHugeValue(SCIP_SET *set)
Definition: set.c:5396
SCIP_Real dualzeroittime
Definition: struct_stat.h:123
#define SCIP_DECL_CONSINITLP(x)
Definition: type_cons.h:217
internal methods for LP management
SCIP_RETCODE SCIPensureBlockMemoryArray_call(SCIP *scip, void **arrayptr, size_t elemsize, int *arraysize, int minsize)
Definition: scip.c:45617
SCIP_Real SCIPrelaxGetTime(SCIP_RELAX *relax)
Definition: relax.c:543
SCIP_Bool SCIPsetIsFeasFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6074
#define SCIP_DECL_CONCSOLVERDESTROYINST(x)
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44425
SCIP_Real SCIPpresolGetSetupTime(SCIP_PRESOL *presol)
Definition: presol.c:651
int SCIPbranchcandGetNPrioPseudoCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:831
void SCIPsetSortHeursName(SCIP_SET *set)
Definition: set.c:4185
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
Definition: cons.c:7942
int nbranchrules
Definition: struct_set.h:116
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17518
SCIP_RETCODE SCIPactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28585
SCIP_PROB * origprob
Definition: struct_scip.h:70
SCIP_Real SCIPgetAvgCutoffs(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43096
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:1336
int SCIPgetNContVars(SCIP *scip)
Definition: scip.c:11811
SCIP_Bool SCIPtreeIsFocusNodeLPConstructed(SCIP_TREE *tree)
Definition: tree.c:8066
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:555
SCIP_Real SCIPconflictGetVarUb(SCIP_CONFLICT *conflict, SCIP_VAR *var)
Definition: conflict.c:3403
SCIP_Real SCIPgetRowFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30693
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:27146
SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
Definition: scip.c:9839
SCIP_Real SCIPgetObjNorm(SCIP *scip)
Definition: scip.c:11284
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip.c:31042
int SCIPconshdlrGetSepaPriority(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4969
SCIP_DISP * SCIPfindDisp(SCIP *scip, const char *name)
Definition: scip.c:9308
int SCIPreoptGetNTotalInfNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4982
SCIP_Real SCIPepsilon(SCIP *scip)
Definition: scip.c:45246
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:17832
SCIP_DECL_EVENTINITSOL(EventhdlrNewSol::scip_initsol)
SCIP_RETCODE SCIPcreateOrigSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37242
SCIP_Bool SCIPlpIsRootLPRelax(SCIP_LP *lp)
Definition: lp.c:16702
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:23516
SCIP_Bool objsqrnormunreliable
Definition: struct_lp.h:331
#define SCIP_PRESOLTIMING_FAST
Definition: type_timing.h:43
SCIP_RETCODE SCIPlpRecordOldRowSideDive(SCIP_LP *lp, SCIP_ROW *row, SCIP_SIDETYPE sidetype)
Definition: lp.c:15339
SCIP_VAR ** vars
Definition: struct_var.h:185
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:26746
SCIP_Real SCIPsolGetOrigObj(SCIP_SOL *sol)
Definition: sol.c:2319
static void printConstraintStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43444
SCIP_RETCODE SCIPgetSiblings(SCIP *scip, SCIP_NODE ***siblings, int *nsiblings)
Definition: scip.c:40568
SCIP_Real SCIPgetLowerboundRoot(SCIP *scip)
Definition: scip.c:42368
int SCIPpropGetNPresolCalls(SCIP_PROP *prop)
Definition: prop.c:1212
int SCIPrealarrayGetMinIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:3535
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:45316
SCIP_RETCODE SCIPsetIncludeSepa(SCIP_SET *set, SCIP_SEPA *sepa)
Definition: set.c:3872
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30491
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:23391
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:17117
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:46223
SCIP_Real SCIPcomputeVarLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23412
int nrootintfixings
Definition: struct_stat.h:199
SCIP_RETCODE SCIPmarkRelaxSolValid(SCIP *scip)
Definition: scip.c:19679
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30525
SCIP_RETCODE SCIPsetIncludeCompr(SCIP_SET *set, SCIP_COMPR *compr)
Definition: set.c:4200
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:40817
SCIP_Real SCIPconflictGetStrongbranchTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:7765
SCIP_RETCODE SCIPtransformVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
Definition: scip.c:18525
SCIP_RETCODE SCIPsetSetStringParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, const char *value)
Definition: set.c:3194
SCIP_Longint SCIPconflictGetNAppliedLocalLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:2547
internal methods for collecting primal CIP solutions and primal informations
SCIP_RETCODE SCIPcreateNlRowFromRow(SCIP *scip, SCIP_NLROW **nlrow, SCIP_ROW *row)
Definition: scip.c:31855
SCIP_Real SCIPsolGetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
Definition: sol.c:1286
SCIP_RETCODE SCIPsetBoolarrayVal(SCIP *scip, SCIP_BOOLARRAY *boolarray, int idx, SCIP_Bool val)
Definition: scip.c:47039
#define SCIP_DECL_COMPRFREE(x)
Definition: type_compr.h:57
SCIP_Longint SCIPconflictGetNPseudoConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8062
SCIP_Bool reopt_enable
Definition: struct_set.h:442
SCIP_RETCODE SCIPconflictstoreCreate(SCIP_CONFLICTSTORE **conflictstore, SCIP_SET *set)
SCIP_Real SCIPgetVarPseudocostScore(SCIP *scip, SCIP_VAR *var, SCIP_Real solval)
Definition: scip.c:25882
SCIP_Bool SCIPisRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46501
SCIP_RETCODE SCIPchgChildPrio(SCIP *scip, SCIP_NODE *child, SCIP_Real priority)
Definition: scip.c:13428
SCIP_CONSSETCHG * addconssetchg
Definition: struct_cons.h:48
SCIP_RETCODE SCIPscaleVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real scale)
Definition: scip.c:24792
int SCIPconshdlrGetNFixedVars(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4859
SCIP_Longint SCIPconflictGetNDualrayInfGlobal(SCIP_CONFLICT *conflict)
Definition: conflict.c:7785
enum SCIP_ParamSetting SCIP_PARAMSETTING
Definition: type_paramset.h:56
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:46211
SCIP_Bool SCIPconsIsGlobal(SCIP_CONS *cons)
Definition: cons.c:8110
void SCIPpricerSetPriority(SCIP_PRICER *pricer, SCIP_SET *set, int priority)
Definition: pricer.c:580
void SCIPprobSetObjIntegral(SCIP_PROB *prob)
Definition: prob.c:1454
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
Definition: cons.c:8180
SCIP_RETCODE SCIPboolarraySetVal(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Bool val)
Definition: misc.c:4187
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:9136
#define SCIP_DECL_NODESELINIT(x)
Definition: type_nodesel.h:64
int SCIPlpGetNCols(SCIP_LP *lp)
Definition: lp.c:16574
SCIP_Real primalzeroittime
Definition: struct_stat.h:122
SCIP_RETCODE SCIPconstructSyncstore(SCIP *scip)
Definition: scip.c:41001
SCIP_VAR * var
Definition: struct_var.h:177
SCIP_RETCODE SCIPreoptResetActiveConss(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat)
Definition: reopt.c:8195
SCIP_Real SCIPvarGetUbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12308
int nrootboundchgs
Definition: struct_stat.h:197
SCIP_RETCODE SCIPsetSetFeastol(SCIP_SET *set, SCIP_Real feastol)
Definition: set.c:5142
SCIP_RETCODE SCIPclearRealarray(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:46705
SCIP_DIALOGHDLR * dialoghdlr
Definition: struct_scip.h:64
int SCIPgetNConshdlrs(SCIP *scip)
Definition: scip.c:6565
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:2773
#define SCIP_DECL_SEPACOPY(x)
Definition: type_sepa.h:47
int neventhdlrs
Definition: struct_set.h:112
SCIP_Bool SCIPsetIsGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5616
SCIP_HISTORY * glbhistorycrun
Definition: struct_stat.h:160
internal methods for propagators
SCIP_Bool SCIPisRelLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46475
int SCIPreoptGetNNodes(SCIP_REOPT *reopt, SCIP_NODE *node)
Definition: reopt.c:5695
int SCIPpresolGetNChgVarTypes(SCIP_PRESOL *presol)
Definition: presol.c:691
SCIP_RETCODE SCIPprintBranchingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44597
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:16662
SCIP_Bool reopt_storevarhistory
Definition: struct_set.h:453
SCIP_Longint SCIPgetNDualResolveLPIterations(SCIP *scip)
Definition: scip.c:41667
const char * SCIPgetProbName(SCIP *scip)
Definition: scip.c:10724
SCIP_RETCODE SCIPclearPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:47139
SCIP_RETCODE SCIPcreateWallClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:44878
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
Definition: lp.c:16522
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:1404
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2997
int SCIPtreeGetFocusDepth(SCIP_TREE *tree)
Definition: tree.c:8028
SCIP_Real SCIPvarGetVSIDSCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15228
SCIP_NLPI ** nlpis
Definition: struct_set.h:85
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:2409
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:25559
SCIP_Real SCIPgetBranchScore(SCIP *scip, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: scip.c:36583
#define SCIP_DECL_DIALOGDESC(x)
Definition: type_dialog.h:73
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
Definition: scip.c:26695
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:601
SCIP_Bool SCIPsetIsEfficacious(SCIP_SET *set, SCIP_Bool root, SCIP_Real efficacy)
Definition: set.c:6392
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:8177
SCIP_RETCODE SCIPcopyOrigConss(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool enablepricing, SCIP_Bool *valid)
Definition: scip.c:2863
SCIP_Real SCIPgetVarBdAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: scip.c:19403
SCIP_Real * vals
Definition: struct_lp.h:218
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:402
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:5567
SCIP_RETCODE SCIPlinkNLPSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37698
static SCIP_RETCODE initSolve(SCIP *scip, SCIP_Bool solved)
Definition: scip.c:14838
SCIP_RETCODE SCIPintarrayFree(SCIP_INTARRAY **intarray)
Definition: misc.c:3598
int SCIPgetNFixedVars(SCIP *scip)
Definition: scip.c:11948
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:159
SCIP_Bool SCIPisLPConstructed(SCIP *scip)
Definition: scip.c:28787
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: scip.c:46434
SCIP_Real SCIPsetDualfeasFloor(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6298
int SCIPconshdlrGetNChgBds(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4889
SCIP_Bool SCIPisLPRelax(SCIP *scip)
Definition: scip.c:28875
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
Definition: scip.c:12325
SCIP_RETCODE SCIPsetConflicthdlrInit(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTINIT((*conflictinit)))
Definition: scip.c:6689
void * SCIPgetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx)
Definition: scip.c:47152
SCIP_RETCODE SCIPsetInitPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4679
SCIP_RETCODE SCIPenableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:27987
int SCIPtreeGetNChildren(SCIP_TREE *tree)
Definition: tree.c:7928
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:2212
SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
Definition: scip.c:11905
SCIP_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
Definition: scip.c:27446
SCIP_NODE * SCIPtreeGetBestLeaf(SCIP_TREE *tree)
Definition: tree.c:6912
SCIP_RETCODE SCIPsetFree(SCIP_SET **set, BMS_BLKMEM *blkmem)
Definition: set.c:2516
SCIP_RETCODE SCIPsetReoptCompression(SCIP *scip, SCIP_REOPTNODE **representation, int nrepresentatives, SCIP_Bool *success)
Definition: scip.c:16518
SCIP_RETCODE SCIPrealarrayIncVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real incval)
Definition: misc.c:3517
int SCIPbranchcandGetNExternCands(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:476
SCIP_Bool SCIPisCharParamValid(SCIP *scip, SCIP_PARAM *param, const char value)
Definition: scip.c:4814
void SCIPclearDiveBoundChanges(SCIP *scip)
Definition: scip.c:36095
int SCIPgetNPrioLPBranchCands(SCIP *scip)
Definition: scip.c:36199
SCIP_Real avgnnz
Definition: struct_stat.h:114
#define SCIP_DECL_CONCSOLVERSTOP(x)
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
Definition: scip.c:25045
SCIP_Real SCIPgetFirstLPDualboundRoot(SCIP *scip)
Definition: scip.c:42392
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:1120
struct SCIP_NodeselData SCIP_NODESELDATA
Definition: type_nodesel.h:38
SCIP_RETCODE SCIPresetParams(SCIP *scip)
Definition: scip.c:4970
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:659
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
Definition: scip.c:23815
SCIP_RETCODE SCIPnlpStartDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6117
SCIP_Real SCIPlpGetRootObjval(SCIP_LP *lp)
Definition: lp.c:16712
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:7501
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
Definition: scip.c:29262
SCIP_DIALOG * SCIPgetRootDialog(SCIP *scip)
Definition: scip.c:9655
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17176
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:4714
union SCIP_Var::@12 data
int lppos
Definition: struct_lp.h:228
SCIP_RETCODE SCIPenableConsCompression(SCIP *scip)
Definition: scip.c:1821
void SCIPprobSetInitsol(SCIP_PROB *prob, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: prob.c:361
void SCIProwForceSort(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:5979
SCIP_Bool SCIPsetIsLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5562
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
Definition: var.c:11524
SCIP_READER ** SCIPgetReaders(SCIP *scip)
Definition: scip.c:5340
SCIP_RETCODE SCIPsetReadParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *filename)
Definition: set.c:3209
SCIP_Real SCIPvarGetObjLP(SCIP_VAR *var)
Definition: var.c:12192
SCIP_RETCODE SCIPbranchcandAddExternCand(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: branch.c:538
char ** extcodedescs
Definition: struct_set.h:90
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
Definition: scip.c:6094
SCIP_Real SCIPtreeCalcNodeselPriority(SCIP_TREE *tree, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
Definition: tree.c:5091
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:153
int SCIPcliquetableGetNCliques(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3417
SCIP_CLOCK * strongpropclock
Definition: struct_stat.h:157
SCIP_RETCODE SCIPsetRelaxFree(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: scip.c:7138
SCIP_DECL_EVENTFREE(EventhdlrNewSol::scip_free)
SCIP_RETCODE SCIPvarChgType(SCIP_VAR *var, SCIP_VARTYPE vartype)
Definition: var.c:5750
void SCIPprobSetCopy(SCIP_PROB *prob, SCIP_DECL_PROBCOPY((*probcopy)))
Definition: prob.c:383
int npresolchgcoefs
Definition: struct_stat.h:229
SCIP_Bool SCIPsepastoreIsCutApplicable(SCIP_SET *set, SCIP_ROW *cut)
Definition: sepastore.c:1309
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:9557
SCIP_Bool SCIPnlpHasContinuousNonlinearity(SCIP_NLP *nlp)
Definition: nlp.c:5859
void SCIPprintMemoryDiagnostic(SCIP *scip)
Definition: scip.c:45643
#define SCIP_DECL_BRANCHINIT(x)
Definition: type_branch.h:68
int npresolchgvartypes
Definition: struct_stat.h:223
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:25384
SCIP_RETCODE SCIPdelVar(SCIP *scip, SCIP_VAR *var, SCIP_Bool *deleted)
Definition: scip.c:11429
#define SCIP_DECL_DISPINIT(x)
Definition: type_disp.h:87
int SCIPdivesetGetMaxSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:442
static SCIP_RETCODE getCopyMemlimit(SCIP *sourcescip, SCIP_Real *memorylimit)
Definition: scip.c:4059
SCIP_RETCODE SCIPreoptGetSolsRun(SCIP_REOPT *reopt, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: reopt.c:5411
void SCIPrandomFree(SCIP_RANDNUMGEN **randnumgen)
Definition: misc.c:8710
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:5789
SCIP_Bool SCIPisCutEfficacious(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip.c:33761
SCIP_CONSHDLR * SCIPsetFindConshdlr(SCIP_SET *set, const char *name)
Definition: set.c:3631
SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
Definition: scip.c:10898
SCIP_Bool SCIPisBoolParamValid(SCIP *scip, SCIP_PARAM *param, SCIP_Bool value)
Definition: scip.c:4582
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:7722
SCIP_RETCODE SCIPchgRowLhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newlhs)
Definition: scip.c:34745
SCIP_Real SCIPvarGetImplRedcost(SCIP_VAR *var, SCIP_SET *set, SCIP_Bool varfixing, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_LP *lp)
Definition: var.c:12771
SCIP_Bool SCIPtreeProbing(SCIP_TREE *tree)
Definition: tree.c:7985
SCIP_RETCODE SCIPaddReoptDualBndchg(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound, SCIP_Real oldbound)
Definition: scip.c:16292
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:7863
SCIP_RETCODE SCIPsolveProbingRelax(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip.c:35834
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:204
#define SCIP_DECL_RELAXEXIT(x)
Definition: type_relax.h:71
SCIP_RETCODE SCIPsetIncludeHeur(SCIP_SET *set, SCIP_HEUR *heur)
Definition: set.c:4126
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:17733
int SCIPgetNNLPVars(SCIP *scip)
Definition: scip.c:30924
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:3005
void SCIPpropSetExit(SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: prop.c:789
SCIP_Real barrierzeroittime
Definition: struct_stat.h:124
SCIP_RETCODE SCIPsetConshdlrGetDiveBdChgs(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: scip.c:6527
SCIP_Real lb
Definition: struct_lp.h:127
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition: scip.c:37295
SCIP_NLPTERMSTAT SCIPgetNLPTermstat(SCIP *scip)
Definition: scip.c:31240
BMS_BUFMEM * SCIPbuffer(SCIP *scip)
Definition: scip.c:45534
static void printConstraintTimingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43492
SCIP_Bool SCIPsetIsParamFixed(SCIP_SET *set, const char *name)
Definition: set.c:2818
int cutoffdepth
Definition: struct_tree.h:210
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:7277
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
Definition: scip.c:1047
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:7568
enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL
Definition: type_misc.h:44
int lastnpresolfixedvars
Definition: struct_stat.h:231
SCIP_RETCODE SCIPdelRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34162
SCIP_RETCODE SCIPvarChgBranchPriority(SCIP_VAR *var, int branchpriority)
Definition: var.c:10996
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:2269
SCIP_CONFLICTHDLR ** SCIPgetConflicthdlrs(SCIP *scip)
Definition: scip.c:6766
SCIP_Real SCIPvarGetPseudocost(SCIP_VAR *var, SCIP_STAT *stat, SCIP_Real solvaldelta)
Definition: var.c:13777
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:28933
SCIP_Bool SCIPisSumRelGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46566
SCIP_RETCODE SCIPsetObjIntegral(SCIP *scip)
Definition: scip.c:11162
void SCIPrelaxSetFree(SCIP_RELAX *relax, SCIP_DECL_RELAXFREE((*relaxfree)))
Definition: relax.c:391
void SCIPprobSetObjsense(SCIP_PROB *prob, SCIP_OBJSENSE objsense)
Definition: prob.c:1406
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:639
SCIP_Real SCIPgetVarUbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:34868
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:5341
SCIP_Longint nobjleaves
Definition: struct_stat.h:73
SCIP_AGGREGATE aggregate
Definition: struct_var.h:224
SCIP_Longint SCIPconcsolverGetNSolsRecvd(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:528
SCIP_RETCODE SCIPsetConsRemovable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool removable)
Definition: scip.c:27624
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:6605
#define SCIP_DECL_CONFLICTINITSOL(x)
Definition: type_conflict.h:96
SCIP_RETCODE SCIPcreateCutpool(SCIP *scip, SCIP_CUTPOOL **cutpool, int agelimit)
Definition: scip.c:34065
SCIP_Real SCIPsolGetObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: sol.c:1480
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:4001
SCIP_Longint npssolsfound
Definition: struct_stat.h:92
int SCIPgetNCutsApplied(SCIP *scip)
Definition: scip.c:41987
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:15057
SCIP_RETCODE SCIPsetSetSubscipsOff(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: set.c:3289
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
Definition: scip.c:8108
SCIP_Bool probingobjchanged
Definition: struct_tree.h:224
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:7393
SCIP_Real sbdown
Definition: struct_lp.h:142
static void printPropagatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43542
void SCIPmarkRowNotRemovableLocal(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30455
git hash methods
int SCIPpricestoreGetNVarsApplied(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:663
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip.c:15777
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
Definition: scip.c:5997
SCIP_RETCODE SCIProwChgLhs(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real lhs)
Definition: lp.c:5486
static void printSolutionStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44114
void SCIPsetSetPriorityNlpi(SCIP_SET *set, SCIP_NLPI *nlpi, int priority)
Definition: set.c:4633
SCIP_PROP ** SCIPgetProps(SCIP *scip)
Definition: scip.c:7801
void SCIPsetReinsertConshdlrSepaPrio(SCIP_SET *set, SCIP_CONSHDLR *conshdlr, int oldpriority)
Definition: set.c:3546
#define SCIP_DECL_BRANCHCOPY(x)
Definition: type_branch.h:52
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1181
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:438
SCIP_RETCODE SCIPcreateClock(SCIP *scip, SCIP_CLOCK **clck)
Definition: scip.c:44844
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:1504
#define SCIP_DECL_CONFLICTEXEC(x)
SCIP_Real mincopytime
Definition: struct_stat.h:126
SCIP_Bool SCIPisRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46514
SCIP_RETCODE SCIPsetNodeselExitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: scip.c:8856
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:33058
SCIP_RETCODE SCIPdeactivatePricer(SCIP *scip, SCIP_PRICER *pricer)
Definition: scip.c:5712
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:7794
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:1758
SCIP_RETCODE SCIPsetCopyPlugins(SCIP_SET *sourceset, SCIP_SET *targetset, SCIP_Bool copyreaders, SCIP_Bool copypricers, SCIP_Bool copyconshdlrs, SCIP_Bool copyconflicthdlrs, SCIP_Bool copypresolvers, SCIP_Bool copyrelaxators, SCIP_Bool copyseparators, SCIP_Bool copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copynlpis, SCIP_Bool *allvalid)
Definition: set.c:832
int npresolroundsmed
Definition: struct_stat.h:219
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
Definition: scip.c:8140
SCIP_RETCODE SCIPsetComprCopy(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPRCOPY((*comprcopy)))
Definition: scip.c:8278
SCIP_RETCODE SCIPbranchVar(SCIP *scip, SCIP_VAR *var, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip.c:36737
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:32280
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:15590
SCIP_Real SCIPdualfeasCeil(SCIP *scip, SCIP_Real val)
Definition: scip.c:46396
SCIP_RETCODE SCIPsolveDiveNLP(SCIP *scip)
Definition: scip.c:31759
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:102
SCIP_RETCODE SCIPvarChgUbLazy(SCIP_VAR *var, SCIP_SET *set, SCIP_Real lazyub)
Definition: var.c:7027
SCIP_RETCODE SCIPfreeCutpool(SCIP *scip, SCIP_CUTPOOL **cutpool)
Definition: scip.c:34096
SCIP_RETCODE SCIPsetChgBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Bool value)
Definition: set.c:2953
SCIP_CONSHDLR ** conshdlrs_enfo
Definition: struct_set.h:69
SCIP_RETCODE SCIPcutpoolAddNewRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: cutpool.c:515
int lastnpresoladdholes
Definition: struct_stat.h:235
void SCIPvarMergeHistories(SCIP_VAR *targetvar, SCIP_VAR *othervar, SCIP_STAT *stat)
Definition: var.c:4201
int prevrunnvars
Definition: struct_stat.h:201
SCIP_Real SCIPgetVarPseudocostVariance(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: scip.c:25755
SCIP_Bool SCIPisSumRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46553
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30473
int SCIPreoptGetFirstRestarts(SCIP_REOPT *reopt)
Definition: reopt.c:4892
SCIP_RETCODE SCIPgetBinvarRepresentatives(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **repvars, SCIP_Bool *negated)
Definition: scip.c:18780
internal methods for storing and manipulating the main problem
SCIP_Real SCIPsetLpfeastol(SCIP_SET *set)
Definition: set.c:5446
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:41685
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:32207
SCIP_Bool SCIPisParamFixed(SCIP *scip, const char *name)
Definition: scip.c:4338
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
Definition: scip.c:28737
void SCIPstatResetCurrentRun(SCIP_STAT *stat, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Bool solved)
Definition: stat.c:483
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:12410
SCIP_CONSHDLR ** SCIPgetConshdlrs(SCIP *scip)
Definition: scip.c:6554
SCIP_Bool SCIPboundchgIsRedundant(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16489
SCIP_Real SCIPvarGetLbOriginal(SCIP_VAR *var)
Definition: var.c:17112
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:54
SCIP_Bool SCIPsyncstoreIsInitialized(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:775
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:40836
void SCIPstoreSolutionGap(SCIP *scip)
Definition: scip.c:44781
SCIP_Real SCIPgetDualsolLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPbranchruleGetSetupTime(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1996
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:1880
SCIP_RETCODE SCIPgetReoptChildIDs(SCIP *scip, SCIP_NODE *node, unsigned int *ids, int idssize, int *nids)
Definition: scip.c:16383
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:14229
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:5434
SCIP_RETCODE SCIPchgVarLbLazy(SCIP *scip, SCIP_VAR *var, SCIP_Real lazylb)
Definition: scip.c:22051
SCIP_RETCODE SCIPsetEventhdlrFree(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTFREE((*eventfree)))
Definition: scip.c:8572
SCIP_INTERRUPT * interrupt
Definition: struct_scip.h:63
SCIP_RETCODE SCIPrecalcNlRowPseudoActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32386
SCIP_RETCODE SCIPsetEventhdlrCopy(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTCOPY((*eventcopy)))
Definition: scip.c:8558
SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:34901
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
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: scip.c:8060
SCIP_Real SCIPbranchGetBranchingPoint(SCIP_SET *set, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real suggestion)
Definition: branch.c:2213
SCIP_Longint lpcount
Definition: struct_stat.h:168
SCIP_RETCODE SCIPrelaxationFree(SCIP_RELAXATION **relaxation, BMS_BLKMEM *blkmem, SCIP_PRIMAL *primal)
Definition: relax.c:627
SCIP_Real SCIPpropGetSetupTime(SCIP_PROP *prop)
Definition: prop.c:980
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45764
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:13030
int SCIPreoptGetNRestartsGlobal(SCIP_REOPT *reopt)
Definition: reopt.c:4862
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:31086
SCIP_CONS * SCIPprobFindCons(SCIP_PROB *prob, const char *name)
Definition: prob.c:2073
SCIP_RETCODE SCIPwriteNLP(SCIP *scip, const char *filename)
Definition: scip.c:31537
#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:25434
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:7493
SCIP_RETCODE SCIPseparateCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_RESULT *result)
Definition: scip.c:34183
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:35477
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:5801
#define SCIP_DECL_COMPRCOPY(x)
Definition: type_compr.h:49
SCIP_Bool misc_resetstat
Definition: struct_set.h:344
SCIP_RETCODE SCIPsetWriteParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: set.c:3223
SCIP_Longint SCIPconshdlrGetNRespropCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4749
#define SCIP_DECL_CONSPARSE(x)
Definition: type_cons.h:792
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:97
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:39936
SCIP_Bool SCIPrelaxationIsSolZero(SCIP_RELAXATION *relaxation)
Definition: relax.c:654
SCIP_RETCODE SCIPfreeProb(SCIP *scip)
Definition: scip.c:10361
SCIP_RETCODE SCIPreadProb(SCIP *scip, const char *filename, const char *extension)
Definition: scip.c:9998
int SCIPgetNCutsFound(SCIP *scip)
Definition: scip.c:41951
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:13111
SCIP_COL ** cols
Definition: struct_lp.h:216
SCIP_Bool misc_printreason
Definition: struct_set.h:349
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
SCIP_Bool SCIPtreeInRepropagation(SCIP_TREE *tree)
Definition: tree.c:8076
SCIP_RETCODE SCIPsetSepaExit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXIT((*sepaexit)))
Definition: scip.c:7415
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:4199
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:647
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:38044
SCIP_RETCODE SCIPaddDialogHistoryLine(SCIP *scip, const char *inputline)
Definition: scip.c:9707
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:22345
SCIP_RETCODE SCIPfixVarProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval)
Definition: scip.c:35337
SCIP_Bool SCIPsetIsSumRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6517
SCIP_Bool SCIPisFracIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:45925
SCIP_Bool propspresolsorted
Definition: struct_set.h:141
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:6047
#define BMSdisplayMemory()
Definition: memory.h:109
SCIP_RETCODE SCIPrecalcRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30597
SCIP_RETCODE SCIPboolarrayCreate(SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3920
int SCIPgetNConflicthdlrs(SCIP *scip)
Definition: scip.c:6779
SCIP_Bool SCIPsetIsRelEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6407
SCIP_RETCODE SCIPreadSol(SCIP *scip, const char *filename)
Definition: scip.c:39167
SCIP_RETCODE SCIPeventqueueCreate(SCIP_EVENTQUEUE **eventqueue)
Definition: event.c:2056
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:26316
SCIP_RETCODE SCIPlinkPseudoSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37757
int npresolchgsides
Definition: struct_stat.h:230
#define SCIP_DECL_CONSDEACTIVE(x)
Definition: type_cons.h:653
void SCIPprobEnableConsCompression(SCIP_PROB *prob)
Definition: prob.c:2334
SCIP_CLOCK * pseudosoltime
Definition: struct_stat.h:152
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:16564
SCIP_RETCODE SCIPgetChildren(SCIP *scip, SCIP_NODE ***children, int *nchildren)
Definition: scip.c:40526
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:31901
SCIP_Real SCIPvarGetUbOriginal(SCIP_VAR *var)
Definition: var.c:17132
SCIP_RETCODE SCIPchgCharParam(SCIP *scip, SCIP_PARAM *param, char value)
Definition: scip.c:4773
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
Definition: lp.c:16420
static SCIP_RETCODE prepareReoptimization(SCIP *scip)
Definition: scip.c:15513
SCIP_Real SCIPgetDualbound(SCIP *scip)
Definition: scip.c:42302
SCIP_Bool random_permutevars
Definition: struct_set.h:367
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:3342
#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:18929
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:28523
SCIP_Bool SCIPsetIsDualfeasIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6274
SCIP_Bool SCIPisDualfeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46311
void SCIPinterruptRelease(SCIP_INTERRUPT *interrupt)
Definition: interrupt.c:128
SCIP_Longint SCIPsepaGetNCutoffs(SCIP_SEPA *sepa)
Definition: sepa.c:769
int lastnpresolchgbds
Definition: struct_stat.h:234
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:2332
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:23687
int repropdepth
Definition: struct_tree.h:211
SCIP_RETCODE SCIPchgCutoffboundDive(SCIP *scip, SCIP_Real newcutoffbound)
Definition: scip.c:34571
SCIP_Bool SCIPisDualSolAvailable(SCIP *scip, SCIP_Bool printreason)
Definition: scip.c:38700
SCIP_Longint SCIPconflictGetNPseudoReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8082
SCIP_RETCODE SCIPvarChgObjDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newobj)
Definition: var.c:5989
SCIP_Bool misc_allowobjprop
Definition: struct_set.h:358
static SCIP_RETCODE presolve(SCIP *scip, SCIP_Bool *unbounded, SCIP_Bool *infeasible)
Definition: scip.c:14530
#define SCIPfreeBufferArrayNull(scip, ptr)
Definition: scip.h:21938
SCIP_RETCODE SCIPsetBoolParam(SCIP *scip, const char *name, SCIP_Bool value)
Definition: scip.c:4567
unsigned int sbupvalid
Definition: struct_lp.h:179
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip.c:921
SCIP_Real SCIPrealarrayGetVal(SCIP_REALARRAY *realarray, int idx)
Definition: misc.c:3427
SCIP_RETCODE SCIPpresolve(SCIP *scip)
Definition: scip.c:15616
SCIP_CONS * SCIPfindOrigCons(SCIP *scip, const char *name)
Definition: scip.c:12536
SCIP_Real SCIPversion(void)
Definition: scip.c:554
int SCIPdivesetGetMaxDepth(SCIP_DIVESET *diveset)
Definition: heur.c:412
SCIP_HEUR * firstprimalheur
Definition: struct_stat.h:163
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
Definition: scip.c:33779
char sepa_cutselsubscip
Definition: struct_set.h:480
#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:1403
SCIP_RETCODE SCIPcopyCuts(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, int *ncutsadded)
Definition: scip.c:3056
SCIP_Real SCIPgetTransGap(SCIP *scip)
Definition: scip.c:42612
int SCIPfeof(SCIP_FILE *stream)
Definition: fileio.c:214
int SCIPgetNDisps(SCIP *scip)
Definition: scip.c:9332
SCIP_RETCODE SCIPgetReoptSolsRun(SCIP *scip, int run, SCIP_SOL **sols, int solssize, int *nsols)
Definition: scip.c:16991
SCIP_RETCODE SCIPsetEventhdlrInit(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTINIT((*eventinit)))
Definition: scip.c:8586
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:13826
SCIP_RETCODE SCIPchgVarBoundsDiveNLP(SCIP *scip, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: scip.c:31698
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:28252
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
Definition: fileio.c:187
SCIP_Bool SCIPisReoptEnabled(SCIP *scip)
Definition: scip.c:16981
int SCIPnlpGetNNlRows(SCIP_NLP *nlp)
Definition: nlp.c:5927
SCIP_Bool objisintegral
Definition: struct_prob.h:78
SCIP_RETCODE SCIPprintTransSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:38503
SCIP_Real SCIPgetConflictVarLb(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:27012
int SCIPintarrayGetMaxIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:3909
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
Definition: misc.c:9441
SCIP_Real SCIPnlpGetObjval(SCIP_NLP *nlp)
Definition: nlp.c:5577
SCIP_Longint SCIPgetNResolveLPIterations(SCIP *scip)
Definition: scip.c:41591
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip.c:21383
SCIP_RETCODE SCIPsolSetVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real val)
Definition: sol.c:1015
#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:67
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
Definition: scip.c:27496
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:24034
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:9620
void SCIPretcodePrintError(SCIP_RETCODE retcode)
Definition: retcode.c:100
internal methods for presolvers
SCIP_Longint SCIPconflictGetNAppliedLocalConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:2537
SCIP_Real SCIPdivesetGetAvgDepth(SCIP_DIVESET *diveset)
Definition: heur.c:422
SCIP_Longint ninitlpiterations
Definition: struct_stat.h:64
SCIP_LPSOLSTAT lastsblpsolstats[2]
Definition: struct_stat.h:166
SCIP_CONFLICTSTORE * conflictstore
Definition: struct_scip.h:92
SCIP_Real lhs
Definition: struct_lp.h:193
SCIP_CLOCK * solvingtimeoverall
Definition: struct_stat.h:140
void SCIPsetSortComprs(SCIP_SET *set)
Definition: set.c:4244
int SCIPsepastoreGetNCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1328
SCIP_RETCODE SCIPsetInitsolPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4930
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:5917
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition: cons.c:7881
SCIP_RETCODE SCIPchgVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:21701
#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:6921
SCIP_RETCODE SCIPsetConsDynamic(SCIP *scip, SCIP_CONS *cons, SCIP_Bool dynamic)
Definition: scip.c:27599
SCIP_RETCODE SCIPsetSetIntParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, int value)
Definition: set.c:3028
SCIP_Real SCIPcalculatePscostConfidenceBound(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun, SCIP_CONFIDENCELEVEL clevel)
Definition: scip.c:25777
SCIP_RELAX * SCIPsetFindRelax(SCIP_SET *set, const char *name)
Definition: set.c:3822
SCIP_RETCODE SCIPcheckSolOrig(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *feasible, SCIP_Bool printreason, SCIP_Bool completely)
Definition: scip.c:40086
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
SCIP_RETCODE SCIPprintStage(SCIP *scip, FILE *file)
Definition: scip.c:836
SCIP_RETCODE SCIPgetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real *dval)
Definition: scip.c:31425
SCIP_OBJSENSE objsense
Definition: struct_prob.h:77
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:25494
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:586
int SCIPgetNChildren(SCIP *scip)
Definition: scip.c:40550
char branch_firstsbchild
Definition: struct_set.h:154
SCIP_Real SCIPsetBarrierconvtol(SCIP_SET *set)
Definition: set.c:5467
SCIP_Real SCIPvarGetAggrConstant(SCIP_VAR *var)
Definition: var.c:16923
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
Definition: cons.c:8100
int SCIPsetGetNParams(SCIP_SET *set)
Definition: set.c:3365
SCIP_Real SCIPdualfeasFloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:46384
SCIP_RETCODE SCIPsumLPRows(SCIP *scip, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: scip.c:29447
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:3675
SCIP_RETCODE SCIPreoptCreate(SCIP_REOPT **reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:4992
void SCIPreaderSetRead(SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: reader.c:493
SCIP_RETCODE SCIPsetChgRealParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, SCIP_Real value)
Definition: set.c:3095
SCIP_RETCODE SCIPendProbing(SCIP *scip)
Definition: scip.c:35187
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:1268
struct SCIP_EventData SCIP_EVENTDATA
Definition: type_event.h:155
SCIP_CONS ** SCIPgetOrigConss(SCIP *scip)
Definition: scip.c:12798
void SCIPeventhdlrSetExit(SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTEXIT((*eventexit)))
Definition: event.c:342
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16552
SCIP_Real SCIPconflictGetBoundexceedingLPTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:7443
SCIP_Bool SCIPsetExistsDialog(SCIP_SET *set, SCIP_DIALOG *dialog)
Definition: set.c:4554
SCIP_RETCODE SCIPbranchcandGetPseudoCands(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_PROB *prob, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: branch.c:759
SCIP_RETCODE SCIPsepastoreCreate(SCIP_SEPASTORE **sepastore)
Definition: sepastore.c:79
SCIP_Bool SCIPsetIsSumRelLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6539
SCIP_VAR * transvar
Definition: struct_var.h:169
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:6885
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
Definition: scip.c:6022
internal methods for NLP management
SCIP_PRESOL * SCIPfindPresol(SCIP *scip, const char *name)
Definition: scip.c:6985
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2798
SCIP_RETCODE SCIPnlpSetIntPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, int ival)
Definition: nlp.c:6031
SCIP_RETCODE SCIPgetNlRowActivityBounds(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *minactivity, SCIP_Real *maxactivity)
Definition: scip.c:32606
SCIP_RETCODE SCIPmergeVariableStatistics(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR **sourcevars, SCIP_VAR **targetvars, int nvars)
Definition: scip.c:2419
SCIP_Real SCIPsetFeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6098
SCIP_DECL_CONSTRANS(ConshdlrSubtour::scip_trans)
void SCIPheurSetCopy(SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: heur.c:1115
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:6811
void SCIPbranchruleSetInit(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: branch.c:1817
void SCIPsetSetLimitChanged(SCIP_SET *set)
Definition: set.c:5228
SCIP_RETCODE SCIPsetBranchruleMaxbounddist(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_Real maxbounddist)
Definition: scip.c:9251
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:23135
void SCIPprintDebugMessage(SCIP *scip, const char *sourcefile, int sourceline, const char *formatstr,...)
Definition: scip.c:1276
SCIP_Real SCIPgetNodeDualbound(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:13242
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip.c:4369
SCIP_DOMCHG * SCIPnodeGetDomchg(SCIP_NODE *node)
Definition: tree.c:7238
SCIP_Bool SCIPsetIsRelLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6451
SCIP_RETCODE SCIPaddNlpiProbRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_ROW **rows, int nrows)
Definition: scip.c:33640
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
Definition: scip.c:12584
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
Definition: scip.c:30797
SCIP_RETCODE SCIPenforelaxCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip.c:28341
void SCIPconshdlrSetEnable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: cons.c:4392
int SCIPprobGetNObjVars(SCIP_PROB *prob, SCIP_SET *set)
Definition: prob.c:1968
SCIP_Longint SCIPgetNDelayedCutoffs(SCIP *scip)
Definition: scip.c:41336
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:403
SCIP_RETCODE SCIPconsChgName(SCIP_CONS *cons, BMS_BLKMEM *blkmem, const char *name)
Definition: cons.c:6025
void SCIProwDelaySort(SCIP_ROW *row)
Definition: lp.c:5968
int SCIPconshdlrGetNChgCoefs(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4939
SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval)
Definition: lpi_clp.cpp:2653
SCIP_Real cutoffbound
Definition: struct_lp.h:271
SCIP_Real SCIProwGetPseudoFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6270
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:3057
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:9182
internal miscellaneous methods
#define SCIP_DECL_NODESELFREE(x)
Definition: type_nodesel.h:56
SCIP_RETCODE SCIPboolarrayClear(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4135
SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:43265
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:20787
SCIP_RETCODE SCIPgetExprtreeTransformedVars(SCIP *scip, SCIP_EXPRTREE *tree)
Definition: scip.c:32674
#define NULL
Definition: lpi_spx1.cpp:137
void SCIPvarGetClosestVub(SCIP_VAR *var, SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_Real *closestvub, int *closestvubidx)
Definition: var.c:13499
#define SCIP_DECL_RELAXCOPY(x)
Definition: type_relax.h:47
SCIP_NEGATE negate
Definition: struct_var.h:226
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28164
SCIP_RETCODE SCIPvarFlattenAggregationGraph(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: var.c:4143
SCIP_Real SCIPgetVarConflictlengthScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26082
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2382
SCIP_Longint SCIPbranchruleGetNConssFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2068
SCIP_Longint SCIPconshdlrGetNPropCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4729
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38137
SCIP_Real SCIPlpGetObjNorm(SCIP_LP *lp)
Definition: lp.c:16679
SCIP_Real SCIPsetDualfeasCeil(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6309
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:6285
SCIP_RETCODE SCIPsetNLPInitialGuess(SCIP *scip, SCIP_Real *initialguess)
Definition: scip.c:31136
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:7845
SCIP_RETCODE SCIPclearBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:47007
SCIP_RETCODE SCIPvarSetRelaxSol(SCIP_VAR *var, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_Real solval, SCIP_Bool updateobj)
Definition: var.c:13164
int SCIPgetNNlpis(SCIP *scip)
Definition: scip.c:9444
SCIP_RETCODE SCIPconcsolverInitSeeds(SCIP_CONCSOLVER *concsolver, unsigned int seed)
Definition: concsolver.c:256
int nrelaxs
Definition: struct_set.h:102
int nseparounds
Definition: struct_stat.h:209
void SCIPrelaxSetInitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: relax.c:424
SCIP_Bool SCIPsetIsDualfeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6197
int SCIPgetNPrioExternBranchCands(SCIP *scip)
Definition: scip.c:36296
void SCIPrelaxSetExitsol(SCIP_RELAX *relax, SCIP_DECL_RELAXEXITSOL((*relaxexitsol)))
Definition: relax.c:435
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:2137
SCIP_HISTORY * glbhistory
Definition: struct_stat.h:159
SCIP_Real SCIPboundchgGetNewbound(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16449
static void printNLPStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44026
SCIP_Bool userinterrupt
Definition: struct_stat.h:252
SCIP_Real SCIPsetFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5742
SCIP_RETCODE SCIPsetIncludePricer(SCIP_SET *set, SCIP_PRICER *pricer)
Definition: set.c:3417
#define REALABS(x)
Definition: def.h:159
SCIP_SEPA * SCIPsetFindSepa(SCIP_SET *set, const char *name)
Definition: set.c:3896
#define SCIP_DECL_CONSDISABLE(x)
Definition: type_cons.h:683
SCIP_RETCODE SCIPprobSetName(SCIP_PROB *prob, const char *name)
Definition: prob.c:1930
SCIP_RETCODE SCIPchgDualfeastol(SCIP *scip, SCIP_Real dualfeastol)
Definition: scip.c:45389
SCIP_Real SCIPgetLocalDualbound(SCIP *scip)
Definition: scip.c:13203
SCIP_CONCSOLVERTYPE ** concsolvertypes
Definition: struct_set.h:86
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
Definition: scip.c:4388
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
Definition: var.c:17540
SCIP_RETCODE SCIPunfixParam(SCIP *scip, const char *name)
Definition: scip.c:4504
SCIP_RETCODE SCIPmessagehdlrRelease(SCIP_MESSAGEHDLR **messagehdlr)
Definition: message.c:338
int SCIPexprtreeGetNVars(SCIP_EXPRTREE *tree)
Definition: expr.c:8543
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:31163
void SCIPupdateDivesetLPStats(SCIP *scip, SCIP_DIVESET *diveset, SCIP_Longint niterstoadd)
Definition: scip.c:35927
SCIP_Bool SCIPparamIsValidReal(SCIP_PARAM *param, SCIP_Real value)
Definition: paramset.c:4256
SCIP_Bool SCIPsetIsRelGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6473
SCIP_Real unchangedobj
Definition: struct_var.h:203
SCIP_PARAM * SCIPgetParam(SCIP *scip, const char *name)
Definition: scip.c:4353
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_Longint SCIPpropGetNDomredsFound(SCIP_PROP *prop)
Definition: prop.c:1072
SCIP_Longint nconflictlps
Definition: struct_stat.h:189
SCIP_RETCODE SCIPsetPresolPriority(SCIP *scip, SCIP_PRESOL *presol, int priority)
Definition: scip.c:7022
internal methods for node selectors and node priority queues
SCIP_RETCODE SCIPsetBranchrulePriority(SCIP *scip, SCIP_BRANCHRULE *branchrule, int priority)
Definition: scip.c:9221
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip.c:27734
SCIP_Real SCIPgetVarAvgInferenceScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26283
#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:26916
SCIP_Bool SCIPprobIsObjIntegral(SCIP_PROB *prob)
Definition: prob.c:2188
internal methods for variable pricers
int SCIPgetEffectiveRootDepth(SCIP *scip)
Definition: scip.c:40489
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
Definition: scip.c:36704
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:7431
int SCIPgetNLPRows(SCIP *scip)
Definition: scip.c:29221
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:9530
SCIP_RETCODE SCIPfreeBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
Definition: scip.c:46971
SCIP_ROW * SCIPcutGetRow(SCIP_CUT *cut)
Definition: cutpool.c:357
SCIP_Bool SCIPareSolsEqual(SCIP *scip, SCIP_SOL *sol1, SCIP_SOL *sol2)
Definition: scip.c:38358
SCIP_CUTPOOL * SCIPgetDelayedGlobalCutpool(SCIP *scip)
Definition: scip.c:34313
const char * SCIPrelaxGetName(SCIP_RELAX *relax)
Definition: relax.c:446
SCIP_RETCODE SCIPsetConflicthdlrFree(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTFREE((*conflictfree)))
Definition: scip.c:6673
SCIP_Bool SCIPisSumEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45985
const char * SCIPlpiGetSolverName(void)
Definition: lpi_clp.cpp:432
int npresolchgbds
Definition: struct_stat.h:224
void SCIPreoptnodeInit(SCIP_REOPTNODE *reoptnode, SCIP_SET *set)
Definition: reopt.c:7844
SCIP_Longint SCIPconflictGetNStrongbranchConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:7835
SCIP_RETCODE SCIPcopyOrigVars(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR **fixedvars, SCIP_Real *fixedvals, int nfixedvars)
Definition: scip.c:2389
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:308
int SCIPptrarrayGetMaxIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:4618
SCIP_NODEPQ * leaves
Definition: struct_tree.h:169
void SCIPsetSortProps(SCIP_SET *set)
Definition: set.c:3993
static SCIP_RETCODE calcNonZeros(SCIP *scip, SCIP_Longint *nchecknonzeros, SCIP_Longint *nactivenonzeros, SCIP_Bool *approxchecknonzeros, SCIP_Bool *approxactivenonzeros)
Definition: scip.c:13564
SCIP_Real SCIPgetVarObjProbing(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:35307
struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA
Definition: type_conflict.h:40
void SCIPsepaSetExitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: sepa.c:621
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:14047
SCIP * scip
Definition: struct_cons.h:40
#define SCIP_CALL(x)
Definition: def.h:306
SCIP_RETCODE SCIPsetPropPriority(SCIP *scip, SCIP_PROP *prop, int priority)
Definition: scip.c:7825
SCIP_RETCODE SCIPgetNLPI(SCIP *scip, SCIP_NLPI **nlpi, SCIP_NLPIPROBLEM **nlpiproblem)
Definition: scip.c:31574
SCIP_Real SCIPgetLowerbound(SCIP *scip)
Definition: scip.c:42323
int npresoladdholes
Definition: struct_stat.h:225
SCIP_SOL * SCIPgetReoptLastOptSol(SCIP *scip)
Definition: scip.c:16310
SCIP_Bool SCIPisPrimalboundSol(SCIP *scip)
Definition: scip.c:42559
SCIP_RETCODE SCIPsetSetReoptimizationParams(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:709
SCIP_RETCODE SCIPrecalcNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32451
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:34423
SCIP_Longint SCIPbranchruleGetNLPCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2016
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6008
SCIP_Longint SCIPconshdlrGetNConssFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4809
SCIP_Real SCIPgetAvgPseudocostCurrentRun(SCIP *scip, SCIP_Real solvaldelta)
Definition: scip.c:42755
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:25808
SCIP_Longint SCIPgetNTotalNodes(SCIP *scip)
Definition: scip.c:41209
int SCIPgetNTotalVars(SCIP *scip)
Definition: scip.c:12208
#define SCIP_DECL_CONCSOLVERINITSEEDS(x)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46125
SCIP_RETCODE SCIPsolveProbingLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:35713
SCIP_Real SCIPcomputeVarUbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23433
SCIP_Real SCIPbranchruleGetTime(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2006
static SCIP_RETCODE printProblem(SCIP *scip, SCIP_PROB *prob, FILE *file, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:43199
SCIP_Longint nsbbestsolsfound
Definition: struct_stat.h:97
int SCIPgetNOrigConss(SCIP *scip)
Definition: scip.c:12771
int SCIPlpGetNRows(SCIP_LP *lp)
Definition: lp.c:16594
SCIP_RETCODE SCIPprintStatus(SCIP *scip, FILE *file)
Definition: scip.c:944
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:22919
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:14749
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:18873
SCIP_RETCODE SCIPrelaxationCreate(SCIP_RELAXATION **relaxation, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree)
Definition: relax.c:599
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
Definition: var.c:16970
SCIP_RETCODE SCIPbranchVarVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val, SCIP_NODE **downchild, SCIP_NODE **eqchild, SCIP_NODE **upchild)
Definition: scip.c:36813
SCIP_Real SCIPgetVarAvgConflictlength(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26144
SCIP_RETCODE SCIPremoveVarFromGlobalStructures(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:24730
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:7126
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:40746
SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)
Definition: scip.c:23539
SCIP_RETCODE SCIPcutpoolClear(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:465
#define SCIP_DECL_CONSENABLE(x)
Definition: type_cons.h:668
SCIP_RETCODE SCIPsetEmphasis(SCIP *scip, SCIP_PARAMEMPHASIS paramemphasis, SCIP_Bool quiet)
Definition: scip.c:4998
SCIP_Longint SCIPgetVarStrongbranchLPAge(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21190
void SCIPlpMarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:16819
int SCIPgetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx)
Definition: scip.c:46872
void SCIPpropSetPresolPriority(SCIP_PROP *prop, SCIP_SET *set, int presolpriority)
Definition: prop.c:941
#define MAXNCLIQUEVARSCOMP
Definition: scip.c:24014
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:7151
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46112
SCIP_RETCODE SCIPsetSetLpfeastol(SCIP_SET *set, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: set.c:5164
SCIP_NODESEL * SCIPgetNodesel(SCIP *scip)
Definition: scip.c:8937
SCIP_RETCODE SCIPsetSetPresolving(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3324
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:61
SCIP_Bool SCIPsetIsLbBetter(SCIP_SET *set, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6345
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:5696
SCIP_Real SCIPvarGetPseudocostCount(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:13873
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:45433
SCIP_Longint nbarrierzeroitlps
Definition: struct_stat.h:178
SCIP_Longint SCIPconflictGetNPseudoSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8052
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
Definition: scip.c:27097
SCIP_Bool resolvelperror
Definition: struct_lp.h:357
#define SCIPstatAdd(stat, set, field, val)
Definition: stat.h:262
SCIP_CUT ** SCIPcutpoolGetCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:842
BMS_BUFMEM * SCIPcleanbuffer(SCIP *scip)
Definition: scip.c:45548
SCIP_RETCODE SCIPintarraySetVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int val)
Definition: misc.c:3819
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
Definition: lp.c:16321
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip.c:1353
SCIP_Longint SCIPgetNBarrierLPIterations(SCIP *scip)
Definition: scip.c:41553
#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:31481
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:8120
internal methods for relaxators
SCIP_RETCODE SCIPfreeRealarray(SCIP *scip, SCIP_REALARRAY **realarray)
Definition: scip.c:46669
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:2701
SCIP_Real SCIPgetRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30562
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:5544
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:1389
int SCIPcutpoolGetNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:852
SCIP_RETCODE SCIPprimalRetransformSolutions(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob)
Definition: primal.c:1684
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:29890
SCIP_Real vsidsweight
Definition: struct_stat.h:117
#define SCIPdebugCheckBInvRow(scip, r, coef)
Definition: debug.h:289
SCIP_RETCODE SCIPsetPricerInit(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERINIT((*pricerinit)))
Definition: scip.c:5530
SCIP_RETCODE SCIPgetTransformedCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
Definition: scip.c:27824
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:7627
int nsepas
Definition: struct_set.h:104
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:27288
int SCIPpropGetNChgBds(SCIP_PROP *prop)
Definition: prop.c:1142
SCIP_Bool SCIPisLongintParamValid(SCIP *scip, SCIP_PARAM *param, SCIP_Longint value)
Definition: scip.c:4698
SCIP_Longint SCIPgetNPrimalResolveLPIterations(SCIP *scip)
Definition: scip.c:41629
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1307
SCIP_Bool SCIPsetIsHugeValue(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5533
SCIP_LPI * SCIPlpGetLPI(SCIP_LP *lp)
Definition: lp.c:16746
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:6297
SCIP_Real SCIPlpGetObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12468
void SCIPprobResortVars(SCIP_PROB *prob)
Definition: prob.c:631
void SCIPstatResetPrimalDualIntegral(SCIP_STAT *stat, SCIP_SET *set, SCIP_Bool partialreset)
Definition: stat.c:366
SCIP_RETCODE SCIPsetRelaxPriority(SCIP *scip, SCIP_RELAX *relax, int priority)
Definition: scip.c:7256
SCIP_Bool SCIPconsIsLockedPos(SCIP_CONS *cons)
Definition: cons.c:8200
SCIP_RETCODE SCIPgetLongintParam(SCIP *scip, const char *name, SCIP_Longint *value)
Definition: scip.c:4407
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
Definition: scip.c:33869
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:3308
SCIP_RETCODE SCIPnlpChgVarObjDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var, SCIP_Real coef)
Definition: nlp.c:6208
SCIP_Longint SCIPconflictGetNInfeasibleLPCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:7373
struct SCIP_ConsData SCIP_CONSDATA
Definition: type_cons.h:50
void SCIPnodeselSetInitsol(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: nodesel.c:1128
SCIP_Bool SCIPbranchcandContainsExternCand(SCIP_BRANCHCAND *branchcand, SCIP_VAR *var)
Definition: branch.c:683
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28021
void SCIProwPrint(SCIP_ROW *row, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: lp.c:5119
internal methods for storing separated cuts
SCIP_RETCODE SCIPgetPseudoBranchCands(SCIP *scip, SCIP_VAR ***pseudocands, int *npseudocands, int *npriopseudocands)
Definition: scip.c:36467
SCIP_RETCODE SCIPsetPresolInitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: scip.c:6953
int lastnpresoldelconss
Definition: struct_stat.h:236
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:544
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
Definition: lp.c:16430
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:6721
int SCIPgetNPrioExternBranchBins(SCIP *scip)
Definition: scip.c:36316
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:36337
void SCIPsetSortPropsPresol(SCIP_SET *set)
Definition: set.c:4008
SCIP_RETCODE SCIPnlpChgVarBoundsDive(SCIP_NLP *nlp, SCIP_VAR *var, SCIP_Real lb, SCIP_Real ub)
Definition: nlp.c:6268
int SCIPgetRealarrayMaxIdx(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:46788
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5964
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
Definition: lp.c:16257
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:6643
void SCIPsetSortPresolsName(SCIP_SET *set)
Definition: set.c:3783
SCIP_Longint nprimalresolvelps
Definition: struct_stat.h:179
SCIP_RETCODE SCIPsetConflicthdlrExit(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTEXIT((*conflictexit)))
Definition: scip.c:6705
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:28693
SCIP_RETCODE SCIPsetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real val)
Definition: scip.c:46737
SCIP_Bool SCIPisDualfeasNegative(SCIP *scip, SCIP_Real val)
Definition: scip.c:46348
SCIP_Real SCIPgetVarPseudocostCount(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:25701
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:98
SCIP_RETCODE SCIPlpStartStrongbranch(SCIP_LP *lp)
Definition: lp.c:4039
SCIP_Longint SCIPconcsolverGetNTighterIntBnds(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:558
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip.c:28769
SCIP_CLOCK * divinglptime
Definition: struct_stat.h:147
SCIP_Bool SCIPhasPrimalRay(SCIP *scip)
Definition: scip.c:40124
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:32961
SCIP_RETCODE SCIPstopSolvingTime(SCIP *scip)
Definition: scip.c:45062
SCIP_CLOCK * presolvingtimeoverall
Definition: struct_stat.h:142
int SCIPgetBoolarrayMinIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:47057
SCIP_RETCODE SCIPgetLPBInvACol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29414
SCIP_Longint SCIPgetLastDivenode(SCIP *scip)
Definition: scip.c:34969
SCIP_Longint SCIPgetNNodeLPIterations(SCIP *scip)
Definition: scip.c:41703
SCIP_READER * SCIPsetFindReader(SCIP_SET *set, const char *name)
Definition: set.c:3397
SCIP_Real SCIPgetVarPseudocostCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:25675
void SCIPsolRecomputeObj(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob)
Definition: sol.c:1926
void SCIPsetSortRelaxs(SCIP_SET *set)
Definition: set.c:3842
SCIP_RETCODE SCIPsetRelaxExit(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: scip.c:7170
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:5172
SCIP_RETCODE SCIPchgNlRowLhs(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real lhs)
Definition: scip.c:31923
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
SCIP_NODE * SCIPgetBestNode(SCIP *scip)
Definition: scip.c:40730
#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:3148
SCIP_Real SCIPconshdlrGetRespropTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4679
SCIP_CUTPOOL * cutpool
Definition: struct_scip.h:93
SCIP_BRANCHRULE ** branchrules
Definition: struct_set.h:82
SCIP_Real SCIPtreeGetAvgLowerbound(SCIP_TREE *tree, SCIP_Real cutoffbound)
Definition: tree.c:7046
SCIP_Longint nduallps
Definition: struct_stat.h:174
SCIP_RETCODE SCIPcutpoolAddRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_ROW *row)
Definition: cutpool.c:491
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:2524
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
Definition: scip.c:45839
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:7325
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
Definition: scip.c:12960
#define SCIP_DECL_PROBTRANS(x)
Definition: type_prob.h:74
void SCIPbranchruleSetMaxdepth(SCIP_BRANCHRULE *branchrule, int maxdepth)
Definition: branch.c:1950
methods for catching the user CTRL-C interrupt
void SCIPtreeClearDiveBoundChanges(SCIP_TREE *tree)
Definition: tree.c:6200
void SCIPsepaSetCopy(SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
Definition: sepa.c:566
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:86
static SCIP_RETCODE getCopyTimelimit(SCIP *sourcescip, SCIP_Real *timelimit)
Definition: scip.c:4045
SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:21448
SCIP_Real SCIProwGetSolActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6286
SCIP_RETCODE SCIPsetSetLongintParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Longint value)
Definition: set.c:3080
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:140
SCIP_Longint SCIPbranchruleGetNCutsFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2056
SCIP_Longint SCIPsepaGetNCalls(SCIP_SEPA *sepa)
Definition: sepa.c:749
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:264
SCIP_Real SCIPgetAvgInferencesCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43030
int SCIPreoptGetNTotalFeasNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4922
#define SCIP_COPYRIGHT
Definition: def.h:99
data structures and methods for collecting reoptimization information
internal methods for problem variables
SCIP_Real sepa_feastolfac
Definition: struct_set.h:472
SCIP_COMPR * SCIPsetFindCompr(SCIP_SET *set, const char *name)
Definition: set.c:4224
the function declarations for the synchronization store
SCIP_RETCODE SCIPsetIncludeProp(SCIP_SET *set, SCIP_PROP *prop)
Definition: set.c:3946
SCIP_RETCODE SCIPsetNLPRealPar(SCIP *scip, SCIP_NLPPARAM type, SCIP_Real dval)
Definition: scip.c:31453
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
Definition: var.c:16681
void SCIPbranchruleSetExecLp(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECLP((*branchexeclp)))
Definition: branch.c:1863
SCIP_RETCODE SCIPnlpWrite(SCIP_NLP *nlp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *fname)
Definition: nlp.c:5729
#define SCIP_DECL_CONSGETVARS(x)
Definition: type_cons.h:814
SCIP_RETCODE SCIPactivatePricer(SCIP *scip, SCIP_PRICER *pricer)
Definition: scip.c:5691
SCIP_RETCODE SCIPvarChgBranchFactor(SCIP_VAR *var, SCIP_SET *set, SCIP_Real branchfactor)
Definition: var.c:10870
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:4937
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:8145
SCIP_RETCODE SCIPpropCons(SCIP *scip, SCIP_CONS *cons, SCIP_PROPTIMING proptiming, SCIP_RESULT *result)
Definition: scip.c:28457
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:6402
void SCIPbranchruleSetPriority(SCIP_BRANCHRULE *branchrule, SCIP_SET *set, int priority)
Definition: branch.c:1926
#define SCIP_DECL_CONSEXIT(x)
Definition: type_cons.h:94
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip.h:21925
#define SCIP_UNKNOWN
Definition: def.h:156
SCIP_RETCODE SCIPstartStrongbranch(SCIP *scip, SCIP_Bool enablepropagation)
Definition: scip.c:19781
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:37867
SCIP_Bool userrestart
Definition: struct_stat.h:253
SCIP_RETCODE SCIPlpGetBasisInd(SCIP_LP *lp, int *basisind)
Definition: lp.c:9489
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip.c:29380
SCIP_Bool SCIPsetIsIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5667
SCIP_RETCODE SCIPgetNlRowFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip.c:32508
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
Definition: lp.c:16267
SCIP_SEPASTORE * sepastore
Definition: struct_scip.h:91
SCIP_Longint nisstoppedcalls
Definition: struct_stat.h:191
SCIP_RETCODE SCIPresetReoptnodeDualcons(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:17169
SCIP_Longint SCIPconshdlrGetNEnfoLPCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4699
SCIP_RETCODE SCIPclearSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37808
SCIP_RETCODE SCIPsetPropInit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: scip.c:7642
SCIP_RETCODE SCIPcheckReoptRestart(SCIP *scip, SCIP_NODE *node, SCIP_Bool *restart)
Definition: scip.c:17041
unsigned int vartype
Definition: struct_var.h:274
SCIP_COMPR ** SCIPgetComprs(SCIP *scip)
Definition: scip.c:8387
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17476
SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val)
Definition: lpi_clp.cpp:3726
SCIP_Bool SCIPcliquetableNeedsComponentUpdate(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3455
static SCIP_RETCODE printDualSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:38604
SCIP_Bool reopt_sepabestsol
Definition: struct_set.h:452
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:816
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46024
void SCIPnodePropagateAgain(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree)
Definition: tree.c:1180
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:14917
int SCIPgetNPrioExternBranchConts(SCIP *scip)
Definition: scip.c:36377
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:16873
void SCIPsepaSetInitsol(SCIP_SEPA *sepa, SCIP_DECL_SEPAINITSOL((*sepainitsol)))
Definition: sepa.c:610
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:10438
SCIP_RETCODE SCIPsetSetHeuristics(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: set.c:3306
SCIP_Real SCIPlpGetRootLooseObjval(SCIP_LP *lp)
Definition: lp.c:16736
SCIP_RETCODE SCIPincludeNlpi(SCIP *scip, SCIP_NLPI *nlpi)
Definition: scip.c:9382
SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
Definition: scip.c:7447
SCIP_RETCODE SCIPsepastoreAddCut(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
Definition: sepastore.c:406
SCIP_SOL * SCIPreoptGetLastBestSol(SCIP_REOPT *reopt)
Definition: reopt.c:5586
SCIP_RETCODE SCIPnlpEndDive(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:6147
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:40029
internal methods for user interface dialog
int SCIPgetNExternalCodes(SCIP *scip)
Definition: scip.c:9512
int SCIPreoptnodeGetNChildren(SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:5768
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:6285
int SCIPtreeGetEffectiveRootDepth(SCIP_TREE *tree)
Definition: tree.c:8142
#define SCIP_Bool
Definition: def.h:61
void SCIPlpRecomputeLocalAndGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12551
SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: scip.c:9880
SCIP_RETCODE SCIPgetNLPStatistics(SCIP *scip, SCIP_NLPSTATISTICS *statistics)
Definition: scip.c:31265
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:30205
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:22737
SCIP_RETCODE SCIPnodeselCreate(SCIP_NODESEL **nodesel, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int stdpriority, int memsavepriority, SCIP_DECL_NODESELCOPY((*nodeselcopy)), SCIP_DECL_NODESELFREE((*nodeselfree)), SCIP_DECL_NODESELINIT((*nodeselinit)), SCIP_DECL_NODESELEXIT((*nodeselexit)), SCIP_DECL_NODESELINITSOL((*nodeselinitsol)), SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)), SCIP_DECL_NODESELSELECT((*nodeselselect)), SCIP_DECL_NODESELCOMP((*nodeselcomp)), SCIP_NODESELDATA *nodeseldata)
Definition: nodesel.c:745
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
Definition: scip.c:40207
#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:42168
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip.c:28854
SCIP_Real SCIPsetSumepsilon(SCIP_SET *set)
Definition: set.c:5416
SCIP_RETCODE SCIPfreeSyncstore(SCIP *scip)
Definition: scip.c:41034
SCIP_RETCODE SCIPsetConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_Bool local)
Definition: scip.c:27548
SCIP_DECL_CONSPROP(ConshdlrSubtour::scip_prop)
int SCIPgetNImplVars(SCIP *scip)
Definition: scip.c:11766
void SCIPsetSortSepasName(SCIP_SET *set)
Definition: set.c:3931
int SCIPbranchcandGetNPrioExternConts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:526
SCIP_Longint ndualresolvelps
Definition: struct_stat.h:180
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:9266
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:102
SCIP_Real SCIPgetObjlimit(SCIP *scip)
Definition: scip.c:11135
#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:5201
SCIP_RETCODE SCIPcreateSolCopyOrig(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition: scip.c:37335
SCIP_CLOCK * sbsoltime
Definition: struct_stat.h:153
#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:30616
int SCIPvarGetCliqueComponentIdx(SCIP_VAR *var)
Definition: var.c:17646
SCIP_Real SCIPpresolGetTime(SCIP_PRESOL *presol)
Definition: presol.c:661
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:5215
#define BMSreallocBlockMemorySize(mem, ptr, oldsize, newsize)
Definition: memory.h:410
SCIP_Bool SCIPprobIsPermuted(SCIP_PROB *prob)
Definition: prob.c:2158
SCIP_NODESEL * SCIPsetFindNodesel(SCIP_SET *set, const char *name)
Definition: set.c:4348
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:11000
SCIP_RETCODE SCIPchgNlRowConstant(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real constant)
Definition: scip.c:31969
SCIP_Real ub
Definition: struct_var.h:161
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:141
void SCIPprintVersion(SCIP *scip, FILE *file)
Definition: scip.c:609
SCIP_RETCODE SCIPseparateSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool pretendroot, SCIP_Bool onlydelayed, SCIP_Bool *delayed, SCIP_Bool *cutoff)
Definition: scip.c:34337
SCIP_RETCODE SCIPwriteTransProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
Definition: scip.c:10315
SCIP_Longint SCIPsolGetNodenum(SCIP_SOL *sol)
Definition: sol.c:2362
int ncontvars
Definition: struct_prob.h:65
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:5480
SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46011
void SCIPprintSysError(const char *message)
Definition: misc.c:9276
SCIP_NODE ** children
Definition: struct_tree.h:181
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:117
SCIP_RETCODE SCIPconsEnfops(SCIP_CONS *cons, SCIP_SET *set, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: cons.c:7241
SCIP_Bool SCIPnlpHasCurrentNodeNLP(SCIP_NLP *nlp)
Definition: nlp.c:5273
SCIP_RETCODE SCIPrecalcNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:32303
int nbinvars
Definition: struct_prob.h:62
SCIP_RETCODE SCIPprintRay(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:38796
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:9050
SCIP_RETCODE SCIPprintBestTransSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:39037
enum SCIP_Status SCIP_STATUS
Definition: type_stat.h:57
static const char * paramname[]
Definition: lpi_msk.c:4268
#define SCIP_DECL_DISPFREE(x)
Definition: type_disp.h:79
SCIP_NLPSOLSTAT SCIPnlpGetSolstat(SCIP_NLP *nlp)
Definition: nlp.c:5967
SCIP_RETCODE SCIPsetComprExitsol(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXITSOL((*comprexitsol)))
Definition: scip.c:8358
void SCIPconsSetModifiable(SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: cons.c:6569
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:2602
SCIP_VAR ** origobjvars
Definition: struct_tree.h:51
int npresolrounds
Definition: struct_stat.h:217
#define SCIP_DECL_PROPFREE(x)
Definition: type_prop.h:55
SCIP_Longint SCIPsepaGetNConssFound(SCIP_SEPA *sepa)
Definition: sepa.c:839
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:30022
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_RETCODE SCIProundSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *success)
Definition: scip.c:39073
SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
Definition: scip.c:11078
SCIP_RETCODE SCIPsolIncVal(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real incval)
Definition: sol.c:1210
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:4839
SCIP_RETCODE SCIPautoselectDisps(SCIP *scip)
Definition: scip.c:9343
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:45078
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:33588
int SCIPgetNPricers(SCIP *scip)
Definition: scip.c:5644
SCIP_CONSHDLR * conshdlr
Definition: struct_cons.h:44
SCIP_Real SCIPgetPseudocostVariance(SCIP *scip, SCIP_BRANCHDIR branchdir, SCIP_Bool onlycurrentrun)
Definition: scip.c:42838
int SCIPvarGetBranchPriority(SCIP_VAR *var)
Definition: var.c:17338
SCIP_SYNCSTORE * SCIPgetSyncstore(SCIP *scip)
Definition: scip.c:41066
void SCIPconshdlrSetDelete(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
Definition: cons.c:4326
int SCIPgetDepth(SCIP *scip)
Definition: scip.c:42094
SCIP_Real lastlowerbound
Definition: struct_stat.h:134
union SCIP_Node::@9 data
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:16546
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:45288
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:125
SCIP_RETCODE SCIPnlpAddNlRow(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_NLROW *nlrow)
Definition: nlp.c:5430
SCIP_RETCODE SCIPupdateNodeDualbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:13372
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:8484
void SCIPtreeGetDiveBoundChangeData(SCIP_TREE *tree, SCIP_VAR ***variables, SCIP_BRANCHDIR **directions, SCIP_Real **values, int *ndivebdchgs, SCIP_Bool preferred)
Definition: tree.c:6177
SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
Definition: scip.c:13394
SCIP_Real SCIPgetGap(SCIP *scip)
Definition: scip.c:42581
SCIP_Real SCIPgetAvgConflictlengthScoreCurrentRun(SCIP *scip)
Definition: scip.c:42987
void SCIPnodeselSetMemsavePriority(SCIP_NODESEL *nodesel, SCIP_SET *set, int priority)
Definition: nodesel.c:1047
internal methods for input file readers
SCIP_RETCODE SCIPlpGetBInvRow(SCIP_LP *lp, int r, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9523
void SCIPconshdlrSetInit(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: cons.c:4231
int mem_arraygrowinit
Definition: struct_set.h:334
SCIP_RETCODE SCIPchgVarUbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:34674
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17444
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:2660
SCIP_RETCODE SCIPrealarrayFree(SCIP_REALARRAY **realarray)
Definition: misc.c:3227
SCIP_MULTAGGR multaggr
Definition: struct_var.h:225
SCIP_RETCODE SCIPdialoghdlrAddInputLine(SCIP_DIALOGHDLR *dialoghdlr, const char *inputline)
Definition: dialog.c:687
SCIP_RETCODE SCIPchgLongintParam(SCIP *scip, SCIP_PARAM *param, SCIP_Longint value)
Definition: scip.c:4657
int SCIPgetNPrioPseudoBranchCands(SCIP *scip)
Definition: scip.c:36511
SCIP_RETCODE SCIPvarChgUbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:7868
SCIP_RETCODE SCIPsetGetIntParam(SCIP_SET *set, const char *name, int *value)
Definition: set.c:2854
SCIP_RETCODE SCIPnlpFlush(SCIP_NLP *nlp, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: nlp.c:5513
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
Definition: scip.c:28652
SCIP_RETCODE SCIPcaptureRow(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30138
SCIP_RETCODE SCIPstartSolvingTime(SCIP *scip)
Definition: scip.c:45029
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:20465
SCIP_HEUR ** heurs
Definition: struct_set.h:77
SCIP_Bool SCIPlpDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:16809
SCIP_Bool branch_roundsbsol
Definition: struct_set.h:165
SCIP_RETCODE SCIPwriteImplicationConflictGraph(SCIP *scip, const char *filename)
Definition: scip.c:44770
SCIP_RETCODE SCIPgetNLPVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars)
Definition: scip.c:30872
SCIP_RETCODE SCIPsetIncludeExternalCode(SCIP_SET *set, const char *name, const char *description)
Definition: set.c:4647
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:7530
void SCIPmessagehdlrSetQuiet(SCIP_MESSAGEHDLR *messagehdlr, SCIP_Bool quiet)
Definition: message.c:401
#define SCIP_DECL_CONSEXITPRE(x)
Definition: type_cons.h:138
int probingsumchgdobjs
Definition: struct_tree.h:213
#define MAX(x, y)
Definition: tclique_def.h:75
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:9411
SCIP_RETCODE SCIPsolRetransform(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_Bool *hasinfval)
Definition: sol.c:1801
SCIP_RETCODE SCIPchgVarsBoundsDiveNLP(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *lbs, SCIP_Real *ubs)
Definition: scip.c:31729
void SCIPprobSetTrans(SCIP_PROB *prob, SCIP_DECL_PROBTRANS((*probtrans)))
Definition: prob.c:339
void SCIPsetSortNlpis(SCIP_SET *set)
Definition: set.c:4619
#define BMSgarbagecollectBlockMemory(mem)
Definition: memory.h:426
int nreaders
Definition: struct_set.h:91
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:39843
SCIP_RETCODE SCIPsetCopyParams(SCIP_SET *sourceset, SCIP_SET *targetset, SCIP_MESSAGEHDLR *messagehdlr)
Definition: set.c:1035
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:1248
SCIP_RETCODE SCIPsolMarkPartial(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **vars, int nvars)
Definition: sol.c:1516
#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:35980
int SCIPpropGetNChgCoefs(SCIP_PROP *prop)
Definition: prop.c:1192
SCIP_Longint SCIPgetNPrimalLPs(SCIP *scip)
Definition: scip.c:41463
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:33964
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:2021
SCIP_Real SCIPsetDualfeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6331
SCIP_RETCODE SCIPcalcCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:24152
SCIP_VAR * SCIPboundchgGetVar(SCIP_BOUNDCHG *boundchg)
Definition: var.c:16459
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
Definition: cons.c:7901
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:32429
SCIP_RETCODE SCIPgetNlRowActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip.c:32479
methods for debugging
SCIP_RETCODE SCIPaddConflictRelaxedUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Real relaxedub)
Definition: scip.c:26848
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
Definition: implics.c:3317
void SCIPheurSetFree(SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
Definition: heur.c:1126
SCIP_RETCODE SCIPaddConflictBd(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx)
Definition: scip.c:26881
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:5159
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:4625
SCIP_BOUNDCHG * SCIPdomchgGetBoundchg(SCIP_DOMCHG *domchg, int pos)
Definition: var.c:16507
int SCIPreoptGetNTotalCutoffReoptnodes(SCIP_REOPT *reopt)
Definition: reopt.c:4962
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:8436
int SCIPsubversion(void)
Definition: scip.c:598
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:30051
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:1466
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
Definition: cons.c:8010
SCIP_Longint lastdivenode
Definition: struct_stat.h:100
SCIP_RETCODE SCIPtreeStartProbing(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp, SCIP_Bool strongbranching)
Definition: tree.c:6299
SCIP_Longint SCIPconshdlrGetNEnfoPSCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4709
void SCIPnodeselSetExit(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXIT((*nodeselexit)))
Definition: nodesel.c:1117
SCIP_RETCODE SCIPsepastoreFree(SCIP_SEPASTORE **sepastore)
Definition: sepastore.c:105
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
Definition: scip.c:30181
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:6429
unsigned int SCIPinitializeRandomSeed(SCIP *scip, int initialseedvalue)
Definition: scip.c:25467
#define SCIP_DECL_PROPINITSOL(x)
Definition: type_prop.h:115
int lastnpresolchgcoefs
Definition: struct_stat.h:239
SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
Definition: scip.c:33738
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:4069
SCIP_RETCODE SCIPsetConshdlrDisable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: scip.c:6389
SCIP_RETCODE SCIPwriteCliqueGraph(SCIP *scip, const char *fname, SCIP_Bool writenodeweights)
Definition: scip.c:24581
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:40241
SCIP_Real SCIPsetDualfeasRound(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6320
void SCIPconsSetRemovable(SCIP_CONS *cons, SCIP_Bool removable)
Definition: cons.c:6591
SCIP_Real SCIPvarGetMultaggrUbGlobal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8161
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:37631
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
Definition: cons.c:8080
SCIP_Bool SCIPprobAllColsInLP(SCIP_PROB *prob, SCIP_SET *set, SCIP_LP *lp)
Definition: prob.c:2200
SCIP_RETCODE SCIPsetBranchruleExitsol(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
Definition: scip.c:9118
SCIP_RETCODE SCIPprobRemoveConsName(SCIP_PROB *prob, SCIP_CONS *cons)
Definition: prob.c:1244
void SCIPenableVarHistory(SCIP *scip)
Definition: scip.c:25520
SCIP_RETCODE SCIPsetPricerFree(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERFREE((*pricerfree)))
Definition: scip.c:5506
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
Definition: cons.c:8050
SCIP_Real SCIPclockGetTimeOfDay(void)
Definition: clock.c:600
SCIP_Real SCIPcomputeVarLbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23370
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:17014
int parallel_minnthreads
Definition: struct_set.h:497
SCIP_Real SCIPgetVarAvgInferenceCutoffScoreCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_Real cutoffweight)
Definition: scip.c:26613
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:9152
SCIP_RETCODE SCIPsetPropCopy(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPCOPY((*propcopy)))
Definition: scip.c:7610
SCIP_RETCODE SCIPcutpoolCreate(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, int agelimit, SCIP_Bool globalcutpool)
Definition: cutpool.c:402
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
Definition: scip.c:40321
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:17778
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:20985
SCIP_Longint SCIPconflictGetNStrongbranchConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:7825
SCIP_RETCODE SCIPsetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int val)
Definition: scip.c:46888
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:6582
SCIP_RETCODE SCIPaddReoptnodeBndchg(SCIP *scip, SCIP_REOPTNODE *reoptnode, SCIP_VAR *var, SCIP_Real bound, SCIP_BOUNDTYPE boundtype)
Definition: scip.c:16490
SCIP_Real SCIPcalcNodeselPriority(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
Definition: scip.c:36654
SCIP_Real SCIPgetLPRootLooseObjval(SCIP *scip)
Definition: scip.c:29068
SCIP_VAR * SCIPvarGetAggrVar(SCIP_VAR *var)
Definition: var.c:16901
int SCIPpropGetNAddConss(SCIP_PROP *prop)
Definition: prop.c:1172
SCIP_RETCODE SCIPsetBranchruleMaxdepth(SCIP *scip, SCIP_BRANCHRULE *branchrule, int maxdepth)
Definition: scip.c:9236
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:17237
void SCIPmarkColNotRemovableLocal(SCIP *scip, SCIP_COL *col)
Definition: scip.c:29867
SCIP_Real SCIPconshdlrGetEnfoRelaxTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4639
SCIP_Real SCIPgetReoptSimilarity(SCIP *scip, int run1, int run2)
Definition: scip.c:17060
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:38763
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
Definition: scip.c:36399
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:606
SCIP_Longint SCIPgetNConflictConssFound(SCIP *scip)
Definition: scip.c:42011
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:13458
#define SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA(x)
int SCIPsyncstoreGetWinner(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:514
SCIP_Real SCIPgetAvgCutoffsCurrentRun(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43116
SCIP_RETCODE SCIPsetStringParam(SCIP *scip, const char *name, const char *value)
Definition: scip.c:4857
SCIP_Real SCIPvarGetAvgInferencesCurrentRun(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15418
int SCIPgetNSols(SCIP *scip)
Definition: scip.c:38832
SCIP_Bool SCIPtreeHasCurrentNodeLP(SCIP_TREE *tree)
Definition: tree.c:8120
int SCIPboolarrayGetMinIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4255
SCIP_RETCODE SCIPdialoghdlrSetRoot(SCIP *scip, SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog)
Definition: dialog.c:402
#define SCIP_PRESOLTIMING_ALWAYS
Definition: type_timing.h:49
SCIP_RETCODE SCIPsetReaderWrite(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: scip.c:5311
SCIP_Real limit_memory
Definition: struct_set.h:261
SCIP_RETCODE SCIPlpCreate(SCIP_LP **lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, const char *name)
Definition: lp.c:8795
SCIP_RETCODE SCIPsetNodeselInitsol(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINITSOL((*nodeselinitsol)))
Definition: scip.c:8840
SCIP_Real SCIPgetLPRootColumnObjval(SCIP *scip)
Definition: scip.c:29045
SCIP_RETCODE SCIPsetSetDefaultBoolParam(SCIP_SET *set, const char *name, SCIP_Bool defaultvalue)
Definition: set.c:2990
SCIP_RETCODE SCIPretransformSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:39109
SCIP_Longint SCIPgetNDualResolveLPs(SCIP *scip)
Definition: scip.c:41647
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:28427
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:13283
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
Definition: scip.c:25141
#define SCIPreallocMemoryArray(scip, ptr, newnum)
Definition: scip.h:21864
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:2796
#define BMScopyMemoryArray(ptr, source, num)
Definition: memory.h:89
#define SCIP_DECL_DIALOGFREE(x)
Definition: type_dialog.h:61
SCIP_RETCODE SCIPincludeRelax(SCIP *scip, const char *name, const char *desc, int priority, int freq, SCIP_Bool includeslp, 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:7043
#define SCIP_DECL_COMPREXIT(x)
Definition: type_compr.h:73
SCIP_Longint SCIPgetNDualLPIterations(SCIP *scip)
Definition: scip.c:41517
SCIP_RETCODE SCIPsetSetCharParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, char value)
Definition: set.c:3156
SCIP_Bool SCIPsetIsSumNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5865
SCIP_RETCODE SCIPchgVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
Definition: scip.c:24851
int SCIPgetNRuns(SCIP *scip)
Definition: scip.c:41099
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:16574
SCIP_Real maxcopytime
Definition: struct_stat.h:125
int SCIPnlpGetNVars(SCIP_NLP *nlp)
Definition: nlp.c:5790
SCIP_RETCODE SCIPsetPropPresolPriority(SCIP *scip, SCIP_PROP *prop, int presolpriority)
Definition: scip.c:7840
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
Definition: scip.c:21309
SCIP_RETCODE SCIPcreateEmptyNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real lhs, SCIP_Real rhs)
Definition: scip.c:31829
int SCIPconflictGetNConflicts(SCIP_CONFLICT *conflict)
Definition: conflict.c:2467
SCIP_HEUR * SCIPsetFindHeur(SCIP_SET *set, const char *name)
Definition: set.c:4150
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
Definition: var.c:16880
SCIP_Longint SCIPconflictGetNBoundexceedingLPCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:7453
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:29281
SCIP_RETCODE SCIPenfolpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_RESULT *result)
Definition: scip.c:28311
SCIP_RETCODE SCIPreoptnodeAddBndchg(SCIP_REOPTNODE *reoptnode, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR *var, SCIP_Real val, SCIP_BOUNDTYPE boundtype)
Definition: reopt.c:7909
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38090
#define SCIP_PROPTIMING_BEFORELP
Definition: type_timing.h:56
int SCIPtechVersion(void)
Definition: scip.c:587
SCIP_RETCODE SCIPcaptureNlRow(SCIP *scip, SCIP_NLROW *nlrow)
Definition: scip.c:31878
SCIP_RETCODE SCIPseparationRound(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_SEPASTORE *sepastore, SCIP_SOL *sol, int actdepth, SCIP_Bool onlydelayed, SCIP_Bool *delayed, SCIP_Bool *cutoff)
Definition: solve.c:1855
reoptsols primal heuristic
SCIP_Real SCIPbranchGetScoreMultiple(SCIP_SET *set, SCIP_VAR *var, int nchildren, SCIP_Real *gains)
Definition: branch.c:2175
SCIP_COL ** SCIPgetLPCols(SCIP *scip)
Definition: scip.c:29122
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:9740
#define SCIPallocMemoryArray(scip, ptr, num)
Definition: scip.h:21858
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Definition: scip.c:6435
internal methods for storing cuts in a cut pool
char sepa_efficacynorm
Definition: struct_set.h:477
SCIP_RETCODE SCIPchgFeastol(SCIP *scip, SCIP_Real feastol)
Definition: scip.c:45345
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:5616
SCIP_RETCODE SCIPsetConflicthdlrCopy(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTCOPY((*conflictcopy)))
Definition: scip.c:6657
SCIP_RETCODE SCIPfixParam(SCIP *scip, const char *name)
Definition: scip.c:4486
void SCIPpresolSetExit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: presol.c:520
static SCIP_Real getLowerbound(SCIP *scip)
Definition: scip.c:477
SCIP_DISP * SCIPsetFindDisp(SCIP_SET *set, const char *name)
Definition: set.c:4512
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPflushLP(SCIP *scip)
Definition: scip.c:28834
SCIP_RETCODE SCIPcreateUnknownSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37210
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:2078
int SCIPgetNObjVars(SCIP *scip)
Definition: scip.c:11859
void SCIPbranchruleSetExecPs(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECPS((*branchexecps)))
Definition: branch.c:1885
SCIP_Real SCIPvarGetRelaxSol(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:13225
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
Definition: scip.c:42068
int nconflicthdlrs
Definition: struct_set.h:98
SCIP_Real SCIPpropGetStrongBranchPropTime(SCIP_PROP *prop)
Definition: prop.c:1012
SCIP_Bool SCIPisRealParamValid(SCIP *scip, SCIP_PARAM *param, SCIP_Real value)
Definition: scip.c:4756
static void printTimingStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44359
SCIP_Bool SCIPisCutApplicable(SCIP *scip, SCIP_ROW *cut)
Definition: scip.c:33851
SCIP_Real SCIProwGetSolEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6600
SCIP_Longint SCIPgetNObjlimLeaves(SCIP *scip)
Definition: scip.c:41308
SCIP_RETCODE SCIPsetIncludeNodesel(SCIP_SET *set, SCIP_NODESEL *nodesel)
Definition: set.c:4317
#define SCIP_DECL_SEPAEXITSOL(x)
Definition: type_sepa.h:93
SCIP_Real SCIPdualfeasFrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:46420
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
Definition: var.c:16934
SCIP_Bool SCIPisSumRelGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46579
#define SCIP_DECL_SEPAEXECSOL(x)
Definition: type_sepa.h:138
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
Definition: scip.c:45827
static void printPresolverStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43337
int reopt_savesols
Definition: struct_set.h:438
SCIP_Real ub
Definition: struct_lp.h:128
SCIP_Real SCIPgetTimeOfDay(SCIP *scip)
Definition: scip.c:44830
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:30713
SCIP_Bool cutoffdelayed
Definition: struct_tree.h:217
#define SCIP_DECL_CONCSOLVERTYPEFREEDATA(x)
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17490
SCIP_RETCODE SCIPpricerActivate(SCIP_PRICER *pricer, SCIP_SET *set)
Definition: pricer.c:305
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
Definition: scip.c:46594
SCIP_RETCODE SCIPvarGetOrigvarSum(SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
Definition: var.c:12080
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5942
void SCIPprobPrintStatistics(SCIP_PROB *prob, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: prob.c:2114
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:2264
SCIP_RETCODE SCIPchgLpfeastol(SCIP *scip, SCIP_Real lpfeastol, SCIP_Bool printnewvalue)
Definition: scip.c:45363
void SCIPprobSetObjlim(SCIP_PROB *prob, SCIP_Real objlim)
Definition: prob.c:1443
void SCIPbranchcandInvalidate(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:191
SCIP_Longint SCIPconvertRealToLongint(SCIP *scip, SCIP_Real real)
Definition: scip.c:46610
SCIP_RETCODE SCIPcreateRelaxSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37110
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:7503
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:22414
int SCIPgetNOrigContVars(SCIP *scip)
Definition: scip.c:12179
SCIP_Bool SCIPsetIsSumEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5753
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:14489
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:39749
static SCIP_RETCODE freeReoptSolve(SCIP *scip)
Definition: scip.c:15061
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
Definition: scip.c:6366
SCIP_CLOCK * relaxsoltime
Definition: struct_stat.h:151
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: scip.c:5239
SCIP_NODE * SCIPgetFocusNode(SCIP *scip)
Definition: scip.c:40434
int nfixedvars
Definition: struct_prob.h:68
void SCIPchgDispMode(SCIP_DISP *disp, SCIP_DISPMODE mode)
Definition: scip.c:9356
SCIP_Real SCIPcalcChildEstimate(SCIP *scip, SCIP_VAR *var, SCIP_Real targetvalue)
Definition: scip.c:36681
void SCIPrelaxationSetSolObj(SCIP_RELAXATION *relaxation, SCIP_Real obj)
Definition: relax.c:685
SCIP_Real * SCIPgetNLPVarsLbDualsol(SCIP *scip)
Definition: scip.c:30970
SCIP_RETCODE SCIPdialoghdlrAddHistory(SCIP_DIALOGHDLR *dialoghdlr, SCIP_DIALOG *dialog, const char *command, SCIP_Bool escapecommand)
Definition: dialog.c:717
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:8669
static SCIP_RETCODE readSolFile(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool *partial, SCIP_Bool *error)
Definition: scip.c:39182
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:47120
SCIP_RETCODE SCIPsetGetCharParam(SCIP_SET *set, const char *name, char *value)
Definition: set.c:2896
#define SCIP_MAXTREEDEPTH
Definition: def.h:242
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:7592
int SCIPgetNConcsolverTypes(SCIP *scip)
Definition: scip.c:7926
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:2154
SCIP_RETCODE SCIPcreatePseudoSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37137
SCIP * scip
Definition: struct_var.h:200
SCIP_Real SCIPgetTransObjscale(SCIP *scip)
Definition: scip.c:11046
int SCIPpropGetNAggrVars(SCIP_PROP *prop)
Definition: prop.c:1122
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip.c:7690
int SCIPgetNBinVars(SCIP *scip)
Definition: scip.c:11676
static SCIP_RETCODE freeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip.c:14961
int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4549
SCIP_Longint nnz
Definition: struct_stat.h:167
helper functions for concurrent scip solvers
void SCIPsetEnableOrDisablePluginClocks(SCIP_SET *set, SCIP_Bool enabled)
Definition: set.c:772
SCIP_BDCHGINFO * SCIPvarGetLbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:15704
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:5578
SCIP_PARAM * SCIPsetGetParam(SCIP_SET *set, const char *name)
Definition: set.c:2829
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip.c:35033
SCIP_RETCODE SCIPsolAdjustImplicitSolVals(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool uselprows)
Definition: sol.c:425
const char * SCIPpropGetName(SCIP_PROP *prop)
Definition: prop.c:887
SCIP_CLOCK * lexduallptime
Definition: struct_stat.h:145
SCIP_BDCHGINFO * SCIPvarGetUbchgInfo(SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
Definition: var.c:15760
SCIP_RETCODE SCIPbranchcandFree(SCIP_BRANCHCAND **branchcand)
Definition: branch.c:172
SCIP_CONCSOLVERTYPE ** SCIPgetConcsolverTypes(SCIP *scip)
Definition: scip.c:7915
SCIP_RETCODE SCIPsetRelaxSolVals(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:19575
SCIP_Longint nnodesbeforefirst
Definition: struct_stat.h:111
SCIP_RETCODE SCIPsetCharParam(SCIP *scip, const char *name, char value)
Definition: scip.c:4799
void SCIPbranchruleSetInitsol(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINITSOL((*branchinitsol)))
Definition: branch.c:1839
SCIP_NODE * SCIPgetPrioSibling(SCIP *scip)
Definition: scip.c:40666
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:46
SCIP_RETCODE SCIPptrarrayClear(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:4488
SCIP_Real SCIPsetFeasFrac(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6120
static SCIP_RETCODE writeProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool transformed, SCIP_Bool genericnames)
Definition: scip.c:10157
int SCIPgetNVars(SCIP *scip)
Definition: scip.c:11631
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:5550
int SCIPconshdlrGetNPresolCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4959
SCIP_RETCODE SCIPsetComprPriority(SCIP *scip, SCIP_COMPR *compr, int priority)
Definition: scip.c:8411
SCIP_RETCODE SCIPlpReset(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter)
Definition: lp.c:9094
SCIP_Real SCIPgetVarMultaggrLbLocal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23483
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:4317
int SCIPpresolGetNChgSides(SCIP_PRESOL *presol)
Definition: presol.c:761
SCIP_Bool SCIPsetIsDualfeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6252
SCIP_Real SCIProwGetMaxActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6427
int SCIPparamGetInt(SCIP_PARAM *param)
Definition: paramset.c:716
SCIP_Bool reopt_sepaglbinfsubtrees
Definition: struct_set.h:451
SCIP_Real rhs
Definition: struct_lp.h:194
SCIP_RETCODE SCIPsetGetRealParam(SCIP_SET *set, const char *name, SCIP_Real *value)
Definition: set.c:2882
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:35604
SCIP_Longint SCIPconflictGetNPseudoCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:8042
SCIP_RETCODE SCIPsyncstoreExit(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:189
SCIP_RETCODE SCIPdelDelayedPoolCut(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:34262
SCIP_RETCODE SCIPsyncstoreCreate(SCIP_SYNCSTORE **syncstore)
Definition: syncstore.c:56
SCIP_Longint nrootlpiterations
Definition: struct_stat.h:54
SCIP_RETCODE SCIPwriteVarsLinearsum(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool type)
Definition: scip.c:17466
#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:4732
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
Definition: tree.c:7173
void SCIPenableNLP(SCIP *scip)
Definition: scip.c:30820
SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
Definition: scip.c:13333
SCIP_Real SCIPlpGetLooseObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12507
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:42261
SCIP_COMPR ** comprs
Definition: struct_set.h:78
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:13571
SCIP_CLOCK * strongbranchtime
Definition: struct_stat.h:148
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:1320
SCIP_PRESOL ** SCIPgetPresols(SCIP *scip)
Definition: scip.c:6998
SCIP_RETCODE SCIPaddPricedVar(SCIP *scip, SCIP_VAR *var, SCIP_Real score)
Definition: scip.c:11376
int SCIPgetBoolarrayMaxIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
Definition: scip.c:47071
SCIP_RETCODE SCIPaddSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool *stored)
Definition: scip.c:39549
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip.c:34999
SCIP_Longint SCIPgetNResolveLPs(SCIP *scip)
Definition: scip.c:41571
SCIP_RETCODE SCIPaddRowCutpool(SCIP *scip, SCIP_CUTPOOL *cutpool, SCIP_ROW *row)
Definition: scip.c:34117
#define SCIP_DECL_DIALOGEXEC(x)
Definition: type_dialog.h:87
SCIP_Bool SCIPsetIsSumPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5854
void SCIPrelaxationSetSolZero(SCIP_RELAXATION *relaxation, SCIP_Bool iszero)
Definition: relax.c:643
SCIP_RETCODE SCIPsolLinkRelaxSol(SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_RELAXATION *relaxation)
Definition: sol.c:867
SCIP_Bool SCIPhasNLPSolution(SCIP *scip)
Definition: scip.c:31313
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
Definition: var.c:17461
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:6087
SCIP_RETCODE SCIPgetReoptOldObjCoef(SCIP *scip, SCIP_VAR *var, int run, SCIP_Real *objcoef)
Definition: scip.c:16337
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
Definition: scip.c:6166
SCIP_Real SCIPgetAvgCutoffScore(SCIP *scip)
Definition: scip.c:43134
#define SCIP_VERSION
Definition: def.h:97
SCIP_CLIQUE ** SCIPgetCliques(SCIP *scip)
Definition: scip.c:24499
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
Definition: lp.c:16277
SCIP_Real SCIPgetVarAvgConflictlengthCurrentRun(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: scip.c:26170
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:250
SCIP_Bool SCIPparamIsValidChar(SCIP_PARAM *param, const char value)
Definition: paramset.c:4267
SCIP_Real SCIPgetTransObjoffset(SCIP *scip)
Definition: scip.c:11023
SCIP_RETCODE SCIPprintNodeRootPath(SCIP *scip, SCIP_NODE *node, FILE *file)
Definition: scip.c:40869
SCIP_RETCODE SCIPsetProbInitsol(SCIP *scip, SCIP_DECL_PROBINITSOL((*probinitsol)))
Definition: scip.c:9922
SCIP_RETCODE SCIPaddVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real addfactor)
Definition: scip.c:24820
int SCIPgetNHeurs(SCIP *scip)
Definition: scip.c:8166
int SCIPpropGetPresolPriority(SCIP_PROP *prop)
Definition: prop.c:917
SCIP_Bool SCIPisDualfeasPositive(SCIP *scip, SCIP_Real val)
Definition: scip.c:46336
SCIP_Real firstsolgap
Definition: struct_stat.h:120
SCIP_RETCODE SCIPsetConsStickingAtNode(SCIP *scip, SCIP_CONS *cons, SCIP_Bool stickingatnode)
Definition: scip.c:27649
SCIP_LPSOLSTAT SCIPgetLastStrongbranchLPSolStat(SCIP *scip, SCIP_BRANCHDIR branchdir)
Definition: scip.c:21090
int SCIPsepastoreGetNCutsFound(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1338
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:172
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
Definition: scip.c:30160
SCIP_Bool SCIPisObjIntegral(SCIP *scip)
Definition: scip.c:11205
SCIP_RETCODE SCIPcopyProb(SCIP *sourcescip, SCIP *targetscip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, const char *name)
Definition: scip.c:1730
SCIP_Bool misc_exactsolve
Definition: struct_set.h:343
void SCIPpropSetInit(SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
Definition: prop.c:778
SCIP_Real SCIPconflictGetInfeasibleLPTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:7363
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:2618
SCIP_RETCODE SCIPwriteVarsList(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_Bool type, char delimiter)
Definition: scip.c:17415
void SCIPbranchruleSetExecExt(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXECEXT((*branchexecext)))
Definition: branch.c:1874
#define SCIP_VARTYPE_IMPLINT_CHAR
Definition: def.h:108
int SCIPtreeGetNSiblings(SCIP_TREE *tree)
Definition: tree.c:7938
#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:4450
SCIP_Longint SCIPgetNNodeInitLPIterations(SCIP *scip)
Definition: scip.c:41739
void SCIPsepaSetPriority(SCIP_SEPA *sepa, SCIP_SET *set, int priority)
Definition: sepa.c:662
SCIP_Longint SCIPgetNNodeInitLPs(SCIP *scip)
Definition: scip.c:41721
int npricers
Definition: struct_set.h:93
SCIP_RETCODE SCIPincludeRelaxBasic(SCIP *scip, SCIP_RELAX **relaxptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool includeslp, SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
Definition: scip.c:7087
SCIP_RETCODE SCIPreadSolFile(SCIP *scip, const char *filename, SCIP_SOL *sol, SCIP_Bool xml, SCIP_Bool *partial, SCIP_Bool *error)
Definition: scip.c:39509
SCIP_Longint SCIPgetMemTotal(SCIP *scip)
Definition: scip.c:45575
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:1210
SCIP_Bool SCIProwIsLPEfficacious(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_Bool root)
Definition: lp.c:6584
SCIP_Bool SCIPtreeProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8164
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37075
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:3190
SCIP_Real SCIPgetAvgConflictlengthScore(SCIP *scip)
Definition: scip.c:42962
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:5774
int SCIPconshdlrGetMaxNActiveConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4839
SCIP_RETCODE SCIPcreatePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
Definition: scip.c:47086
SCIP_DIALOG * SCIPdialoghdlrGetRoot(SCIP_DIALOGHDLR *dialoghdlr)
Definition: dialog.c:425
int SCIPpresolGetNAddHoles(SCIP_PRESOL *presol)
Definition: presol.c:711
SCIP_RETCODE SCIPaddQuadVarToNlRow(SCIP *scip, SCIP_NLROW *nlrow, SCIP_VAR *var)
Definition: scip.c:32081
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:4225
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
Definition: scip.c:7383
SCIP_RETCODE SCIPprintLPSolutionQuality(SCIP *scip, FILE *file)
Definition: scip.c:29689
int SCIPgetNOrigIntVars(SCIP *scip)
Definition: scip.c:12125
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: scip.c:7771
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip.c:28897
SCIP_RETCODE SCIPsetSepaInit(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: scip.c:7399
SCIP_RETCODE SCIPwriteMIP(SCIP *scip, const char *filename, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_Bool lazyconss)
Definition: scip.c:29603
SCIP_RETCODE SCIPbranchPseudo(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:36969
int nactiveconss
Definition: struct_stat.h:214
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
SCIP_RETCODE SCIPsetRelaxSolVal(SCIP *scip, SCIP_VAR *var, SCIP_Real val)
Definition: scip.c:19545
SCIP_RETCODE SCIPaddQuadVarsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nvars, SCIP_VAR **vars)
Definition: scip.c:32106
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip.c:38931
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:338
SCIP_Real SCIPconcsolverGetSyncTime(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:498
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45790
SCIP_Longint SCIPconflictGetNBoundexceedingLPSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:7463
#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:6406
struct SCIP_ProbData SCIP_PROBDATA
Definition: type_prob.h:44
SCIP_RETCODE SCIPsetProbName(SCIP *scip, const char *name)
Definition: scip.c:10752
void SCIPnodeselSetStdPriority(SCIP_NODESEL *nodesel, SCIP_SET *set, int priority)
Definition: nodesel.c:1023
char ** extcodenames
Definition: struct_set.h:89
SCIP_RETCODE SCIPsolveProbingLPWithPricing(SCIP *scip, SCIP_Bool pretendroot, SCIP_Bool displayinfo, int maxpricerounds, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip.c:35737
SCIP_Bool nlpenabled
Definition: struct_prob.h:80
SCIP_NLPIPROBLEM * SCIPnlpGetNLPIProblem(SCIP_NLP *nlp)
Definition: nlp.c:5947
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
Definition: scip.c:45900
SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:34601
SCIP_Real SCIPgetVarImplRedcost(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing)
Definition: scip.c:19040
SCIP_RETCODE SCIPptrarrayFree(SCIP_PTRARRAY **ptrarray)
Definition: misc.c:4319
SCIP_Bool misc_catchctrlc
Definition: struct_set.h:339
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:4286
SCIP_RETCODE SCIPgetNlRowSolFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_SOL *sol, SCIP_Real *feasibility)
Definition: scip.c:32571
SCIP_RETCODE SCIPenfopsCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT *result)
Definition: scip.c:28280
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:16081
SCIP_RETCODE SCIPsepalpCons(SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result)
Definition: scip.c:28400
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:18294
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:38560
SCIP_Longint SCIPgetMemUsed(SCIP *scip)
Definition: scip.c:45562
SCIP_Longint SCIPgetNStrongbranchLPIterations(SCIP *scip)
Definition: scip.c:41811
SCIP_RETCODE SCIPlpSetCutoffbound(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real cutoffbound)
Definition: lp.c:9853
static const SCIP_Real scalars[]
Definition: lp.c:5563
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:1911
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:5100
void SCIPsetSortPresols(SCIP_SET *set)
Definition: set.c:3768
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:11311
SCIP_NLPI * SCIPfindNlpi(SCIP *scip, const char *name)
Definition: scip.c:9418
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:1906
SCIP_NODE * SCIPtreeGetRootNode(SCIP_TREE *tree)
Definition: tree.c:8153
internal methods for tree compressions
const char * xmlGetAttrval(const XML_NODE *node, const char *name)
Definition: xmlparse.c:1321
SCIP_Bool SCIPprimalUpperboundIsSol(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
Definition: primal.c:541
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:22527
int SCIPgetNNodesels(SCIP *scip)
Definition: scip.c:8896
SCIP_Longint SCIPbranchruleGetNPseudoCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2036
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:20874
internal methods for main solving loop and node processing
void SCIPsetSortRelaxsName(SCIP_SET *set)
Definition: set.c:3857
size_t BMSgetNUsedBufferMemory(BMS_BUFMEM *buffer)
Definition: memory.c:3162
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
Definition: scip.c:6046
SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
Definition: scip.c:10621
SCIP_RETCODE SCIPsetResetParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name)
Definition: set.c:3239
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:19466
static SCIP_Bool takeCut(SCIP *scip, SCIP_CUT *cut, char cutsel)
Definition: scip.c:1394
SCIP_Real SCIPtransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:38197
SCIP_CONS ** SCIPconshdlrGetCheckConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4505
int SCIPgetNReoptRuns(SCIP *scip)
Definition: scip.c:41126
SCIP_Longint SCIPgetNDivingLPs(SCIP *scip)
Definition: scip.c:41757
SCIP_VERBLEVEL disp_verblevel
Definition: struct_set.h:247
SCIP_RETCODE SCIPsetEventhdlrDelete(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_DECL_EVENTDELETE((*eventdelete)))
Definition: scip.c:8642
SCIP_Real SCIPgetHugeValue(SCIP *scip)
Definition: scip.c:45853
SCIP_RETCODE SCIPrestartSolve(SCIP *scip)
Definition: scip.c:16968
int SCIPdomchgGetNBoundchgs(SCIP_DOMCHG *domchg)
Definition: var.c:16499
SCIP_RETCODE SCIPsetChgParamFixed(SCIP_SET *set, const char *name, SCIP_Bool fixed)
Definition: set.c:2924
unsigned int SCIPnodeGetReoptID(SCIP_NODE *node)
Definition: tree.c:7214
SCIP_Real SCIPgetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx)
Definition: scip.c:46721
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
Definition: scip.c:27471
int nactivepricers
Definition: struct_set.h:94
int SCIPgetNReaders(SCIP *scip)
Definition: scip.c:5351
void SCIPsetSortConflicthdlrs(SCIP_SET *set)
Definition: set.c:3695
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:1991
#define SCIP_VARTYPE_CONTINUOUS_CHAR
Definition: def.h:109
SCIP_RETCODE SCIPendDiveNLP(SCIP *scip)
Definition: scip.c:31642
#define SCIP_DECL_SEPAEXIT(x)
Definition: type_sepa.h:71
int SCIPgetNBranchrules(SCIP *scip)
Definition: scip.c:9210
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
Definition: scip.c:6070
SCIP_Longint SCIPmemGetTotal(SCIP_MEM *mem)
Definition: mem.c:96
#define SCIP_PRESOLTIMING_FINAL
Definition: type_timing.h:46
SCIP_RETCODE SCIPresetClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:44912
SCIP_RETCODE SCIPeventfilterFree(SCIP_EVENTFILTER **eventfilter, BMS_BLKMEM *blkmem, SCIP_SET *set)
Definition: event.c:1718
int SCIPgetNPricevars(SCIP *scip)
Definition: scip.c:41881
SCIP_RETCODE SCIPnlpFree(SCIP_NLP **nlp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: nlp.c:5173
SCIP_Longint SCIPgetNPrimalLPIterations(SCIP *scip)
Definition: scip.c:41481
int SCIPgetNConss(SCIP *scip)
Definition: scip.c:12679
void SCIPbranchruleSetExitsol(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXITSOL((*branchexitsol)))
Definition: branch.c:1850
SCIP_RETCODE SCIPsetIncludeBranchrule(SCIP_SET *set, SCIP_BRANCHRULE *branchrule)
Definition: set.c:4406
#define SCIP_DECL_CONSFREE(x)
Definition: type_cons.h:74
SCIP_RETCODE SCIPsolCreateLPSol(SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_HEUR *heur)
Definition: sol.c:560
SCIP_RETCODE SCIPintarrayExtend(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:3612
SCIP_RETCODE SCIPptrarraySetVal(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, void *val)
Definition: misc.c:4540
SCIP_BRANCHRULE ** SCIPgetBranchrules(SCIP *scip)
Definition: scip.c:9199
SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
Definition: scip.c:1861
SCIP_RETCODE SCIPtreeMarkProbingNodeHasLP(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_LP *lp)
Definition: tree.c:6445
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:8086
SCIP_CLOCK * solvingtime
Definition: struct_stat.h:139
SCIP_Longint nbarrierlps
Definition: struct_stat.h:177
void SCIPconshdlrSetDisable(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
Definition: cons.c:4403
void SCIPsetMessagehdlrLogfile(SCIP *scip, const char *filename)
Definition: scip.c:1236
void SCIPheurSetExit(SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
Definition: heur.c:1148
SCIP_Longint nprimalzeroitlps
Definition: struct_stat.h:173
SCIP_RETCODE SCIPendStrongbranch(SCIP *scip)
Definition: scip.c:19840
SCIP_RETCODE SCIPreoptUpdateVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nvars)
Definition: reopt.c:6549
SCIP_RETCODE SCIPsetComprExit(SCIP *scip, SCIP_COMPR *compr, SCIP_DECL_COMPREXIT((*comprexit)))
Definition: scip.c:8326
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
Definition: scip.c:27323
SCIP_CLOCK * primallptime
Definition: struct_stat.h:143
int conf_maxstoresize
Definition: struct_set.h:181
#define SCIP_DECL_DISPEXIT(x)
Definition: type_disp.h:95
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
Definition: scip.c:4889
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:6889
SCIP_Real SCIPgetAvgPseudocostCount(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:42775
int SCIPgetRealarrayMinIdx(SCIP *scip, SCIP_REALARRAY *realarray)
Definition: scip.c:46774
#define SCIP_DECL_SEPAINITSOL(x)
Definition: type_sepa.h:82
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
Definition: scip.c:19659
int SCIPbranchcandGetNPrioPseudoBins(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:841
#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:14162
SCIP_RETCODE SCIPreoptnodeReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_REOPTNODE *reoptnode)
Definition: reopt.c:7877
#define SCIP_DECL_HEUREXIT(x)
Definition: type_heur.h:84
SCIP_RETCODE SCIPclearIntarray(SCIP *scip, SCIP_INTARRAY *intarray)
Definition: scip.c:46856
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_RELAXATION *relaxation, SCIP_PRIMAL *primal, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, int probingdepth)
Definition: tree.c:6619
SCIP_Bool SCIPallowDualReds(SCIP *scip)
Definition: scip.c:25447
SCIP_SET * set
Definition: struct_scip.h:62
int SCIPgetNCuts(SCIP *scip)
Definition: scip.c:34387
int SCIPgetNPriceRounds(SCIP *scip)
Definition: scip.c:41863
SCIP_Real SCIPcomprGetSetupTime(SCIP_COMPR *compr)
Definition: compr.c:493
void SCIPsyncstoreSetSolveIsStopped(SCIP_SYNCSTORE *syncstore, SCIP_Bool stopped)
Definition: syncstore.c:244
SCIP_Bool misc_transsolsorig
Definition: struct_set.h:352
SCIP_RETCODE SCIPsetNodeselFree(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELFREE((*nodeselfree)))
Definition: scip.c:8792
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:14765
SCIP_Longint npsbestsolsfound
Definition: struct_stat.h:96
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:1088
int SCIPgetRepropdepth(SCIP *scip)
Definition: scip.c:40852
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
Definition: scip.c:6190
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:3757
SCIP_PROP ** props
Definition: struct_set.h:75
SCIP_RETCODE SCIPaddRowProbing(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:35765
SCIP_RETCODE SCIPboolarrayFree(SCIP_BOOLARRAY **boolarray)
Definition: misc.c:3964
SCIP_SOLORIGIN SCIPsolGetOrigin(SCIP_SOL *sol)
Definition: sol.c:2289
#define SCIP_DECL_HEURINIT(x)
Definition: type_heur.h:76
int SCIPgetNUpgrConss(SCIP *scip)
Definition: scip.c:12637
int SCIPgetNCliques(SCIP *scip)
Definition: scip.c:24472
SCIP_RETCODE SCIPsplitReoptRoot(SCIP *scip, int *ncreatedchilds, int *naddedconss)
Definition: scip.c:17142
SCIP_RETCODE SCIPconflictInit(SCIP_CONFLICT *conflict, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_CONFTYPE conftype, SCIP_Bool usescutoffbound)
Definition: conflict.c:2744
static void printConflictStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43594
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:30579
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: scip.c:8076
SCIP_RETCODE SCIPaddVarBranchPriority(SCIP *scip, SCIP_VAR *var, int addpriority)
Definition: scip.c:24925
void SCIPprobUpdateDualbound(SCIP_PROB *prob, SCIP_Real newbound)
Definition: prob.c:1546
void SCIPpresolSetCopy(SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: presol.c:487
#define SCIP_DECL_CONSINIT(x)
Definition: type_cons.h:84
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:6561
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:20095
#define SCIP_DECL_PROPPRESOL(x)
Definition: type_prop.h:179
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
Definition: scip.c:38222
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:46163
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:608
int ncomprs
Definition: struct_set.h:110
SCIP_Real SCIPgetAvgInferenceScoreCurrentRun(SCIP *scip)
Definition: scip.c:43073
int SCIPgetNImplications(SCIP *scip)
Definition: scip.c:44742
SCIP_Real * scalars
Definition: struct_var.h:184
static void printRelaxatorStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44045
SCIP_Longint SCIPgetMemExternEstim(SCIP *scip)
Definition: scip.c:45588
SCIP_Real SCIProwGetLPFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6074
SCIP_NODESEL * SCIPfindNodesel(SCIP *scip, const char *name)
Definition: scip.c:8872
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:3162
SCIP_Bool SCIPsetIsGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5598
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:2725
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip.c:11586
int SCIPcolGetNStrongbranchs(SCIP_COL *col)
Definition: lp.c:16212
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: scip.c:7674
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:1142
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
Definition: scip.c:31338
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:16696
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
Definition: var.c:16671
SCIP_Real sepa_minactivityquot
Definition: struct_set.h:474
SCIP_HEUR * SCIPgetSolHeur(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38330
#define SCIPdebugSolDisable(scip)
Definition: debug.h:268
enum SCIP_DispStatus SCIP_DISPSTATUS
Definition: type_disp.h:50
SCIP_Bool misc_transorigsols
Definition: struct_set.h:351
SCIP_RETCODE SCIPupdatePrimalRay(SCIP *scip, SCIP_SOL *primalray)
Definition: scip.c:40169
SCIP_RETCODE SCIPcalcNegatedCliquePartition(SCIP *const scip, SCIP_VAR **const vars, int const nvars, int *const cliquepartition, int *const ncliques)
Definition: scip.c:24372
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:25250
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:4925
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:4158
#define SCIP_DECL_CONSENFORELAX(x)
Definition: type_cons.h:346
SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
Definition: tree.c:7133
default user interface dialog
SCIP_Longint SCIPgetNBestSolsFound(SCIP *scip)
Definition: scip.c:42718
SCIP_Longint SCIPconshdlrGetNChildren(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4829
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:18350
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:135
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
Definition: cons.c:8130
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:30314
internal methods for problem statistics
int SCIPgetNPricevarsFound(SCIP *scip)
Definition: scip.c:41899
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1896
SCIP_RETCODE SCIPgetNlRowNLPFeasibility(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *feasibility)
Definition: scip.c:32358
#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:392
SCIP_RETCODE SCIPsetIncludeReader(SCIP_SET *set, SCIP_READER *reader)
Definition: set.c:3375
SCIP_PRICER ** pricers
Definition: struct_set.h:66
SCIP_RETCODE SCIPmemFree(SCIP_MEM **mem)
Definition: mem.c:59
enum SCIP_Stage SCIP_STAGE
Definition: type_set.h:50
SCIP_RETCODE SCIPsetRelaxSolValsSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:19614
void SCIPheurSetInit(SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
Definition: heur.c:1137
SCIP_RETCODE SCIPsolveParallel(SCIP *scip)
Definition: scip.c:16057
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:1138
SCIP_DECL_CONSPRINT(ConshdlrSubtour::scip_print)
SCIP_BRANCHRULE * SCIPsetFindBranchrule(SCIP_SET *set, const char *name)
Definition: set.c:4430
SCIP_Longint SCIPvarGetNBranchings(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15001
SCIP_Bool SCIPlpIsSolved(SCIP_LP *lp)
Definition: lp.c:16779
SCIP_Real firstprimaltime
Definition: struct_stat.h:119
SCIP_RETCODE SCIPvarsGetProbvarBinary(SCIP_VAR ***vars, SCIP_Bool **negatedarr, int nvars)
Definition: var.c:11584
enum SCIP_ConflictType SCIP_CONFTYPE
Definition: type_conflict.h:53
SCIP_RETCODE SCIPcliquetableComputeCliqueComponents(SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, SCIP_VAR **vars, int nbinvars, int nintvars, int nimplvars)
Definition: implics.c:3043
SCIP_RETCODE SCIPchgVarBranchDirection(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdirection)
Definition: scip.c:24956
#define MIN(x, y)
Definition: memory.c:75
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
Definition: scip.c:6504
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:7520
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:5376
SCIP_Bool SCIPisScalingIntegral(SCIP *scip, SCIP_Real val, SCIP_Real scalar)
Definition: scip.c:45912
SCIP_Bool SCIPsetIsFeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6041
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30508
SCIP_Bool reopt_commontimelimit
Definition: struct_set.h:441
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:3241
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:24529
#define SCIP_DECL_EVENTCOPY(x)
Definition: type_event.h:165
SCIP_Real SCIPsetDualfeastol(SCIP_SET *set)
Definition: set.c:5436
SCIP_RETCODE SCIPtreeLoadProbingLPState(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
Definition: tree.c:6372
#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:604
SCIP_Longint nrepropboundchgs
Definition: struct_stat.h:88
SCIP_Longint SCIPconflictGetNStrongbranchCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:7805
SCIP_Longint SCIPconflictGetNInfeasibleLPIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:7433
SCIP_Real SCIPconflictGetVarLb(SCIP_CONFLICT *conflict, SCIP_VAR *var)
Definition: conflict.c:3386
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:3460
SCIP_RETCODE SCIPsetBranchruleInit(SCIP *scip, SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHINIT((*branchinit)))
Definition: scip.c:9070
int SCIPsepastoreGetNCutsFoundRound(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1348
SCIP_NLP * nlp
Definition: struct_scip.h:81
SCIP_Real firstprimalbound
Definition: struct_stat.h:118
int SCIPconshdlrGetNCheckConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4535
SCIP_Real SCIPgetGlobalPseudoObjval(SCIP *scip)
Definition: scip.c:28958
SCIP_Longint ntotalinternalnodes
Definition: struct_stat.h:77
SCIP_Bool random_permuteconss
Definition: struct_set.h:366
SCIP_RETCODE SCIPsetFreeConcsolvers(SCIP_SET *set)
Definition: set.c:4104
void SCIPconshdlrSetDelvars(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELVARS((*consdelvars)))
Definition: cons.c:4414
SCIP_Longint SCIPsepaGetNCutsApplied(SCIP_SEPA *sepa)
Definition: sepa.c:789
#define SCIP_DECL_HEURFREE(x)
Definition: type_heur.h:68
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
Definition: cons.c:8070
SCIP_Longint SCIPconshdlrGetNSepaCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4689
SCIP_Bool SCIPdoNotAggr(SCIP *scip)
Definition: scip.c:25414
int SCIPgetNPoolCuts(SCIP *scip)
Definition: scip.c:34023
SCIP_RETCODE SCIPconflictIsVarUsed(SCIP_CONFLICT *conflict, SCIP_VAR *var, SCIP_SET *set, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool *used)
Definition: conflict.c:3326
SCIP_RETCODE SCIPtransformVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
Definition: scip.c:18485
#define BMSallocMemory(ptr)
Definition: memory.h:74
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:16415
SCIP_Real SCIPvarGetVSIDS(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:17631
#define SCIP_INVALID
Definition: def.h:155
int nnlpis
Definition: struct_set.h:122
void SCIPpropSetResprop(SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
Definition: prop.c:876
#define SCIP_DECL_CONFLICTINIT(x)
Definition: type_conflict.h:77
SCIP_Real SCIPgetLocalOrigEstimate(SCIP *scip)
Definition: scip.c:13164
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:5518
int nextcodes
Definition: struct_set.h:128
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip.c:7626
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
Definition: cons.c:8060
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:5937
SCIP_DECL_READERREAD(ReaderTSP::scip_read)
Definition: ReaderTSP.cpp:150
int SCIPgetNConflictConssFoundNode(SCIP *scip)
Definition: scip.c:42044
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:46285
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition: scip.c:30762
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:30402
#define SCIP_DECL_CONSACTIVE(x)
Definition: type_cons.h:638
SCIP_RETCODE SCIPsetConsModifiable(SCIP *scip, SCIP_CONS *cons, SCIP_Bool modifiable)
Definition: scip.c:27574
SCIP_NODE * SCIPtreeGetPrioChild(SCIP_TREE *tree)
Definition: tree.c:6806
SCIP_Real primsol
Definition: struct_lp.h:137
SCIP_Bool SCIPlpIsRelax(SCIP_LP *lp)
Definition: lp.c:16769
SCIP_Longint SCIPconflictGetNAppliedGlobalLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:2517
SCIP_CLOCK * duallptime
Definition: struct_stat.h:144
SCIP_RETCODE SCIPlinkRelaxSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37730
SCIP_RETCODE SCIPnlpSetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char *sval)
Definition: nlp.c:6097
static SCIP_RETCODE tightenBounds(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
Definition: scip.c:24973
SCIP_RETCODE SCIPprintNlRow(SCIP *scip, SCIP_NLROW *nlrow, FILE *file)
Definition: scip.c:32630
SCIP_RETCODE SCIPaddConsLocks(SCIP *scip, SCIP_CONS *cons, int nlockspos, int nlocksneg)
Definition: scip.c:28222
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:441
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:668
void SCIPbranchruleSetMaxbounddist(SCIP_BRANCHRULE *branchrule, SCIP_Real maxbounddist)
Definition: branch.c:1972
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: scip.c:5287
SCIP_Real SCIPgetOrigObjoffset(SCIP *scip)
Definition: scip.c:10975
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:1539
int SCIPgetNCompr(SCIP *scip)
Definition: scip.c:8400
SCIP_Real SCIPcutoffbounddelta(SCIP *scip)
Definition: scip.c:45330
int SCIPsolGetDepth(SCIP_SOL *sol)
Definition: sol.c:2372
SCIP_CLOCK * reoptupdatetime
Definition: struct_stat.h:158
SCIP_RETCODE SCIPcreateCurrentSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37160
#define SCIP_Longint
Definition: def.h:120
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1317
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip.c:29244
SCIP_RETCODE SCIPsetSetDefaultIntParam(SCIP_SET *set, const char *name, int defaultvalue)
Definition: set.c:3043
SCIP_RETCODE SCIPsetSetDualfeastol(SCIP_SET *set, SCIP_Real dualfeastol)
Definition: set.c:5202
#define SCIP_DECL_PROPEXIT(x)
Definition: type_prop.h:71
SCIP_Bool SCIPsetIsDualfeasZero(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6241
int SCIPconshdlrGetNAggrVars(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4869
SCIP_RETCODE SCIPsetNodeselInit(SCIP *scip, SCIP_NODESEL *nodesel, SCIP_DECL_NODESELINIT((*nodeselinit)))
Definition: scip.c:8808
SCIP_VAR ** SCIPnlpGetVars(SCIP_NLP *nlp)
Definition: nlp.c:5780
int SCIPvarGetIndex(SCIP_VAR *var)
Definition: var.c:16849
void SCIPbranchruleSetExit(SCIP_BRANCHRULE *branchrule, SCIP_DECL_BRANCHEXIT((*branchexit)))
Definition: branch.c:1828
SCIP_Real SCIPgetTotalTime(SCIP *scip)
Definition: scip.c:45110
SCIP_NODE * SCIPgetPrioChild(SCIP *scip)
Definition: scip.c:40650
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip.c:30736
SCIP_Longint nactivatednodes
Definition: struct_stat.h:81
SCIP_Real SCIPgetVarLbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:34839
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:583
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:37836
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:36921
SCIP_NODE * SCIPgetBestChild(SCIP *scip)
Definition: scip.c:40682
SCIP_Longint nprimallpiterations
Definition: struct_stat.h:56
SCIP_Real SCIPfrac(SCIP *scip, SCIP_Real val)
Definition: scip.c:45973
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:5567
SCIP_RETCODE SCIPcheckCopyLimits(SCIP *sourcescip, SCIP_Bool *success)
Definition: scip.c:4090
SCIP_Longint nreprops
Definition: struct_stat.h:87
SCIP_Real SCIPvarGetAvgCutoffs(SCIP_VAR *var, SCIP_STAT *stat, SCIP_BRANCHDIR dir)
Definition: var.c:15559
SCIP_Real lb
Definition: struct_var.h:160
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:5986
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:2309
SCIP_RETCODE SCIPreoptSaveActiveConss(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
Definition: reopt.c:8113
SCIP_RETCODE SCIPrealarraySetVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real val)
Definition: misc.c:3448
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:16717
SCIP_TREE * tree
Definition: struct_scip.h:84
declarations for XML parsing
SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
Definition: scip.c:10881
SCIP_RETCODE SCIPlpGetBInvARow(SCIP_LP *lp, int r, SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9571
void SCIPprobInvalidateDualbound(SCIP_PROB *prob)
Definition: prob.c:1573
void SCIPnodeselSetCopy(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELCOPY((*nodeselcopy)))
Definition: nodesel.c:1084
int SCIPpricerGetNVarsFound(SCIP_PRICER *pricer)
Definition: pricer.c:604
void SCIProwMarkNotRemovableLocal(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:7613
#define SCIP_VARTYPE_BINARY_CHAR
Definition: def.h:106
SCIP_RETCODE SCIPreleaseDialog(SCIP *scip, SCIP_DIALOG **dialog)
Definition: scip.c:9622
SCIP_RETCODE SCIPsetChgStringParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_PARAM *param, const char *value)
Definition: set.c:3171
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:34477
SCIP_RETCODE SCIPsetGetLongintParam(SCIP_SET *set, const char *name, SCIP_Longint *value)
Definition: set.c:2868
int SCIPsetInitializeRandomSeed(SCIP_SET *set, int initialseedvalue)
Definition: set.c:6702
SCIP_RETCODE SCIPintarrayClear(SCIP_INTARRAY *intarray)
Definition: misc.c:3767
SCIP_Real SCIPvarGetMultaggrUbLocal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:8029
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:1709
SCIP_RETCODE SCIPincludeExternalCodeInformation(SCIP *scip, const char *name, const char *description)
Definition: scip.c:9470
SCIP_Longint SCIPconcsolverGetNLPIterations(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:508
SCIP_CLOCK * nodeactivationtime
Definition: struct_stat.h:154
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip.c:37909
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:17942
SCIP_Real SCIPgetNodeLowerbound(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:13259
void SCIPprobSetDeltrans(SCIP_PROB *prob, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: prob.c:350
SCIP_RETCODE SCIPtransformProb(SCIP *scip)
Definition: scip.c:13668
SCIP_RETCODE SCIPsetNlpiPriority(SCIP *scip, SCIP_NLPI *nlpi, int priority)
Definition: scip.c:9455
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:47023
SCIP_RETCODE SCIPconsMarkPropagate(SCIP_CONS *cons, SCIP_SET *set)
Definition: cons.c:6910
SCIP_Longint ndualzeroitlps
Definition: struct_stat.h:175
SCIP_Real firstlptime
Definition: struct_stat.h:127
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:3133
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
Definition: scip.c:45864
SCIP_Bool SCIPdoNotMultaggr(SCIP *scip)
Definition: scip.c:25424
SCIP_DOM glbdom
Definition: struct_var.h:218
SCIP_Real SCIPsetEpsilon(SCIP_SET *set)
Definition: set.c:5406
SCIP_Bool dualfeasible
Definition: struct_lp.h:345
SCIP_RETCODE SCIPnlpGetStringPar(SCIP_NLP *nlp, SCIP_NLPPARAM type, const char **sval)
Definition: nlp.c:6080
SCIP_Real SCIPgetVarConflictScoreCurrentRun(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26051
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:6479
struct SCIP_PricerData SCIP_PRICERDATA
Definition: type_pricer.h:36
SCIP_RETCODE SCIPbranchExtern(SCIP *scip, SCIP_RESULT *result)
Definition: scip.c:36945
SCIP_Real SCIPcolGetFarkasCoef(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:3994
SCIP_SEPA ** SCIPgetSepas(SCIP *scip)
Definition: scip.c:7476
int SCIPbranchcandGetNPrioPseudoInts(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:851
void SCIPsepaSetInit(SCIP_SEPA *sepa, SCIP_DECL_SEPAINIT((*sepainit)))
Definition: sepa.c:588
SCIP_Real SCIPgetNLPObjval(SCIP *scip)
Definition: scip.c:31289
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45777
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:66
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:6044
SCIP_Longint SCIPconflictGetNAppliedConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:2477
SCIP_Real SCIPgetAvgPseudocostScore(SCIP *scip)
Definition: scip.c:42815
SCIP_Real SCIPgetLPRootObjval(SCIP *scip)
Definition: scip.c:29022
SCIP_DECL_EVENTDELETE(EventhdlrNewSol::scip_delete)
SCIP_DECL_CONSCOPY(ConshdlrSubtour::scip_copy)
SCIP_Real SCIPgetVarSol(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19446
SCIP_RETCODE SCIPstartDiveNLP(SCIP *scip)
Definition: scip.c:31614
SCIP_Longint SCIPgetNLimSolsFound(SCIP *scip)
Definition: scip.c:42691
enum Reopt_ConsType REOPT_CONSTYPE
Definition: type_reopt.h:67
SCIP_RETCODE SCIPsyncstoreCapture(SCIP_SYNCSTORE *syncstore)
Definition: syncstore.c:111
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:235
int nchildren
Definition: struct_tree.h:202
int SCIPgetNOrigImplVars(SCIP *scip)
Definition: scip.c:12152
SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
Definition: scip.c:9901
SCIP_Longint ninternalnodes
Definition: struct_stat.h:72
SCIP_Bool SCIPconsIsConflict(SCIP_CONS *cons)
Definition: cons.c:8030
SCIP_Bool performpresol
Definition: struct_stat.h:256
SCIP_Real SCIPgetColFarkasCoef(SCIP *scip, SCIP_COL *col)
Definition: scip.c:29845
int SCIPgetNLPCols(SCIP *scip)
Definition: scip.c:29143
SCIP_Real SCIPprobExternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:2010
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
Definition: scip.c:8044
SCIP_RETCODE SCIPsetPricerCopy(SCIP *scip, SCIP_PRICER *pricer, SCIP_DECL_PRICERCOPY((*pricercopy)))
Definition: scip.c:5482
#define nnodes
Definition: gastrans.c:65
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17232
SCIP_Bool SCIPhasPerformedPresolve(SCIP *scip)
Definition: scip.c:1109
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:7483
int SCIPgetPtrarrayMinIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
Definition: scip.c:47186
SCIP_Real SCIPgetVarMultaggrLbGlobal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:23453
SCIP_RETCODE SCIPnewProbingNode(SCIP *scip)
Definition: scip.c:35092
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:35902
SCIP_Real SCIPtreeGetLowerbound(SCIP_TREE *tree, SCIP_SET *set)
Definition: tree.c:6956
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
Definition: implics.c:3295
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:6069
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:46187
SCIP_Bool SCIPsetIsUbBetter(SCIP_SET *set, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
Definition: set.c:6370
void SCIPprimalAddOrigObjoffset(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_Real addval)
Definition: primal.c:507
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
Definition: var.c:16694
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:1427
SCIP_RETCODE SCIPreoptReset(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: reopt.c:5642
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
Definition: cons.c:8090
SCIP_Bool SCIPisDualfeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46259
int plungedepth
Definition: struct_stat.h:213
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:4930
SCIP_RETCODE SCIPtightenVarUbGlobal(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip.c:23255
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:3978
int SCIPgetNPricevarsApplied(SCIP *scip)
Definition: scip.c:41917
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:5006
int nconshdlrs
Definition: struct_set.h:96
SCIP_Bool concurrent_presolvebefore
Definition: struct_set.h:504
SCIP_Bool inrestart
Definition: struct_stat.h:254
SCIP_Longint SCIPconflictGetNPropReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:4478
SCIP_Real SCIPcutpoolGetTime(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:872
SCIP_VAR ** SCIPnlrowGetLinearVars(SCIP_NLROW *nlrow)
Definition: nlp.c:3255
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_Bool includeslp, 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 SCIPsetIsDualfeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6263
SCIP_Real SCIPgetAvgPseudocost(SCIP *scip, SCIP_Real solvaldelta)
Definition: scip.c:42735
SCIP_Real SCIPsumepsilon(SCIP *scip)
Definition: scip.c:45260
int SCIPcutGetAge(SCIP_CUT *cut)
Definition: cutpool.c:367
#define SCIP_DECL_RELAXEXITSOL(x)
Definition: type_relax.h:93
SCIP_RETCODE SCIPinterruptSolve(SCIP *scip)
Definition: scip.c:16942
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
Definition: scip.c:9431
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:17693
SCIP_Real SCIPgetUpperbound(SCIP *scip)
Definition: scip.c:42472
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:626
SCIP_NODE * SCIPgetBestLeaf(SCIP *scip)
Definition: scip.c:40714
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:26387
SCIP_RETCODE SCIPstartProbing(SCIP *scip)
Definition: scip.c:35055
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:2846
SCIP_RETCODE SCIPlpGetBInvACol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9596
#define BMSclearMemoryArray(ptr, num)
Definition: memory.h:85
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:5738
SCIP_DISP ** SCIPgetDisps(SCIP *scip)
Definition: scip.c:9321
SCIP_Real * SCIPnlpGetVarsUbDualsol(SCIP_NLP *nlp)
Definition: nlp.c:5907
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:1608
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:20012
SCIP_RETCODE SCIPdialoghdlrExec(SCIP_DIALOGHDLR *dialoghdlr, SCIP_SET *set)
Definition: dialog.c:374
SCIP_Longint nnodelps
Definition: struct_stat.h:182
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:45998
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip.c:29165
SCIP_Real SCIPconflictGetPropTime(SCIP_CONFLICT *conflict)
Definition: conflict.c:4418
int SCIPgetNSepas(SCIP *scip)
Definition: scip.c:7489
SCIP_Bool SCIPsolIsPartial(SCIP_SOL *sol)
Definition: sol.c:2309
SCIP_RETCODE SCIPgetTransformedConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
Definition: scip.c:27864
void xmlFreeNode(XML_NODE *node)
Definition: xmlparse.c:1259
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:6320
SCIP_RETCODE SCIPreoptSaveGlobalBounds(SCIP_REOPT *reopt, SCIP_PROB *transprob, BMS_BLKMEM *blkmem)
Definition: reopt.c:8075
int SCIPgetNExternBranchCands(SCIP *scip)
Definition: scip.c:36276
int SCIPgetNOrigBinVars(SCIP *scip)
Definition: scip.c:12098
SCIP_RETCODE SCIPparamWrite(SCIP_PARAM *param, SCIP_MESSAGEHDLR *messagehdlr, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: paramset.c:4640
SCIP_RETCODE SCIPupdateVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
Definition: scip.c:24892
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:1836
SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip, SCIP_DECL_PROBDELORIG((*probdelorig)))
Definition: scip.c:9859
#define SCIP_DECL_DISPOUTPUT(x)
Definition: type_disp.h:126
void SCIPswapInts(int *value1, int *value2)
Definition: misc.c:8970
SCIP_Real SCIPgetPseudoObjval(SCIP *scip)
Definition: scip.c:28983
SCIP_Bool misc_calcintegral
Definition: struct_set.h:353
int SCIPsolGetRunnum(SCIP_SOL *sol)
Definition: sol.c:2352
int nrootintfixingsrun
Definition: struct_stat.h:200
static SCIP_Real getUpperbound(SCIP *scip)
Definition: scip.c:489
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:31793
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:392
void SCIPdisableDebugSol(SCIP *scip)
Definition: scip.c:1168
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:4123
SCIP_RETCODE SCIPnlpInclude(SCIP_SET *set, BMS_BLKMEM *blkmem)
Definition: nlp.c:5027
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:34520
void SCIPaddNNodes(SCIP *scip, SCIP_Longint nnodes)
Definition: scip.c:41153
SCIP_RETCODE SCIPvarGetProbvarSum(SCIP_VAR **var, SCIP_SET *set, SCIP_Real *scalar, SCIP_Real *constant)
Definition: var.c:11953
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:12866
#define SCIP_DECL_CONFLICTFREE(x)
Definition: type_conflict.h:69
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:2749
SCIP_CUTPOOL * SCIPgetGlobalCutpool(SCIP *scip)
Definition: scip.c:34041
SCIP_NODE * root
Definition: struct_tree.h:168
int SCIPpropGetNDelConss(SCIP_PROP *prop)
Definition: prop.c:1162
#define SCIP_CALL_ABORT(x)
Definition: def.h:285
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
Definition: scip.c:45949
SCIP_RETCODE SCIPprimalFree(SCIP_PRIMAL **primal, BMS_BLKMEM *blkmem)
Definition: primal.c:146
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip.c:670
SCIP_RETCODE SCIPprimalUpdateRay(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *primalray, BMS_BLKMEM *blkmem)
Definition: primal.c:564
SCIP_RETCODE SCIPsetExitPlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4773
SCIP_RETCODE SCIPsetPropInitpre(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITPRE((*propinitpre)))
Definition: scip.c:7706
internal methods for primal heuristics
SCIP_Real SCIPvarGetPseudoSol(SCIP_VAR *var)
Definition: var.c:17618
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:2375
SCIP_RETCODE SCIPfreeSolve(SCIP *scip, SCIP_Bool restart)
Definition: scip.c:16740
SCIP_RETCODE SCIPsetGetBoolParam(SCIP_SET *set, const char *name, SCIP_Bool *value)
Definition: set.c:2840
static void printBranchruleStatistics(SCIP *scip, FILE *file)
Definition: scip.c:43779
void SCIPrelaxSetExit(SCIP_RELAX *relax, SCIP_DECL_RELAXEXIT((*relaxexit)))
Definition: relax.c:413
SCIP_RETCODE SCIPchgRowRhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
Definition: scip.c:34778
SCIP_RETCODE SCIPdivesetCreate(SCIP_DIVESET **diveset, SCIP_HEUR *heur, const char *name, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_Real minreldepth, SCIP_Real maxreldepth, SCIP_Real maxlpiterquot, SCIP_Real maxdiveubquot, SCIP_Real maxdiveavgquot, SCIP_Real maxdiveubquotnosol, SCIP_Real maxdiveavgquotnosol, SCIP_Real lpresolvedomchgquot, int lpsolvefreq, int maxlpiterofs, unsigned int initialseed, SCIP_Bool backtrack, SCIP_Bool onlylpbranchcands, SCIP_DIVETYPE divetypemask, SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)))
Definition: heur.c:185
int SCIPgetNEnabledConss(SCIP *scip)
Definition: scip.c:42243
SCIP_DISP ** disps
Definition: struct_set.h:83
SCIP_RETCODE SCIPptrarrayCreate(SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem)
Definition: misc.c:4276
SCIP_RETCODE SCIPsepastoreClearCuts(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp)
Definition: sepastore.c:1220
SCIP_RETCODE SCIPcleanupCliques(SCIP *scip, SCIP_Bool *infeasible)
Definition: scip.c:24429
SCIP_REOPTNODE * SCIPgetReoptnode(SCIP *scip, unsigned int id)
Definition: scip.c:16468
SCIP_Longint nrelaxsolsfound
Definition: struct_stat.h:91
SCIP_Real SCIPgetVarFarkasCoef(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19085
SCIP_Bool SCIPisDualfeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46272
SCIP_RETCODE SCIPsetExitprePlugins(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat)
Definition: set.c:4898
SCIP_RETCODE SCIPgetNlRowNLPActivity(SCIP *scip, SCIP_NLROW *nlrow, SCIP_Real *activity)
Definition: scip.c:32330
SCIP_ORIGINAL original
Definition: struct_var.h:222
SCIP_RETCODE SCIPsetConflicthdlrPriority(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, int priority)
Definition: scip.c:6790
SCIP_Real SCIPcolGetRedcost(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:3811
int npresols
Definition: struct_set.h:100
SCIP_RETCODE SCIPchgIntParam(SCIP *scip, SCIP_PARAM *param, int value)
Definition: scip.c:4599
#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:247
int SCIPgetNReoptLeaves(SCIP *scip, SCIP_NODE *node)
Definition: scip.c:16455
int SCIPpropGetNAddHoles(SCIP_PROP *prop)
Definition: prop.c:1152
SCIP_Real SCIPheurGetTime(SCIP_HEUR *heur)
Definition: heur.c:1369
SCIP_RETCODE SCIPresetParam(SCIP *scip, const char *name)
Definition: scip.c:4952
SCIP_Bool nlp_disable
Definition: struct_set.h:326
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
Definition: scip.c:6118
SCIP_VAR * SCIPvarGetTransVar(SCIP_VAR *var)
Definition: var.c:16869
#define SCIP_ALLOC(x)
Definition: def.h:317
SCIP_Longint SCIPgetNNodes(SCIP *scip)
Definition: scip.c:41182
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:2511
SCIP_Real SCIPlpGetColumnObjval(SCIP_LP *lp)
Definition: lp.c:12496
void SCIProwRecalcPseudoActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:6215
int lastnpresolchgsides
Definition: struct_stat.h:240
SCIP_RETCODE SCIPsetPropExit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
Definition: scip.c:7658
int SCIPtreeGetNNodes(SCIP_TREE *tree)
Definition: tree.c:7958
#define SCIPdebugSolEnable(scip)
Definition: debug.h:267
SCIP_Longint SCIPgetNLPs(SCIP *scip)
Definition: scip.c:41363
#define SCIPABORT()
Definition: def.h:278
SCIP_RETCODE SCIPresetRepresentation(SCIP *scip, SCIP_REOPTNODE **representatives, int nrepresentatives)
Definition: scip.c:16633
SCIP_ROW ** SCIPgetCuts(SCIP *scip)
Definition: scip.c:34369
SCIP_Bool SCIPsetIsRelGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6495
SCIP_RETCODE SCIPsetRootDialog(SCIP *scip, SCIP_DIALOG *dialog)
Definition: scip.c:9639
SCIP_LPSOLSTAT lpsolstat
Definition: struct_lp.h:329
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
Definition: scip.c:17353
#define SCIP_DECL_PRICERREDCOST(x)
Definition: type_pricer.h:130
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
Definition: scip.c:45961
SCIP_Longint SCIPgetNInfeasibleLeaves(SCIP *scip)
Definition: scip.c:41281
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:2679
SCIP_Bool SCIPparamIsValidLongint(SCIP_PARAM *param, SCIP_Longint value)
Definition: paramset.c:4245
#define SCIP_DECL_HEUREXITSOL(x)
Definition: type_heur.h:106
SCIP_Bool SCIPsetIsDualfeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6153
SCIP_Longint nprobholechgs
Definition: struct_stat.h:107
int SCIPgetVarNStrongbranchs(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:21222
SCIP_RETCODE SCIPgetActiveVars(SCIP *scip, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize)
Definition: scip.c:18965
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:1074
#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:16743
SCIP_RETCODE SCIPchgVarUbProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip.c:35264
SCIP_Real SCIPreoptGetSavingtime(SCIP_REOPT *reopt)
Definition: reopt.c:7534
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:392
int SCIPminorVersion(void)
Definition: scip.c:576
SCIP_Longint nlimsolsfound
Definition: struct_primal.h:40
SCIP_Real SCIPgetAvgConflictScoreCurrentRun(SCIP *scip)
Definition: scip.c:42937
SCIP_RETCODE SCIPsetIncludeConflicthdlr(SCIP_SET *set, SCIP_CONFLICTHDLR *conflicthdlr)
Definition: set.c:3651
int SCIPdivesetGetNCalls(SCIP_DIVESET *diveset)
Definition: heur.c:382
int SCIPgetNParams(SCIP *scip)
Definition: scip.c:5129
void SCIPsetSortSepas(SCIP_SET *set)
Definition: set.c:3916
void SCIPnodeselSetExitsol(SCIP_NODESEL *nodesel, SCIP_DECL_NODESELEXITSOL((*nodeselexitsol)))
Definition: nodesel.c:1139
void SCIPchildChgNodeselPrio(SCIP_TREE *tree, SCIP_NODE *child, SCIP_Real priority)
Definition: tree.c:2343
SCIP_Longint SCIPgetNFeasibleLeaves(SCIP *scip)
Definition: scip.c:41254
void SCIPupdateDivesetStats(SCIP *scip, SCIP_DIVESET *diveset, int nprobingnodes, int nbacktracks, SCIP_Longint nsolsfound, SCIP_Longint nbestsolsfound, SCIP_Bool leavewassol)
Definition: scip.c:35940
SCIP_Real SCIPvarGetMultaggrLbLocal(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:7963
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:30431
SCIP_RETCODE SCIPsetSetBoolParam(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_Bool value)
Definition: set.c:2975
int npresolupgdconss
Definition: struct_stat.h:228
const char * SCIPprobGetName(SCIP_PROB *prob)
Definition: prob.c:2234
void SCIPdisableVarHistory(SCIP *scip)
Definition: scip.c:25539
void SCIPstatMark(SCIP_STAT *stat)
Definition: stat.c:171
SCIP_Bool SCIPsetIsFracIntegral(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5696
SCIP_RETCODE SCIPstartClock(SCIP *scip, SCIP_CLOCK *clck)
Definition: scip.c:44929
static SCIP_RETCODE displayRelevantStats(SCIP *scip)
Definition: scip.c:15337
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:1581
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
Definition: scip.c:38007
int SCIPpresolGetNAddConss(SCIP_PRESOL *presol)
Definition: presol.c:731
SCIP_Real SCIPgetVarAvgInferenceScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26252
SCIP_Bool SCIPnlpHasSolution(SCIP_NLP *nlp)
Definition: nlp.c:6004
SCIP_RETCODE SCIPaddObjoffset(SCIP *scip, SCIP_Real addval)
Definition: scip.c:10924
SCIP_Real SCIPgetVarObjDive(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:34810
SCIP_RETCODE SCIPdeactiveCons(SCIP *scip, SCIP_CONS *cons)
Definition: scip.c:28613
SCIP_Bool SCIPisInRestart(SCIP *scip)
Definition: scip.c:17200
void SCIPprintBuildOptions(SCIP *scip, FILE *file)
Definition: scip.c:644
static void printConcsolverStatistics(SCIP *scip, FILE *file)
Definition: scip.c:44266
SCIP_Bool SCIPisExactSolve(SCIP *scip)
Definition: scip.c:1025
#define SCIP_DECL_BRANCHEXIT(x)
Definition: type_branch.h:76
SCIP_RETCODE SCIPlpEndStrongbranch(SCIP_LP *lp)
Definition: lp.c:4054
#define SCIPdebugFreeSol(set)
Definition: debug.h:249
int lastnpresolaggrvars
Definition: struct_stat.h:232
const char * SCIPlpiGetSolverDesc(void)
Definition: lpi_clp.cpp:441
void SCIPsetFocusnodeLP(SCIP *scip, SCIP_Bool solvelp)
Definition: scip.c:40965
int SCIPconshdlrGetNAddHoles(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4899
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:4541
SCIP_RETCODE SCIPtreeCreateProbingNode(SCIP_TREE *tree, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: tree.c:6354
void SCIPvarMarkDeleteGlobalStructures(SCIP_VAR *var)
Definition: var.c:16809
SCIP_RETCODE SCIPintarrayCreate(SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3555
void SCIPlpUnmarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:16830
SCIP_Real SCIPpropGetTime(SCIP_PROP *prop)
Definition: prop.c:1002
SCIP_RETCODE SCIPsetIncludeDisp(SCIP_SET *set, SCIP_DISP *disp)
Definition: set.c:4480
SCIP_RETCODE SCIPreoptMergeVarHistory(SCIP_REOPT *reopt, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **vars, int nvars)
Definition: reopt.c:6454
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:4258
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:22634
void SCIPprobMarkPermuted(SCIP_PROB *prob)
Definition: prob.c:2168
SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Definition: scip.c:46488
SCIP_RETCODE SCIPrelaxExec(SCIP_RELAX *relax, SCIP_SET *set, SCIP_STAT *stat, int depth, SCIP_Real *lowerbound, SCIP_RESULT *result)
Definition: relax.c:295
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:17597
SCIP_Longint SCIPgetNRootStrongbranchs(SCIP *scip)
Definition: scip.c:41829
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:7902
SCIP_Longint SCIPdivesetGetNProbingNodes(SCIP_DIVESET *diveset)
Definition: heur.c:472
SCIP_Bool SCIPcolIsInLP(SCIP_COL *col)
Definition: lp.c:16144
SCIP_RETCODE SCIPvarNegate(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR **negvar)
Definition: var.c:5527
SCIP_CONCSOLVERTYPE * SCIPsetFindConcsolverType(SCIP_SET *set, const char *name)
Definition: set.c:4060
SCIP_Real SCIPgetFirstLPTime(SCIP *scip)
Definition: scip.c:45227
int SCIPgetNProps(SCIP *scip)
Definition: scip.c:7814
SCIP_RETCODE SCIPsetSubscipsOff(SCIP *scip, SCIP_Bool quiet)
Definition: scip.c:5020
SCIP_Real SCIPconshdlrGetSetupTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4589
int subscipdepth
Definition: struct_stat.h:193
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
Definition: scip.c:45937
SCIP_RETCODE SCIPanalyzeConflict(SCIP *scip, int validdepth, SCIP_Bool *success)
Definition: scip.c:27066
SCIP_RETCODE SCIPsetRelaxInitsol(SCIP *scip, SCIP_RELAX *relax, SCIP_DECL_RELAXINITSOL((*relaxinitsol)))
Definition: scip.c:7186
int lastnpresolupgdconss
Definition: struct_stat.h:238
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
Definition: scip.c:9690
SCIP_CLIQUE ** SCIPcliquetableGetCliques(SCIP_CLIQUETABLE *cliquetable)
Definition: implics.c:3427
#define SCIP_DECL_SEPAFREE(x)
Definition: type_sepa.h:55
SCIP_RETCODE SCIPsetNodeselStdPriority(SCIP *scip, SCIP_NODESEL *nodesel, int priority)
Definition: scip.c:8907
SCIP_RETCODE SCIPchgVarBranchFactor(SCIP *scip, SCIP_VAR *var, SCIP_Real branchfactor)
Definition: scip.c:24764
SCIP_RETCODE SCIPaddQuadElementsToNlRow(SCIP *scip, SCIP_NLROW *nlrow, int nquadelems, SCIP_QUADELEM *quadelems)
Definition: scip.c:32169
SCIP_RETCODE SCIPprintVar(SCIP *scip, SCIP_VAR *var, FILE *file)
Definition: scip.c:26664
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: scip.c:5263
SCIP_RETCODE SCIPvisualInit(SCIP_VISUAL *visual, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr)
Definition: visual.c:109
SCIP_RETCODE SCIPconflictstoreGetConflicts(SCIP_CONFLICTSTORE *conflictstore, SCIP_CONS **conflicts, int conflictsize, int *nconflicts)
void SCIPtreeMarkProbingObjChanged(SCIP_TREE *tree)
Definition: tree.c:8175
SCIP_RETCODE SCIPsetLongintParam(SCIP *scip, const char *name, SCIP_Longint value)
Definition: scip.c:4683
SCIP_Real SCIPgetPrimalRayVal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:40142
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:16230
SCIP_RETCODE SCIPconsSepalp(SCIP_CONS *cons, SCIP_SET *set, SCIP_RESULT *result)
Definition: cons.c:7397
SCIP_RETCODE SCIPcopyPlugins(SCIP *sourcescip, SCIP *targetscip, SCIP_Bool copyreaders, SCIP_Bool copypricers, SCIP_Bool copyconshdlrs, SCIP_Bool copyconflicthdlrs, SCIP_Bool copypresolvers, SCIP_Bool copyrelaxators, SCIP_Bool copyseparators, SCIP_Bool copypropagators, SCIP_Bool copyheuristics, SCIP_Bool copyeventhdlrs, SCIP_Bool copynodeselectors, SCIP_Bool copybranchrules, SCIP_Bool copydisplays, SCIP_Bool copydialogs, SCIP_Bool copynlpis, SCIP_Bool passmessagehdlr, SCIP_Bool *valid)
Definition: scip.c:1561
SCIP_RETCODE SCIPevalExprtreeLocalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
Definition: scip.c:32833
struct SCIP_SepaData SCIP_SEPADATA
Definition: type_sepa.h:38
SCIP_Bool SCIPallowObjProp(SCIP *scip)
Definition: scip.c:25457
const XML_NODE * xmlNextSibl(const XML_NODE *node)
Definition: xmlparse.c:1433
SCIP_EVENTHDLR ** eventhdlrs
Definition: struct_set.h:79
SCIP_Bool SCIPparamIsValidString(SCIP_PARAM *param, const char *value)
Definition: paramset.c:4293
SCIP_Longint ninitlps
Definition: struct_stat.h:183
SCIP_RETCODE SCIPsetPresolExitpre(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: scip.c:6969
SCIP_Real SCIPgetAvgInferenceScore(SCIP *scip)
Definition: scip.c:43048
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
Definition: scip.c:18663
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:8696
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:4882
SCIP callable library.
SCIP_RETCODE SCIPinitlpCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
Definition: scip.c:28373
SCIP_RETCODE SCIPsetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx, void *val)
Definition: scip.c:47168
SCIP_Bool SCIPsetIsFeasNegative(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6052
SCIP_RETCODE SCIPexprtreeEval(SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Real *val)
Definition: expr.c:8654
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:4176
void SCIPconshdlrSetGetDiveBdChgs(SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)))
Definition: cons.c:4469
SCIP_Real SCIPgetVarConflictScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26020
SCIP_RETCODE SCIPbranchcandUpdateVarBranchPriority(SCIP_BRANCHCAND *branchcand, SCIP_SET *set, SCIP_VAR *var, int branchpriority)
Definition: branch.c:1139
SCIP_Real SCIPvarGetPseudocostVariance(SCIP_VAR *var, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: var.c:13993
int SCIPgetNSepaRounds(SCIP *scip)
Definition: scip.c:41933
SCIP_Longint ndelayedcutoffs
Definition: struct_stat.h:86
void SCIPrelaxSetInit(SCIP_RELAX *relax, SCIP_DECL_RELAXINIT((*relaxinit)))
Definition: relax.c:402
void SCIPsetSortBranchrulesName(SCIP_SET *set)
Definition: set.c:4465
SCIP_Real SCIPgetPseudocostCount(SCIP *scip, SCIP_BRANCHDIR dir, SCIP_Bool onlycurrentrun)
Definition: scip.c:42863
SCIP_CLOCK * lpsoltime
Definition: struct_stat.h:150
SCIP_Bool SCIPcontainsExternBranchCand(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:36443
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip.c:30673
SCIP_Real SCIPcomputeGap(SCIP_Real eps, SCIP_Real inf, SCIP_Real primalbound, SCIP_Real dualbound)
Definition: misc.c:9636
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
Definition: var.c:16839
static SCIP_RETCODE relabelOrderConsistent(SCIP *const scip, int *labels, int const nlabels, int *nclasses)
Definition: scip.c:23847
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:1578
SCIP_PROP ** props_presol
Definition: struct_set.h:76
SCIP_NODE * SCIPtreeGetPrioSibling(SCIP_TREE *tree)
Definition: tree.c:6832
SCIP_Real SCIPgetLPColumnObjval(SCIP *scip)
Definition: scip.c:28915
SCIP_NODE * focusnode
Definition: struct_tree.h:173
SCIP_Real SCIPgetAvgInferences(SCIP *scip, SCIP_BRANCHDIR dir)
Definition: scip.c:43010
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
Definition: var.c:16707
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:774
SCIP_RETCODE SCIPcreateFiniteSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol, SCIP_Bool *success)
Definition: scip.c:37393
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:32893
SCIP_Real SCIPgetRelaxSolVal(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:19722
#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:739
SCIP_RELAX * SCIPfindRelax(SCIP *scip, const char *name)
Definition: scip.c:7219
internal methods for displaying runtime statistics
int SCIPbranchcandGetNPrioExternImpls(SCIP_BRANCHCAND *branchcand)
Definition: branch.c:516
SCIP_Real scalar
Definition: struct_var.h:175
void SCIPsetSortPricersName(SCIP_SET *set)
Definition: set.c:3475
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip.c:37005
int nimplications
Definition: struct_stat.h:216
SCIP_Longint SCIPgetSolNodenum(SCIP *scip, SCIP_SOL *sol)
Definition: scip.c:38303
SCIP_CONFLICTHDLR * SCIPfindConflicthdlr(SCIP *scip, const char *name)
Definition: scip.c:6753
SCIP_RETCODE SCIPrealarrayClear(SCIP_REALARRAY *realarray)
Definition: misc.c:3396
uint64_t SCIP_EVENTTYPE
Definition: type_event.h:134
#define SCIPreallocBufferArray(scip, ptr, num)
Definition: scip.h:21929
void SCIPenableDebugSol(SCIP *scip)
Definition: scip.c:1155
#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:348
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:7573
SCIP_RETCODE SCIPfreePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
Definition: scip.c:47103
void SCIPpresolSetExitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: presol.c:542
int SCIPdivesetGetMinDepth(SCIP_DIVESET *diveset)
Definition: heur.c:402
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
Definition: scip.c:5931
int SCIPreoptGetNTotalPrunedNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4942
SCIP_PRICER ** SCIPgetPricers(SCIP *scip)
Definition: scip.c:5631
const char * SCIPgetBuildFlags(void)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
Definition: scip.c:27421
SCIP_RETCODE SCIPchgVarName(SCIP *scip, SCIP_VAR *var, const char *name)
Definition: scip.c:18435
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:5302
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:34213
SCIP_RETCODE SCIPchgVarObjProbing(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip.c:35393
SCIP_Real SCIPgetVarAvgCutoffScore(SCIP *scip, SCIP_VAR *var)
Definition: scip.c:26506
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip.c:38421