Scippy

SCIP

Solving Constraint Integer Programs

scip_solvingstats.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-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_solvingstats.c
17  * @brief public methods for querying solving statistics
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include "blockmemshell/memory.h"
36 #include "scip/branch.h"
37 #include "scip/clock.h"
38 #include "scip/concsolver.h"
39 #include "scip/concurrent.h"
40 #include "scip/conflict.h"
41 #include "scip/conflictstore.h"
42 #include "scip/debug.h"
43 #include "scip/disp.h"
44 #include "scip/history.h"
45 #include "scip/pricestore.h"
46 #include "scip/primal.h"
47 #include "scip/prob.h"
48 #include "scip/pub_benderscut.h"
49 #include "scip/pub_benders.h"
50 #include "scip/pub_branch.h"
51 #include "scip/pub_compr.h"
52 #include "scip/pub_cons.h"
53 #include "scip/pub_cutpool.h"
54 #include "scip/pub_heur.h"
55 #include "scip/pub_history.h"
56 #include "scip/pub_message.h"
57 #include "scip/pub_misc.h"
58 #include "scip/pub_misc_sort.h"
59 #include "scip/pub_presol.h"
60 #include "scip/pub_pricer.h"
61 #include "scip/pub_prop.h"
62 #include "scip/pub_reader.h"
63 #include "scip/pub_relax.h"
64 #include "scip/pub_reopt.h"
65 #include "scip/pub_sepa.h"
66 #include "scip/pub_sol.h"
67 #include "scip/pub_table.h"
68 #include "scip/pub_var.h"
69 #include "scip/reader.h"
70 #include "scip/reopt.h"
71 #include "scip/scip_benders.h"
72 #include "scip/scip_general.h"
73 #include "scip/scip_mem.h"
74 #include "scip/scip_message.h"
75 #include "scip/scip_numerics.h"
76 #include "scip/scip_sol.h"
77 #include "scip/scip_solvingstats.h"
78 #include "scip/scip_table.h"
79 #include "scip/scip_timing.h"
80 #include "scip/scip_var.h"
81 #include "scip/sepastore.h"
82 #include "scip/set.h"
83 #include "scip/sol.h"
84 #include "scip/stat.h"
85 #include "scip/struct_mem.h"
86 #include "scip/struct_primal.h"
87 #include "scip/struct_prob.h"
88 #include "scip/struct_scip.h"
89 #include "scip/struct_set.h"
90 #include "scip/struct_stat.h"
91 #include "scip/syncstore.h"
92 #include "scip/table.h"
93 #include "scip/tree.h"
94 #include "scip/var.h"
95 #include <string.h>
96 
97 /** gets number of branch and bound runs performed, including the current run
98  *
99  * @return the number of branch and bound runs performed, including the current run
100  *
101  * @pre This method can be called if SCIP is in one of the following stages:
102  * - \ref SCIP_STAGE_PROBLEM
103  * - \ref SCIP_STAGE_TRANSFORMING
104  * - \ref SCIP_STAGE_TRANSFORMED
105  * - \ref SCIP_STAGE_INITPRESOLVE
106  * - \ref SCIP_STAGE_PRESOLVING
107  * - \ref SCIP_STAGE_EXITPRESOLVE
108  * - \ref SCIP_STAGE_PRESOLVED
109  * - \ref SCIP_STAGE_INITSOLVE
110  * - \ref SCIP_STAGE_SOLVING
111  * - \ref SCIP_STAGE_SOLVED
112  * - \ref SCIP_STAGE_EXITSOLVE
113  * - \ref SCIP_STAGE_FREETRANS
114  */
116  SCIP* scip /**< SCIP data structure */
117  )
118 {
119  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
120 
121  return scip->stat->nruns;
122 }
123 
124 /** gets number of reoptimization runs performed, including the current run
125  *
126  * @return the number of reoptimization runs performed, including the current run
127  *
128  * @pre This method can be called if SCIP is in one of the following stages:
129  * - \ref SCIP_STAGE_PROBLEM
130  * - \ref SCIP_STAGE_TRANSFORMING
131  * - \ref SCIP_STAGE_TRANSFORMED
132  * - \ref SCIP_STAGE_INITPRESOLVE
133  * - \ref SCIP_STAGE_PRESOLVING
134  * - \ref SCIP_STAGE_EXITPRESOLVE
135  * - \ref SCIP_STAGE_PRESOLVED
136  * - \ref SCIP_STAGE_INITSOLVE
137  * - \ref SCIP_STAGE_SOLVING
138  * - \ref SCIP_STAGE_SOLVED
139  * - \ref SCIP_STAGE_EXITSOLVE
140  * - \ref SCIP_STAGE_FREETRANS
141  */
143  SCIP* scip /**< SCIP data structure */
144  )
145 {
146  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNReoptRuns", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
147 
148  return scip->stat->nreoptruns;
149 }
150 
151 /** add given number to the number of processed nodes in current run and in all runs, including the focus node
152  *
153  * @return the number of processed nodes in current run, including the focus node
154  *
155  * @pre This method can be called if SCIP is in one of the following stages:
156  * - \ref SCIP_STAGE_PROBLEM
157  * - \ref SCIP_STAGE_TRANSFORMING
158  * - \ref SCIP_STAGE_TRANSFORMED
159  * - \ref SCIP_STAGE_INITPRESOLVE
160  * - \ref SCIP_STAGE_PRESOLVING
161  * - \ref SCIP_STAGE_EXITPRESOLVE
162  * - \ref SCIP_STAGE_PRESOLVED
163  * - \ref SCIP_STAGE_INITSOLVE
164  * - \ref SCIP_STAGE_SOLVING
165  * - \ref SCIP_STAGE_SOLVED
166  * - \ref SCIP_STAGE_EXITSOLVE
167  * - \ref SCIP_STAGE_FREETRANS
168  */
170  SCIP* scip, /**< SCIP data structure */
171  SCIP_Longint nnodes /**< number of processed nodes to add to the statistics */
172  )
173 {
174  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPaddNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
175 
176  scip->stat->nnodes += nnodes;
177  scip->stat->ntotalnodes += nnodes;
178 }
179 
180 /** gets number of processed nodes in current run, including the focus node
181  *
182  * @return the number of processed nodes in current run, including the focus node
183  *
184  * @pre This method can be called if SCIP is in one of the following stages:
185  * - \ref SCIP_STAGE_PROBLEM
186  * - \ref SCIP_STAGE_TRANSFORMING
187  * - \ref SCIP_STAGE_TRANSFORMED
188  * - \ref SCIP_STAGE_INITPRESOLVE
189  * - \ref SCIP_STAGE_PRESOLVING
190  * - \ref SCIP_STAGE_EXITPRESOLVE
191  * - \ref SCIP_STAGE_PRESOLVED
192  * - \ref SCIP_STAGE_INITSOLVE
193  * - \ref SCIP_STAGE_SOLVING
194  * - \ref SCIP_STAGE_SOLVED
195  * - \ref SCIP_STAGE_EXITSOLVE
196  * - \ref SCIP_STAGE_FREETRANS
197  */
199  SCIP* scip /**< SCIP data structure */
200  )
201 {
202  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
203 
204  return scip->stat->nnodes;
205 }
206 
207 /** gets total number of processed nodes in all runs, including the focus node
208  *
209  * @return the total number of processed nodes in all runs, including the focus node
210  *
211  * @pre This method can be called if SCIP is in one of the following stages:
212  * - \ref SCIP_STAGE_PROBLEM
213  * - \ref SCIP_STAGE_TRANSFORMING
214  * - \ref SCIP_STAGE_TRANSFORMED
215  * - \ref SCIP_STAGE_INITPRESOLVE
216  * - \ref SCIP_STAGE_PRESOLVING
217  * - \ref SCIP_STAGE_EXITPRESOLVE
218  * - \ref SCIP_STAGE_PRESOLVED
219  * - \ref SCIP_STAGE_INITSOLVE
220  * - \ref SCIP_STAGE_SOLVING
221  * - \ref SCIP_STAGE_SOLVED
222  * - \ref SCIP_STAGE_EXITSOLVE
223  * - \ref SCIP_STAGE_FREETRANS
224  */
226  SCIP* scip /**< SCIP data structure */
227  )
228 {
229  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNTotalNodes", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
230 
231  return scip->stat->ntotalnodes;
232 }
233 
234 /** gets number of leaf nodes processed with feasible relaxation solution
235  *
236  * @return number of leaf nodes processed with feasible relaxation solution
237  *
238  * @pre This method can be called if SCIP is in one of the following stages:
239  * - \ref SCIP_STAGE_PROBLEM
240  * - \ref SCIP_STAGE_TRANSFORMING
241  * - \ref SCIP_STAGE_TRANSFORMED
242  * - \ref SCIP_STAGE_INITPRESOLVE
243  * - \ref SCIP_STAGE_PRESOLVING
244  * - \ref SCIP_STAGE_EXITPRESOLVE
245  * - \ref SCIP_STAGE_PRESOLVED
246  * - \ref SCIP_STAGE_INITSOLVE
247  * - \ref SCIP_STAGE_SOLVING
248  * - \ref SCIP_STAGE_SOLVED
249  * - \ref SCIP_STAGE_EXITSOLVE
250  * - \ref SCIP_STAGE_FREETRANS
251  */
253  SCIP* scip /**< SCIP data structure */
254  )
255 {
256  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNFeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
257 
258  return scip->stat->nfeasleaves;
259 }
260 
261 /** gets number of infeasible leaf nodes processed
262  *
263  * @return number of infeasible leaf nodes processed
264  *
265  * @pre This method can be called if SCIP is in one of the following stages:
266  * - \ref SCIP_STAGE_PROBLEM
267  * - \ref SCIP_STAGE_TRANSFORMING
268  * - \ref SCIP_STAGE_TRANSFORMED
269  * - \ref SCIP_STAGE_INITPRESOLVE
270  * - \ref SCIP_STAGE_PRESOLVING
271  * - \ref SCIP_STAGE_EXITPRESOLVE
272  * - \ref SCIP_STAGE_PRESOLVED
273  * - \ref SCIP_STAGE_INITSOLVE
274  * - \ref SCIP_STAGE_SOLVING
275  * - \ref SCIP_STAGE_SOLVED
276  * - \ref SCIP_STAGE_EXITSOLVE
277  * - \ref SCIP_STAGE_FREETRANS
278  */
280  SCIP* scip /**< SCIP data structure */
281  )
282 {
283  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNInfeasibleLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
284 
285  return scip->stat->ninfeasleaves;
286 }
287 
288 /** gets number of processed leaf nodes that hit LP objective limit
289  *
290  * @return number of processed leaf nodes that hit LP objective limit
291  *
292  * @pre This method can be called if SCIP is in one of the following stages:
293  * - \ref SCIP_STAGE_PROBLEM
294  * - \ref SCIP_STAGE_TRANSFORMING
295  * - \ref SCIP_STAGE_TRANSFORMED
296  * - \ref SCIP_STAGE_INITPRESOLVE
297  * - \ref SCIP_STAGE_PRESOLVING
298  * - \ref SCIP_STAGE_EXITPRESOLVE
299  * - \ref SCIP_STAGE_PRESOLVED
300  * - \ref SCIP_STAGE_INITSOLVE
301  * - \ref SCIP_STAGE_SOLVING
302  * - \ref SCIP_STAGE_SOLVED
303  * - \ref SCIP_STAGE_EXITSOLVE
304  * - \ref SCIP_STAGE_FREETRANS
305  */
307  SCIP* scip /**< Scip data structure */
308  )
309 {
310  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNObjlimLeaves", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
311 
312  return scip->stat->nobjleaves;
313 }
314 
315 
316 /** gets number of times a selected node was from a cut off subtree
317  *
318  * @return number of times a selected node was from a cut off subtree
319  *
320  * @pre This method can be called if SCIP is in one of the following stages:
321  * - \ref SCIP_STAGE_PROBLEM
322  * - \ref SCIP_STAGE_TRANSFORMING
323  * - \ref SCIP_STAGE_TRANSFORMED
324  * - \ref SCIP_STAGE_INITPRESOLVE
325  * - \ref SCIP_STAGE_PRESOLVING
326  * - \ref SCIP_STAGE_EXITPRESOLVE
327  * - \ref SCIP_STAGE_PRESOLVED
328  * - \ref SCIP_STAGE_INITSOLVE
329  * - \ref SCIP_STAGE_SOLVING
330  * - \ref SCIP_STAGE_SOLVED
331  * - \ref SCIP_STAGE_EXITSOLVE
332  * - \ref SCIP_STAGE_FREETRANS
333  */
335  SCIP* scip /**< SCIP data structure */
336  )
337 {
338  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNDelayedCutoffs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
339 
340  return scip->stat->ndelayedcutoffs;
341 }
342 
343 /** gets total number of LPs solved so far
344  *
345  * @return the total number of LPs solved so far
346  *
347  * @pre This method can be called if SCIP is in one of the following stages:
348  * - \ref SCIP_STAGE_PROBLEM
349  * - \ref SCIP_STAGE_TRANSFORMING
350  * - \ref SCIP_STAGE_TRANSFORMED
351  * - \ref SCIP_STAGE_INITPRESOLVE
352  * - \ref SCIP_STAGE_PRESOLVING
353  * - \ref SCIP_STAGE_EXITPRESOLVE
354  * - \ref SCIP_STAGE_PRESOLVED
355  * - \ref SCIP_STAGE_INITSOLVE
356  * - \ref SCIP_STAGE_SOLVING
357  * - \ref SCIP_STAGE_SOLVED
358  * - \ref SCIP_STAGE_EXITSOLVE
359  * - \ref SCIP_STAGE_FREETRANS
360  */
362  SCIP* scip /**< SCIP data structure */
363  )
364 {
365  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
366 
367  return scip->stat->nlps;
368 }
369 
370 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm
371  *
372  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm
373  *
374  * @pre This method can be called if SCIP is in one of the following stages:
375  * - \ref SCIP_STAGE_PRESOLVING
376  * - \ref SCIP_STAGE_PRESOLVED
377  * - \ref SCIP_STAGE_SOLVING
378  * - \ref SCIP_STAGE_SOLVED
379  */
381  SCIP* scip /**< SCIP data structure */
382  )
383 {
384  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
385 
386  return scip->stat->nlpiterations;
387 }
388 
389 /** gets number of active non-zeros in the current transformed problem
390  *
391  * @return the number of active non-zeros in the current transformed problem
392  *
393  * @pre This method can be called if SCIP is in one of the following stages:
394  * - \ref SCIP_STAGE_PROBLEM
395  * - \ref SCIP_STAGE_TRANSFORMING
396  * - \ref SCIP_STAGE_TRANSFORMED
397  * - \ref SCIP_STAGE_INITPRESOLVE
398  * - \ref SCIP_STAGE_PRESOLVING
399  * - \ref SCIP_STAGE_EXITPRESOLVE
400  * - \ref SCIP_STAGE_PRESOLVED
401  * - \ref SCIP_STAGE_INITSOLVE
402  * - \ref SCIP_STAGE_SOLVING
403  * - \ref SCIP_STAGE_SOLVED
404  * - \ref SCIP_STAGE_EXITSOLVE
405  */
407  SCIP* scip /**< SCIP data structure */
408  )
409 {
410  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNZs", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
411 
412  return scip->stat->nnz;
413 }
414 
415 /** gets total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
416  *
417  * @return the total number of iterations used so far in primal and dual simplex and barrier algorithm for the root node
418  *
419  * @pre This method can be called if SCIP is in one of the following stages:
420  * - \ref SCIP_STAGE_PRESOLVED
421  * - \ref SCIP_STAGE_SOLVING
422  * - \ref SCIP_STAGE_SOLVED
423  */
425  SCIP* scip /**< SCIP data structure */
426  )
427 {
428  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNRootLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
429 
430  return scip->stat->nrootlpiterations;
431 }
432 
433 /** gets total number of iterations used in primal and dual simplex and barrier algorithm for the first LP at the root
434  * node
435  *
436  * @return the total number of iterations used in primal and dual simplex and barrier algorithm for the first root LP
437  *
438  * @pre This method can be called if SCIP is in one of the following stages:
439  * - \ref SCIP_STAGE_PRESOLVED
440  * - \ref SCIP_STAGE_SOLVING
441  * - \ref SCIP_STAGE_SOLVED
442  */
444  SCIP* scip /**< SCIP data structure */
445  )
446 {
447  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNRootFirstLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
448 
449  return scip->stat->nrootfirstlpiterations;
450 }
451 
452 /** gets total number of primal LPs solved so far
453  *
454  * @return the total number of primal LPs solved so far
455  *
456  * @pre This method can be called if SCIP is in one of the following stages:
457  * - \ref SCIP_STAGE_PRESOLVED
458  * - \ref SCIP_STAGE_SOLVING
459  * - \ref SCIP_STAGE_SOLVED
460  */
462  SCIP* scip /**< SCIP data structure */
463  )
464 {
465  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPrimalLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
466 
467  return scip->stat->nprimallps;
468 }
469 
470 /** gets total number of iterations used so far in primal simplex
471  *
472  * @return total number of iterations used so far in primal simplex
473  *
474  * @pre This method can be called if SCIP is in one of the following stages:
475  * - \ref SCIP_STAGE_PRESOLVED
476  * - \ref SCIP_STAGE_SOLVING
477  * - \ref SCIP_STAGE_SOLVED
478  */
480  SCIP* scip /**< SCIP data structure */
481  )
482 {
483  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPrimalLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
484 
485  return scip->stat->nprimallpiterations;
486 }
487 
488 /** gets total number of dual LPs solved so far
489  *
490  * @return the total number of dual LPs solved so far
491  *
492  * @pre This method can be called if SCIP is in one of the following stages:
493  * - \ref SCIP_STAGE_PRESOLVED
494  * - \ref SCIP_STAGE_SOLVING
495  * - \ref SCIP_STAGE_SOLVED
496  */
498  SCIP* scip /**< SCIP data structure */
499  )
500 {
501  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNDualLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
502 
503  return scip->stat->nduallps;
504 }
505 
506 /** gets total number of iterations used so far in dual simplex
507  *
508  * @return the total number of iterations used so far in dual simplex
509  *
510  * @pre This method can be called if SCIP is in one of the following stages:
511  * - \ref SCIP_STAGE_PRESOLVED
512  * - \ref SCIP_STAGE_SOLVING
513  * - \ref SCIP_STAGE_SOLVED
514  */
516  SCIP* scip /**< SCIP data structure */
517  )
518 {
519  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNDualLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
520 
521  return scip->stat->nduallpiterations;
522 }
523 
524 /** gets total number of barrier LPs solved so far
525  *
526  * @return the total number of barrier LPs solved so far
527  *
528  * @pre This method can be called if SCIP is in one of the following stages:
529  * - \ref SCIP_STAGE_PRESOLVED
530  * - \ref SCIP_STAGE_SOLVING
531  * - \ref SCIP_STAGE_SOLVED
532  */
534  SCIP* scip /**< SCIP data structure */
535  )
536 {
537  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNBarrierLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
538 
539  return scip->stat->nbarrierlps;
540 }
541 
542 /** gets total number of iterations used so far in barrier algorithm
543  *
544  * @return the total number of iterations used so far in barrier algorithm
545  *
546  * @pre This method can be called if SCIP is in one of the following stages:
547  * - \ref SCIP_STAGE_PRESOLVED
548  * - \ref SCIP_STAGE_SOLVING
549  * - \ref SCIP_STAGE_SOLVED
550  */
552  SCIP* scip /**< SCIP data structure */
553  )
554 {
555  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNBarrierLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
556 
557  return scip->stat->nbarrierlpiterations;
558 }
559 
560 /** gets total number of LPs solved so far that were resolved from an advanced start basis
561  *
562  * @return the total number of LPs solved so far that were resolved from an advanced start basis
563  *
564  * @pre This method can be called if SCIP is in one of the following stages:
565  * - \ref SCIP_STAGE_PRESOLVED
566  * - \ref SCIP_STAGE_SOLVING
567  * - \ref SCIP_STAGE_SOLVED
568  */
570  SCIP* scip /**< SCIP data structure */
571  )
572 {
573  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
574 
575  return scip->stat->nprimalresolvelps + scip->stat->ndualresolvelps;
576 }
577 
578 /** gets total number of simplex iterations used so far in primal and dual simplex calls where an advanced start basis
579  * was available
580  *
581  * @return the total number of simplex iterations used so far in primal and dual simplex calls where an advanced start
582  * basis was available
583  *
584  * @pre This method can be called if SCIP is in one of the following stages:
585  * - \ref SCIP_STAGE_PRESOLVED
586  * - \ref SCIP_STAGE_SOLVING
587  * - \ref SCIP_STAGE_SOLVED
588  */
590  SCIP* scip /**< SCIP data structure */
591  )
592 {
593  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
594 
596 }
597 
598 /** gets total number of primal LPs solved so far that were resolved from an advanced start basis
599  *
600  * @return the total number of primal LPs solved so far that were resolved from an advanced start basis
601  *
602  * @pre This method can be called if SCIP is in one of the following stages:
603  * - \ref SCIP_STAGE_PRESOLVED
604  * - \ref SCIP_STAGE_SOLVING
605  * - \ref SCIP_STAGE_SOLVED
606  */
608  SCIP* scip /**< SCIP data structure */
609  )
610 {
611  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPrimalResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
612 
613  return scip->stat->nprimalresolvelps;
614 }
615 
616 /** gets total number of simplex iterations used so far in primal simplex calls where an advanced start basis
617  * was available
618  *
619  * @return the total number of simplex iterations used so far in primal simplex calls where an advanced start
620  * basis was available
621  *
622  * @pre This method can be called if SCIP is in one of the following stages:
623  * - \ref SCIP_STAGE_PRESOLVED
624  * - \ref SCIP_STAGE_SOLVING
625  * - \ref SCIP_STAGE_SOLVED
626  */
628  SCIP* scip /**< SCIP data structure */
629  )
630 {
631  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPrimalResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
632 
633  return scip->stat->nprimalresolvelpiterations;
634 }
635 
636 /** gets total number of dual LPs solved so far that were resolved from an advanced start basis
637  *
638  * @return the total number of dual LPs solved so far that were resolved from an advanced start basis
639  *
640  * @pre This method can be called if SCIP is in one of the following stages:
641  * - \ref SCIP_STAGE_PRESOLVED
642  * - \ref SCIP_STAGE_SOLVING
643  * - \ref SCIP_STAGE_SOLVED
644  */
646  SCIP* scip /**< SCIP data structure */
647  )
648 {
649  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNDualResolveLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
650 
651  return scip->stat->ndualresolvelps;
652 }
653 
654 /** gets total number of simplex iterations used so far in dual simplex calls where an advanced start basis
655  * was available
656  *
657  * @return the total number of simplex iterations used so far in dual simplex calls where an advanced start
658  * basis was available
659  *
660  * @pre This method can be called if SCIP is in one of the following stages:
661  * - \ref SCIP_STAGE_PRESOLVED
662  * - \ref SCIP_STAGE_SOLVING
663  * - \ref SCIP_STAGE_SOLVED
664  */
666  SCIP* scip /**< SCIP data structure */
667  )
668 {
669  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNDualResolveLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
670 
671  return scip->stat->ndualresolvelpiterations;
672 }
673 
674 /** gets total number of LPs solved so far for node relaxations
675  *
676  * @return the total number of LPs solved so far for node relaxations
677  *
678  * @pre This method can be called if SCIP is in one of the following stages:
679  * - \ref SCIP_STAGE_PRESOLVED
680  * - \ref SCIP_STAGE_SOLVING
681  * - \ref SCIP_STAGE_SOLVED
682  */
684  SCIP* scip /**< SCIP data structure */
685  )
686 {
687  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNodeLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
688 
689  return scip->stat->nnodelps;
690 }
691 
692 /** gets total number of simplex iterations used so far for node relaxations
693  *
694  * @return the total number of simplex iterations used so far for node relaxations
695  *
696  * @pre This method can be called if SCIP is in one of the following stages:
697  * - \ref SCIP_STAGE_PRESOLVED
698  * - \ref SCIP_STAGE_SOLVING
699  * - \ref SCIP_STAGE_SOLVED
700  */
702  SCIP* scip /**< SCIP data structure */
703  )
704 {
705  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNodeLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
706 
707  return scip->stat->nnodelpiterations;
708 }
709 
710 /** gets total number of LPs solved so far for initial LP in node relaxations
711  *
712  * @return the total number of LPs solved so far for initial LP in node relaxations
713  *
714  * @pre This method can be called if SCIP is in one of the following stages:
715  * - \ref SCIP_STAGE_PRESOLVED
716  * - \ref SCIP_STAGE_SOLVING
717  * - \ref SCIP_STAGE_SOLVED
718  */
720  SCIP* scip /**< SCIP data structure */
721  )
722 {
723  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNodeInitLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
724 
725  return scip->stat->ninitlps;
726 }
727 
728 /** gets total number of simplex iterations used so far for initial LP in node relaxations
729  *
730  * @return the total number of simplex iterations used so far for initial LP in node relaxations
731  *
732  * @pre This method can be called if SCIP is in one of the following stages:
733  * - \ref SCIP_STAGE_PRESOLVED
734  * - \ref SCIP_STAGE_SOLVING
735  * - \ref SCIP_STAGE_SOLVED
736  */
738  SCIP* scip /**< SCIP data structure */
739  )
740 {
741  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNNodeInitLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
742 
743  return scip->stat->ninitlpiterations;
744 }
745 
746 /** gets total number of LPs solved so far during diving and probing
747  *
748  * @return total number of LPs solved so far during diving and probing
749  *
750  * @pre This method can be called if SCIP is in one of the following stages:
751  * - \ref SCIP_STAGE_PRESOLVED
752  * - \ref SCIP_STAGE_SOLVING
753  * - \ref SCIP_STAGE_SOLVED
754  */
756  SCIP* scip /**< SCIP data structure */
757  )
758 {
759  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNDivingLPs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
760 
761  return scip->stat->ndivinglps;
762 }
763 
764 /** gets total number of simplex iterations used so far during diving and probing
765  *
766  * @return the total number of simplex iterations used so far during diving and probing
767  *
768  * @pre This method can be called if SCIP is in one of the following stages:
769  * - \ref SCIP_STAGE_PRESOLVED
770  * - \ref SCIP_STAGE_SOLVING
771  * - \ref SCIP_STAGE_SOLVED
772  */
774  SCIP* scip /**< SCIP data structure */
775  )
776 {
777  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNDivingLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
778 
779  return scip->stat->ndivinglpiterations;
780 }
781 
782 /** gets total number of times, strong branching was called (each call represents solving two LPs)
783  *
784  * @return the total number of times, strong branching was called (each call represents solving two LPs)
785  *
786  * @pre This method can be called if SCIP is in one of the following stages:
787  * - \ref SCIP_STAGE_PRESOLVED
788  * - \ref SCIP_STAGE_SOLVING
789  * - \ref SCIP_STAGE_SOLVED
790  */
792  SCIP* scip /**< SCIP data structure */
793  )
794 {
795  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
796 
797  return scip->stat->nstrongbranchs;
798 }
799 
800 /** gets total number of simplex iterations used so far in strong branching
801  *
802  * @return the total number of simplex iterations used so far in strong branching
803  *
804  * @pre This method can be called if SCIP is in one of the following stages:
805  * - \ref SCIP_STAGE_PRESOLVED
806  * - \ref SCIP_STAGE_SOLVING
807  * - \ref SCIP_STAGE_SOLVED
808  */
810  SCIP* scip /**< SCIP data structure */
811  )
812 {
813  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
814 
815  return scip->stat->nsblpiterations;
816 }
817 
818 /** gets total number of times, strong branching was called at the root node (each call represents solving two LPs)
819  *
820  * @return the total number of times, strong branching was called at the root node (each call represents solving two LPs)
821  *
822  * @pre This method can be called if SCIP is in one of the following stages:
823  * - \ref SCIP_STAGE_PRESOLVED
824  * - \ref SCIP_STAGE_SOLVING
825  * - \ref SCIP_STAGE_SOLVED
826  */
828  SCIP* scip /**< SCIP data structure */
829  )
830 {
831  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNRootStrongbranchs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
832 
833  return scip->stat->nrootstrongbranchs;
834 }
835 
836 /** gets total number of simplex iterations used so far in strong branching at the root node
837  *
838  * @return the total number of simplex iterations used so far in strong branching at the root node
839  *
840  * @pre This method can be called if SCIP is in one of the following stages:
841  * - \ref SCIP_STAGE_PRESOLVED
842  * - \ref SCIP_STAGE_SOLVING
843  * - \ref SCIP_STAGE_SOLVED
844  */
846  SCIP* scip /**< SCIP data structure */
847  )
848 {
849  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNRootStrongbranchLPIterations", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
850 
851  return scip->stat->nrootsblpiterations;
852 }
853 
854 /** gets number of pricing rounds performed so far at the current node
855  *
856  * @return the number of pricing rounds performed so far at the current node
857  *
858  * @pre This method can be called if SCIP is in one of the following stages:
859  * - \ref SCIP_STAGE_SOLVING
860  */
862  SCIP* scip /**< SCIP data structure */
863  )
864 {
865  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPriceRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
866 
867  return scip->stat->npricerounds;
868 }
869 
870 /** get current number of variables in the pricing store
871  *
872  * @return the current number of variables in the pricing store
873  *
874  * @pre This method can be called if SCIP is in one of the following stages:
875  * - \ref SCIP_STAGE_PRESOLVED
876  * - \ref SCIP_STAGE_SOLVING
877  * - \ref SCIP_STAGE_SOLVED
878  */
880  SCIP* scip /**< SCIP data structure */
881  )
882 {
883  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPricevars", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
884 
885  return SCIPpricestoreGetNVars(scip->pricestore);
886 }
887 
888 /** get total number of pricing variables found so far
889  *
890  * @return the total number of pricing variables found so far
891  *
892  * @pre This method can be called if SCIP is in one of the following stages:
893  * - \ref SCIP_STAGE_PRESOLVED
894  * - \ref SCIP_STAGE_SOLVING
895  * - \ref SCIP_STAGE_SOLVED
896  */
898  SCIP* scip /**< SCIP data structure */
899  )
900 {
901  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPricevarsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
902 
904 }
905 
906 /** get total number of pricing variables applied to the LPs
907  *
908  * @return the total number of pricing variables applied to the LPs
909  *
910  * @pre This method can be called if SCIP is in one of the following stages:
911  * - \ref SCIP_STAGE_PRESOLVED
912  * - \ref SCIP_STAGE_SOLVING
913  * - \ref SCIP_STAGE_SOLVED
914  */
916  SCIP* scip /**< SCIP data structure */
917  )
918 {
919  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNPricevarsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
920 
922 }
923 
924 /** gets number of separation rounds performed so far at the current node
925  *
926  * @return the number of separation rounds performed so far at the current node
927  *
928  * @pre This method can be called if SCIP is in one of the following stages:
929  * - \ref SCIP_STAGE_SOLVING
930  */
932  SCIP* scip /**< SCIP data structure */
933  )
934 {
935  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNSepaRounds", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
936 
937  return scip->stat->nseparounds;
938 }
939 
940 /** get total number of cuts found so far
941  *
942  * @return the total number of cuts found so far
943  *
944  * @pre This method can be called if SCIP is in one of the following stages:
945  * - \ref SCIP_STAGE_PRESOLVED
946  * - \ref SCIP_STAGE_SOLVING
947  * - \ref SCIP_STAGE_SOLVED
948  */
950  SCIP* scip /**< SCIP data structure */
951  )
952 {
953  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNCutsFound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
954 
956 }
957 
958 /** get number of cuts found so far in current separation round
959  *
960  * @return the number of cuts found so far in current separation round
961  *
962  * @pre This method can be called if SCIP is in one of the following stages:
963  * - \ref SCIP_STAGE_PRESOLVED
964  * - \ref SCIP_STAGE_SOLVING
965  * - \ref SCIP_STAGE_SOLVED
966  */
968  SCIP* scip /**< SCIP data structure */
969  )
970 {
971  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNCutsFoundRound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
972 
974 }
975 
976 /** get total number of cuts applied to the LPs
977  *
978  * @return the total number of cuts applied to the LPs
979  *
980  * @pre This method can be called if SCIP is in one of the following stages:
981  * - \ref SCIP_STAGE_PRESOLVED
982  * - \ref SCIP_STAGE_SOLVING
983  * - \ref SCIP_STAGE_SOLVED
984  */
986  SCIP* scip /**< SCIP data structure */
987  )
988 {
989  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNCutsApplied", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
990 
992 }
993 
994 /** get total number of constraints found in conflict analysis (conflict, reconvergence constraints, and dual proofs)
995  *
996  * @return the total number of constraints found in conflict analysis (conflict, reconvergence constraints, and dual proofs)
997  *
998  * @pre This method can be called if SCIP is in one of the following stages:
999  * - \ref SCIP_STAGE_TRANSFORMED
1000  * - \ref SCIP_STAGE_INITPRESOLVE
1001  * - \ref SCIP_STAGE_PRESOLVING
1002  * - \ref SCIP_STAGE_EXITPRESOLVE
1003  * - \ref SCIP_STAGE_PRESOLVED
1004  * - \ref SCIP_STAGE_INITSOLVE
1005  * - \ref SCIP_STAGE_SOLVING
1006  * - \ref SCIP_STAGE_SOLVED
1007  * - \ref SCIP_STAGE_EXITSOLVE
1008  */
1010  SCIP* scip /**< SCIP data structure */
1011  )
1012 {
1013  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNConflictConssFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1014 
1027 }
1028 
1029 /** get number of conflict constraints found so far at the current node
1030  *
1031  * @return the number of conflict constraints found so far at the current node
1032  *
1033  * @pre This method can be called if SCIP is in one of the following stages:
1034  * - \ref SCIP_STAGE_TRANSFORMED
1035  * - \ref SCIP_STAGE_INITPRESOLVE
1036  * - \ref SCIP_STAGE_PRESOLVING
1037  * - \ref SCIP_STAGE_EXITPRESOLVE
1038  * - \ref SCIP_STAGE_PRESOLVED
1039  * - \ref SCIP_STAGE_INITSOLVE
1040  * - \ref SCIP_STAGE_SOLVING
1041  * - \ref SCIP_STAGE_SOLVED
1042  * - \ref SCIP_STAGE_EXITSOLVE
1043  */
1045  SCIP* scip /**< SCIP data structure */
1046  )
1047 {
1048  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNConflictConssFoundNode", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1049 
1050  return SCIPconflictGetNConflicts(scip->conflict);
1051 }
1052 
1053 /** get total number of conflict constraints added to the problem
1054  *
1055  * @return the total number of conflict constraints added to the problem
1056  *
1057  * @pre This method can be called if SCIP is in one of the following stages:
1058  * - \ref SCIP_STAGE_TRANSFORMED
1059  * - \ref SCIP_STAGE_INITPRESOLVE
1060  * - \ref SCIP_STAGE_PRESOLVING
1061  * - \ref SCIP_STAGE_EXITPRESOLVE
1062  * - \ref SCIP_STAGE_PRESOLVED
1063  * - \ref SCIP_STAGE_INITSOLVE
1064  * - \ref SCIP_STAGE_SOLVING
1065  * - \ref SCIP_STAGE_SOLVED
1066  * - \ref SCIP_STAGE_EXITSOLVE
1067  */
1069  SCIP* scip /**< SCIP data structure */
1070  )
1071 {
1072  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNConflictConssApplied", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1073 
1074  return SCIPconflictGetNAppliedConss(scip->conflict);
1075 }
1076 
1077 /** gets maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
1078  *
1079  * @return the maximal depth of all processed nodes in current branch and bound run (excluding probing nodes)
1080  *
1081  * @pre This method can be called if SCIP is in one of the following stages:
1082  * - \ref SCIP_STAGE_TRANSFORMED
1083  * - \ref SCIP_STAGE_INITPRESOLVE
1084  * - \ref SCIP_STAGE_PRESOLVING
1085  * - \ref SCIP_STAGE_EXITPRESOLVE
1086  * - \ref SCIP_STAGE_PRESOLVED
1087  * - \ref SCIP_STAGE_INITSOLVE
1088  * - \ref SCIP_STAGE_SOLVING
1089  * - \ref SCIP_STAGE_SOLVED
1090  * - \ref SCIP_STAGE_EXITSOLVE
1091  */
1093  SCIP* scip /**< SCIP data structure */
1094  )
1095 {
1096  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetMaxDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1097 
1098  return scip->stat->maxdepth;
1099 }
1100 
1101 /** gets maximal depth of all processed nodes over all branch and bound runs
1102  *
1103  * @return the maximal depth of all processed nodes over all branch and bound runs
1104  *
1105  * @pre This method can be called if SCIP is in one of the following stages:
1106  * - \ref SCIP_STAGE_TRANSFORMED
1107  * - \ref SCIP_STAGE_INITPRESOLVE
1108  * - \ref SCIP_STAGE_PRESOLVING
1109  * - \ref SCIP_STAGE_EXITPRESOLVE
1110  * - \ref SCIP_STAGE_PRESOLVED
1111  * - \ref SCIP_STAGE_INITSOLVE
1112  * - \ref SCIP_STAGE_SOLVING
1113  * - \ref SCIP_STAGE_SOLVED
1114  * - \ref SCIP_STAGE_EXITSOLVE
1115  */
1117  SCIP* scip /**< SCIP data structure */
1118  )
1119 {
1120  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetMaxTotalDepth", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1121 
1122  return scip->stat->maxtotaldepth;
1123 }
1124 
1125 /** gets total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
1126  *
1127  * @return the total number of backtracks, i.e. number of times, the new node was selected from the leaves queue
1128  *
1129  * @pre This method can be called if SCIP is in one of the following stages:
1130  * - \ref SCIP_STAGE_TRANSFORMED
1131  * - \ref SCIP_STAGE_INITPRESOLVE
1132  * - \ref SCIP_STAGE_PRESOLVING
1133  * - \ref SCIP_STAGE_EXITPRESOLVE
1134  * - \ref SCIP_STAGE_PRESOLVED
1135  * - \ref SCIP_STAGE_INITSOLVE
1136  * - \ref SCIP_STAGE_SOLVING
1137  * - \ref SCIP_STAGE_SOLVED
1138  * - \ref SCIP_STAGE_EXITSOLVE
1139  */
1141  SCIP* scip /**< SCIP data structure */
1142  )
1143 {
1144  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNBacktracks", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1145 
1146  return scip->stat->nbacktracks;
1147 }
1148 
1149 /** gets total number of active constraints at the current node
1150  *
1151  * @return the total number of active constraints at the current node
1152  *
1153  * @pre This method can be called if SCIP is in one of the following stages:
1154  * - \ref SCIP_STAGE_INITPRESOLVE
1155  * - \ref SCIP_STAGE_PRESOLVING
1156  * - \ref SCIP_STAGE_EXITPRESOLVE
1157  * - \ref SCIP_STAGE_PRESOLVED
1158  * - \ref SCIP_STAGE_SOLVING
1159  */
1161  SCIP* scip /**< SCIP data structure */
1162  )
1163 {
1164  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNActiveConss", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1165 
1166  return scip->stat->nactiveconss;
1167 }
1168 
1169 /** gets total number of enabled constraints at the current node
1170  *
1171  * @return the total number of enabled constraints at the current node
1172  *
1173  * @pre This method can be called if SCIP is in one of the following stages:
1174  * - \ref SCIP_STAGE_PRESOLVED
1175  * - \ref SCIP_STAGE_SOLVING
1176  */
1178  SCIP* scip /**< SCIP data structure */
1179  )
1180 {
1181  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNEnabledConss", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1182 
1183  return scip->stat->nenabledconss;
1184 }
1185 
1186 /** gets average dual bound of all unprocessed nodes for original problem
1187  *
1188  * @return the average dual bound of all unprocessed nodes for original problem
1189  *
1190  * @pre This method can be called if SCIP is in one of the following stages:
1191  * - \ref SCIP_STAGE_PRESOLVED
1192  * - \ref SCIP_STAGE_SOLVING
1193  * - \ref SCIP_STAGE_SOLVED
1194  */
1196  SCIP* scip /**< SCIP data structure */
1197  )
1198 {
1199  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1200 
1201  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set,
1203 }
1204 
1205 /** gets average lower (dual) bound of all unprocessed nodes in transformed problem
1206  *
1207  * @return the average lower (dual) bound of all unprocessed nodes in transformed problem
1208  *
1209  * @pre This method can be called if SCIP is in one of the following stages:
1210  * - \ref SCIP_STAGE_PRESOLVED
1211  * - \ref SCIP_STAGE_SOLVING
1212  * - \ref SCIP_STAGE_SOLVED
1213  */
1215  SCIP* scip /**< SCIP data structure */
1216  )
1217 {
1218  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1219 
1220  return SCIPtreeGetAvgLowerbound(scip->tree, scip->primal->cutoffbound);
1221 }
1222 
1223 /** gets global dual bound
1224  *
1225  * @return the global dual bound
1226  *
1227  * @pre This method can be called if SCIP is in one of the following stages:
1228  * - \ref SCIP_STAGE_TRANSFORMED
1229  * - \ref SCIP_STAGE_INITPRESOLVE
1230  * - \ref SCIP_STAGE_PRESOLVING
1231  * - \ref SCIP_STAGE_EXITPRESOLVE
1232  * - \ref SCIP_STAGE_PRESOLVED
1233  * - \ref SCIP_STAGE_INITSOLVE
1234  * - \ref SCIP_STAGE_SOLVING
1235  * - \ref SCIP_STAGE_SOLVED
1236  * - \ref SCIP_STAGE_EXITSOLVE
1237  */
1239  SCIP* scip /**< SCIP data structure */
1240  )
1241 {
1242  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetDualbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1243 
1244  /* in case we are in presolving we use the stored dual bound if it exits */
1245  if( scip->set->stage <= SCIP_STAGE_INITSOLVE && scip->transprob->dualbound < SCIP_INVALID )
1246  return scip->transprob->dualbound;
1247 
1248  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPgetLowerbound(scip));
1249 }
1250 
1251 /** gets global lower (dual) bound in transformed problem
1252  *
1253  * @return the global lower (dual) bound in transformed problem
1254  *
1255  * @pre This method can be called if SCIP is in one of the following stages:
1256  * - \ref SCIP_STAGE_TRANSFORMED
1257  * - \ref SCIP_STAGE_INITPRESOLVE
1258  * - \ref SCIP_STAGE_PRESOLVING
1259  * - \ref SCIP_STAGE_EXITPRESOLVE
1260  * - \ref SCIP_STAGE_PRESOLVED
1261  * - \ref SCIP_STAGE_INITSOLVE
1262  * - \ref SCIP_STAGE_SOLVING
1263  * - \ref SCIP_STAGE_SOLVED
1264  */
1266  SCIP* scip /**< SCIP data structure */
1267  )
1268 {
1269  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLowerbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1270 
1271  if( scip->set->stage <= SCIP_STAGE_INITSOLVE )
1272  return -SCIPinfinity(scip);
1274  {
1275  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with lower
1276  * bound = -inf instead of lower bound = upper bound = +inf also in case we prove that the problem is unbounded,
1277  * it seems to make sense to return with lower bound = -inf, since -infinity is the only valid lower bound
1278  */
1279  return -SCIPinfinity(scip);
1280  }
1281  else
1282  {
1283  SCIP_Real treelowerbound;
1284 
1285  /* it may happen that the remaining tree is empty or all open nodes have a lower bound above the cutoff bound, but
1286  * have not yet been cut off, e.g., when the user calls SCIPgetDualbound() in some event handler; in this case,
1287  * the global lower bound is given by the upper bound value
1288  */
1289  treelowerbound = SCIPtreeGetLowerbound(scip->tree, scip->set);
1290 
1291  if( treelowerbound < scip->primal->upperbound)
1292  return treelowerbound;
1293  else
1294  return scip->primal->upperbound;
1295  }
1296 }
1297 
1298 /** gets dual bound of the root node for the original problem
1299  *
1300  * @return the dual bound of the root node for the original problem
1301  *
1302  * @pre This method can be called if SCIP is in one of the following stages:
1303  * - \ref SCIP_STAGE_PRESOLVING
1304  * - \ref SCIP_STAGE_EXITPRESOLVE
1305  * - \ref SCIP_STAGE_PRESOLVED
1306  * - \ref SCIP_STAGE_INITSOLVE
1307  * - \ref SCIP_STAGE_SOLVING
1308  * - \ref SCIP_STAGE_SOLVED
1309  */
1311  SCIP* scip /**< SCIP data structure */
1312  )
1313 {
1314  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1315 
1316  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
1317  return SCIPgetPrimalbound(scip);
1318  else
1319  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->rootlowerbound);
1320 }
1321 
1322 /** gets lower (dual) bound in transformed problem of the root node
1323  *
1324  * @return the lower (dual) bound in transformed problem of the root node
1325  *
1326  * @pre This method can be called if SCIP is in one of the following stages:
1327  * - \ref SCIP_STAGE_PRESOLVING
1328  * - \ref SCIP_STAGE_EXITPRESOLVE
1329  * - \ref SCIP_STAGE_PRESOLVED
1330  * - \ref SCIP_STAGE_INITSOLVE
1331  * - \ref SCIP_STAGE_SOLVING
1332  * - \ref SCIP_STAGE_SOLVED
1333  */
1335  SCIP* scip /**< SCIP data structure */
1336  )
1337 {
1338  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1339 
1340  if( SCIPsetIsInfinity(scip->set, scip->stat->rootlowerbound) )
1341  return SCIPgetUpperbound(scip);
1342  else
1343  return scip->stat->rootlowerbound;
1344 }
1345 
1346 /** gets dual bound for the original problem obtained by the first LP solve at the root node
1347  *
1348  * @return the dual bound for the original problem of the first LP solve at the root node
1349  *
1350  * @pre This method can be called if SCIP is in one of the following stages:
1351  * - \ref SCIP_STAGE_PRESOLVING
1352  * - \ref SCIP_STAGE_EXITPRESOLVE
1353  * - \ref SCIP_STAGE_PRESOLVED
1354  * - \ref SCIP_STAGE_INITSOLVE
1355  * - \ref SCIP_STAGE_SOLVING
1356  * - \ref SCIP_STAGE_SOLVED
1357  */
1359  SCIP* scip /**< SCIP data structure */
1360  )
1361 {
1362  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetFirstLPDualboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1363 
1364  return scip->stat->firstlpdualbound;
1365 }
1366 
1367 /** gets lower (dual) bound in transformed problem obtained by the first LP solve at the root node
1368  *
1369  * @return the lower (dual) bound in transformed problem obtained by first LP solve at the root node
1370  *
1371  * @pre This method can be called if SCIP is in one of the following stages:
1372  * - \ref SCIP_STAGE_PRESOLVING
1373  * - \ref SCIP_STAGE_EXITPRESOLVE
1374  * - \ref SCIP_STAGE_PRESOLVED
1375  * - \ref SCIP_STAGE_INITSOLVE
1376  * - \ref SCIP_STAGE_SOLVING
1377  * - \ref SCIP_STAGE_SOLVED
1378  */
1380  SCIP* scip /**< SCIP data structure */
1381  )
1382 {
1383  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetFirstLPLowerboundRoot", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1384 
1385  if( scip->stat->firstlpdualbound == SCIP_INVALID ) /*lint !e777*/
1386  return -SCIPinfinity(scip);
1387  else
1388  return SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, scip->stat->firstlpdualbound);
1389 }
1390 
1391 /** the primal bound of the very first solution */
1393  SCIP* scip /**< SCIP data structure */
1394  )
1395 {
1396  return scip->stat->firstprimalbound;
1397 }
1398 
1399 /** gets global primal bound (objective value of best solution or user objective limit) for the original problem
1400  *
1401  * @return the global primal bound (objective value of best solution or user objective limit) for the original problem
1402  *
1403  * @pre This method can be called if SCIP is in one of the following stages:
1404  * - \ref SCIP_STAGE_TRANSFORMED
1405  * - \ref SCIP_STAGE_INITPRESOLVE
1406  * - \ref SCIP_STAGE_PRESOLVING
1407  * - \ref SCIP_STAGE_EXITPRESOLVE
1408  * - \ref SCIP_STAGE_PRESOLVED
1409  * - \ref SCIP_STAGE_INITSOLVE
1410  * - \ref SCIP_STAGE_SOLVING
1411  * - \ref SCIP_STAGE_SOLVED
1412  * - \ref SCIP_STAGE_EXITSOLVE
1413  */
1415  SCIP* scip /**< SCIP data structure */
1416  )
1417 {
1418  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetPrimalbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1419 
1420  return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPgetUpperbound(scip));
1421 }
1422 
1423 /** gets global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
1424  *
1425  * @return the global upper (primal) bound in transformed problem (objective value of best solution or user objective limit)
1426  *
1427  * @pre This method can be called if SCIP is in one of the following stages:
1428  * - \ref SCIP_STAGE_TRANSFORMED
1429  * - \ref SCIP_STAGE_INITPRESOLVE
1430  * - \ref SCIP_STAGE_PRESOLVING
1431  * - \ref SCIP_STAGE_EXITPRESOLVE
1432  * - \ref SCIP_STAGE_PRESOLVED
1433  * - \ref SCIP_STAGE_INITSOLVE
1434  * - \ref SCIP_STAGE_SOLVING
1435  * - \ref SCIP_STAGE_SOLVED
1436  * - \ref SCIP_STAGE_EXITSOLVE
1437  */
1439  SCIP* scip /**< SCIP data structure */
1440  )
1441 {
1442  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetUpperbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1443 
1444  if( SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED )
1445  return -SCIPinfinity(scip);
1446  else
1447  return scip->primal->upperbound;
1448 }
1449 
1450 /** gets global cutoff bound in transformed problem: a sub problem with lower bound larger than the cutoff
1451  * cannot contain a better feasible solution; usually, this bound is equal to the upper bound, but if the
1452  * objective value is always integral, the cutoff bound is (nearly) one less than the upper bound;
1453  * additionally, due to objective function domain propagation, the cutoff bound can be further reduced
1454  *
1455  * @return global cutoff bound in transformed problem
1456  *
1457  * @pre This method can be called if SCIP is in one of the following stages:
1458  * - \ref SCIP_STAGE_TRANSFORMED
1459  * - \ref SCIP_STAGE_INITPRESOLVE
1460  * - \ref SCIP_STAGE_PRESOLVING
1461  * - \ref SCIP_STAGE_EXITPRESOLVE
1462  * - \ref SCIP_STAGE_PRESOLVED
1463  * - \ref SCIP_STAGE_INITSOLVE
1464  * - \ref SCIP_STAGE_SOLVING
1465  * - \ref SCIP_STAGE_SOLVED
1466  * - \ref SCIP_STAGE_EXITSOLVE
1467  */
1469  SCIP* scip /**< SCIP data structure */
1470  )
1471 {
1472  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetCutoffbound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1473 
1474  return scip->primal->cutoffbound;
1475 }
1476 
1477 /** updates the cutoff bound
1478  *
1479  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1480  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1481  *
1482  * @note using this method in the solving stage can lead to an erroneous SCIP solving status; in particular,
1483  * if a solution not respecting the cutoff bound was found before installing a cutoff bound which
1484  * renders the remaining problem infeasible, this solution may be reported as optimal
1485  *
1486  * @pre This method can be called if SCIP is in one of the following stages:
1487  * - \ref SCIP_STAGE_TRANSFORMED
1488  * - \ref SCIP_STAGE_PRESOLVING
1489  * - \ref SCIP_STAGE_PRESOLVED
1490  * - \ref SCIP_STAGE_INITSOLVE
1491  * - \ref SCIP_STAGE_SOLVING
1492  *
1493  * @note the given cutoff bound has to better or equal to known one (SCIPgetCutoffbound())
1494  * @note a given cutoff bound is also used for updating the objective limit, if possible
1495  */
1497  SCIP* scip, /**< SCIP data structure */
1498  SCIP_Real cutoffbound /**< new cutoff bound */
1499  )
1500 {
1501  SCIP_CALL( SCIPcheckStage(scip, "SCIPupdateCutoffbound", FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1502 
1503  assert(cutoffbound <= SCIPgetCutoffbound(scip));
1504 
1505  SCIP_CALL( SCIPprimalSetCutoffbound(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
1506  scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp, cutoffbound, FALSE) );
1507 
1508  return SCIP_OKAY;
1509 }
1510 
1511 
1512 /** returns whether the current primal bound is justified with a feasible primal solution; if not, the primal bound
1513  * was set from the user as objective limit
1514  *
1515  * @return TRUE if the current primal bound is justified with a feasible primal solution, otherwise FALSE
1516  *
1517  * @pre This method can be called if SCIP is in one of the following stages:
1518  * - \ref SCIP_STAGE_TRANSFORMED
1519  * - \ref SCIP_STAGE_INITPRESOLVE
1520  * - \ref SCIP_STAGE_PRESOLVING
1521  * - \ref SCIP_STAGE_EXITPRESOLVE
1522  * - \ref SCIP_STAGE_PRESOLVED
1523  * - \ref SCIP_STAGE_INITSOLVE
1524  * - \ref SCIP_STAGE_SOLVING
1525  * - \ref SCIP_STAGE_SOLVED
1526  * - \ref SCIP_STAGE_EXITSOLVE
1527  */
1529  SCIP* scip /**< SCIP data structure */
1530  )
1531 {
1532  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisPrimalboundSol", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1533 
1534  return SCIPprimalUpperboundIsSol(scip->primal, scip->set, scip->transprob, scip->origprob);
1535 }
1536 
1537 /** gets current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
1538  * or infinity, if they have opposite sign
1539  *
1540  * @return the current gap |(primalbound - dualbound)/min(|primalbound|,|dualbound|)| if both bounds have same sign,
1541  * or infinity, if they have opposite sign
1542  *
1543  * @pre This method can be called if SCIP is in one of the following stages:
1544  * - \ref SCIP_STAGE_PRESOLVING
1545  * - \ref SCIP_STAGE_EXITPRESOLVE
1546  * - \ref SCIP_STAGE_PRESOLVED
1547  * - \ref SCIP_STAGE_INITSOLVE
1548  * - \ref SCIP_STAGE_SOLVING
1549  * - \ref SCIP_STAGE_SOLVED
1550  */
1552  SCIP* scip /**< SCIP data structure */
1553  )
1554 {
1556 
1557  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with gap = +inf;
1558  * if the problem was proven to be unbounded or proven to be infeasible we return gap = 0
1559  */
1560  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
1561  return SCIPsetInfinity(scip->set);
1563  return 0.0;
1564 
1565  /* the lowerbound is infinity, but SCIP may not have updated the status; in this case, the problem was already solved
1566  * so we return gap = 0
1567  */
1568  if( SCIPsetIsInfinity(scip->set, SCIPgetLowerbound(scip)) )
1569  return 0.0;
1570 
1572 }
1573 
1574 /** gets current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
1575  * have same sign, or infinity, if they have opposite sign
1576  *
1577  * @return current gap |(upperbound - lowerbound)/min(|upperbound|,|lowerbound|)| in transformed problem if both bounds
1578  * have same sign, or infinity, if they have opposite sign
1579  *
1580  * @pre This method can be called if SCIP is in one of the following stages:
1581  * - \ref SCIP_STAGE_PRESOLVED
1582  * - \ref SCIP_STAGE_SOLVING
1583  * - \ref SCIP_STAGE_SOLVED
1584  */
1586  SCIP* scip /**< SCIP data structure */
1587  )
1588 {
1589  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetTransGap", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1590 
1591  /* in case we could not prove whether the problem is unbounded or infeasible, we want to terminate with gap = +inf;
1592  * if the problem was proven to be unbounded or proven to be infeasible we return gap = 0
1593  */
1594  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
1595  return SCIPsetInfinity(scip->set);
1597  return 0.0;
1598 
1599  /* the lowerbound is infinity, but SCIP may not have updated the status; in this case, the problem was already solved
1600  * so we return gap = 0
1601  */
1602  if( SCIPsetIsInfinity(scip->set, SCIPgetLowerbound(scip)) )
1603  return 0.0;
1604 
1606 }
1607 
1608 /** gets number of feasible primal solutions found so far
1609  *
1610  * @return the number of feasible primal solutions found so far
1611  *
1612  * @pre This method can be called if SCIP is in one of the following stages:
1613  * - \ref SCIP_STAGE_TRANSFORMED
1614  * - \ref SCIP_STAGE_INITPRESOLVE
1615  * - \ref SCIP_STAGE_PRESOLVING
1616  * - \ref SCIP_STAGE_EXITPRESOLVE
1617  * - \ref SCIP_STAGE_PRESOLVED
1618  * - \ref SCIP_STAGE_INITSOLVE
1619  * - \ref SCIP_STAGE_SOLVING
1620  * - \ref SCIP_STAGE_SOLVED
1621  * - \ref SCIP_STAGE_EXITSOLVE
1622  */
1624  SCIP* scip /**< SCIP data structure */
1625  )
1626 {
1627  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1628 
1629  return scip->primal->nsolsfound;
1630 }
1631 
1632 /** gets number of feasible primal solutions respecting the objective limit found so far
1633  *
1634  * @return the number of feasible primal solutions respecting the objective limit found so far
1635  *
1636  * @pre This method can be called if SCIP is in one of the following stages:
1637  * - \ref SCIP_STAGE_INIT
1638  * - \ref SCIP_STAGE_PROBLEM
1639  * - \ref SCIP_STAGE_TRANSFORMING
1640  * - \ref SCIP_STAGE_TRANSFORMED
1641  * - \ref SCIP_STAGE_INITPRESOLVE
1642  * - \ref SCIP_STAGE_PRESOLVING
1643  * - \ref SCIP_STAGE_EXITPRESOLVE
1644  * - \ref SCIP_STAGE_PRESOLVED
1645  * - \ref SCIP_STAGE_INITSOLVE
1646  * - \ref SCIP_STAGE_SOLVING
1647  * - \ref SCIP_STAGE_SOLVED
1648  * - \ref SCIP_STAGE_EXITSOLVE
1649  */
1651  SCIP* scip /**< SCIP data structure */
1652  )
1653 {
1655  return 0;
1656 
1657  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNLimSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1658 
1659  return scip->primal->nlimsolsfound;
1660 }
1661 
1662 /** gets number of feasible primal solutions found so far, that improved the primal bound at the time they were found
1663  *
1664  * @return the number of feasible primal solutions found so far, that improved the primal bound at the time they were found
1665  *
1666  * @pre This method can be called if SCIP is in one of the following stages:
1667  * - \ref SCIP_STAGE_TRANSFORMED
1668  * - \ref SCIP_STAGE_INITPRESOLVE
1669  * - \ref SCIP_STAGE_PRESOLVING
1670  * - \ref SCIP_STAGE_EXITPRESOLVE
1671  * - \ref SCIP_STAGE_PRESOLVED
1672  * - \ref SCIP_STAGE_INITSOLVE
1673  * - \ref SCIP_STAGE_SOLVING
1674  * - \ref SCIP_STAGE_SOLVED
1675  * - \ref SCIP_STAGE_EXITSOLVE
1676  */
1678  SCIP* scip /**< SCIP data structure */
1679  )
1680 {
1681  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNBestSolsFound", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
1682 
1683  return scip->primal->nbestsolsfound;
1684 }
1685 
1686 /** gets the average pseudo cost value for the given direction over all variables
1687  *
1688  * @return the average pseudo cost value for the given direction over all variables
1689  *
1690  * @pre This method can be called if SCIP is in one of the following stages:
1691  * - \ref SCIP_STAGE_SOLVING
1692  * - \ref SCIP_STAGE_SOLVED
1693  */
1695  SCIP* scip, /**< SCIP data structure */
1696  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
1697  )
1698 {
1699  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgPseudocost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1700 
1701  return SCIPhistoryGetPseudocost(scip->stat->glbhistory, solvaldelta);
1702 }
1703 
1704 /** gets the average pseudo cost value for the given direction over all variables,
1705  * only using the pseudo cost information of the current run
1706  *
1707  * @return the average pseudo cost value for the given direction over all variables,
1708  * only using the pseudo cost information of the current run
1709  *
1710  * @pre This method can be called if SCIP is in one of the following stages:
1711  * - \ref SCIP_STAGE_SOLVING
1712  * - \ref SCIP_STAGE_SOLVED
1713  */
1715  SCIP* scip, /**< SCIP data structure */
1716  SCIP_Real solvaldelta /**< difference of variable's new LP value - old LP value */
1717  )
1718 {
1719  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgPseudocostCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1720 
1721  return SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, solvaldelta);
1722 }
1723 
1724 /** gets the average number of pseudo cost updates for the given direction over all variables
1725  *
1726  * @return the average number of pseudo cost updates for the given direction over all variables
1727  *
1728  * @pre This method can be called if SCIP is in one of the following stages:
1729  * - \ref SCIP_STAGE_SOLVING
1730  * - \ref SCIP_STAGE_SOLVED
1731  */
1733  SCIP* scip, /**< SCIP data structure */
1734  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1735  )
1736 {
1737  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1738 
1739  return SCIPhistoryGetPseudocostCount(scip->stat->glbhistory, dir)
1740  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
1741 }
1742 
1743 /** gets the average number of pseudo cost updates for the given direction over all variables,
1744  * only using the pseudo cost information of the current run
1745  *
1746  * @return the average number of pseudo cost updates for the given direction over all variables,
1747  * only using the pseudo cost information of the current run
1748  *
1749  * @pre This method can be called if SCIP is in one of the following stages:
1750  * - \ref SCIP_STAGE_SOLVING
1751  * - \ref SCIP_STAGE_SOLVED
1752  */
1754  SCIP* scip, /**< SCIP data structure */
1755  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1756  )
1757 {
1758  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgPseudocostCountCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1759 
1761  / MAX(scip->transprob->nbinvars + scip->transprob->nintvars, 1);
1762 }
1763 
1764 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5
1765  *
1766  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5
1767  *
1768  * @pre This method can be called if SCIP is in one of the following stages:
1769  * - \ref SCIP_STAGE_SOLVING
1770  * - \ref SCIP_STAGE_SOLVED
1771  */
1773  SCIP* scip /**< SCIP data structure */
1774  )
1775 {
1776  SCIP_Real pscostdown;
1777  SCIP_Real pscostup;
1778 
1779  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgPseudocostScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1780 
1781  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistory, -0.5);
1782  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistory, +0.5);
1783 
1784  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
1785 }
1786 
1787 /** returns the variance of pseudo costs for all variables in the requested direction
1788  *
1789  * @return the variance of pseudo costs for all variables in the requested direction
1790  *
1791  * @pre This method can be called if SCIP is in one of the following stages:
1792  * - \ref SCIP_STAGE_SOLVING
1793  * - \ref SCIP_STAGE_SOLVED
1794  */
1796  SCIP* scip, /**< SCIP data structure */
1797  SCIP_BRANCHDIR branchdir, /**< the branching direction, up or down */
1798  SCIP_Bool onlycurrentrun /**< use only history of current run? */
1799  )
1800 {
1801  SCIP_HISTORY* history;
1802 
1803  assert(scip != NULL);
1804  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetPseudocostVariance", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1805 
1806  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
1807  assert(history != NULL);
1808 
1809  return SCIPhistoryGetPseudocostVariance(history, branchdir);
1810 }
1811 
1812 /** gets the number of pseudo cost updates for the given direction over all variables
1813  *
1814  * @return the number of pseudo cost updates for the given direction over all variables
1815  *
1816  * @pre This method can be called if SCIP is in one of the following stages:
1817  * - \ref SCIP_STAGE_SOLVING
1818  * - \ref SCIP_STAGE_SOLVED
1819  */
1821  SCIP* scip, /**< SCIP data structure */
1822  SCIP_BRANCHDIR dir, /**< branching direction (downwards, or upwards) */
1823  SCIP_Bool onlycurrentrun /**< use only history of current run? */
1824  )
1825 {
1826  SCIP_HISTORY* history;
1827 
1828  assert(scip != NULL);
1829  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetPseudocostCount", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1830 
1831  history = (onlycurrentrun ? scip->stat->glbhistorycrun : scip->stat->glbhistory);
1832 
1833  return SCIPhistoryGetPseudocostCount(history, dir);
1834 }
1835 
1836 /** gets the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
1837  * only using the pseudo cost information of the current run
1838  *
1839  * @return the average pseudo cost score value over all variables, assuming a fractionality of 0.5,
1840  * only using the pseudo cost information of the current run
1841  *
1842  * @pre This method can be called if SCIP is in one of the following stages:
1843  * - \ref SCIP_STAGE_SOLVING
1844  * - \ref SCIP_STAGE_SOLVED
1845  */
1847  SCIP* scip /**< SCIP data structure */
1848  )
1849 {
1850  SCIP_Real pscostdown;
1851  SCIP_Real pscostup;
1852 
1853  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgPseudocostScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1854 
1855  pscostdown = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, -0.5);
1856  pscostup = SCIPhistoryGetPseudocost(scip->stat->glbhistorycrun, +0.5);
1857 
1858  return SCIPbranchGetScore(scip->set, NULL, pscostdown, pscostup);
1859 }
1860 
1861 /** gets the average conflict score value over all variables
1862  *
1863  * @return the average conflict score value over all variables
1864  *
1865  * @pre This method can be called if SCIP is in one of the following stages:
1866  * - \ref SCIP_STAGE_SOLVING
1867  * - \ref SCIP_STAGE_SOLVED
1868  */
1870  SCIP* scip /**< SCIP data structure */
1871  )
1872 {
1873  SCIP_Real conflictscoredown;
1874  SCIP_Real conflictscoreup;
1875  SCIP_Real scale;
1876 
1877  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgConflictScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1878 
1879  scale = scip->transprob->nvars * scip->stat->vsidsweight;
1880  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_DOWNWARDS) / scale;
1881  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistory, SCIP_BRANCHDIR_UPWARDS) / scale;
1882 
1883  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
1884 }
1885 
1886 /** gets the average conflict score value over all variables, only using the conflict score information of the current run
1887  *
1888  * @return the average conflict score value over all variables, only using the conflict score information of the current run
1889  *
1890  * @pre This method can be called if SCIP is in one of the following stages:
1891  * - \ref SCIP_STAGE_SOLVING
1892  * - \ref SCIP_STAGE_SOLVED
1893  */
1895  SCIP* scip /**< SCIP data structure */
1896  )
1897 {
1898  SCIP_Real conflictscoredown;
1899  SCIP_Real conflictscoreup;
1900  SCIP_Real scale;
1901 
1902  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgConflictScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1903 
1904  scale = scip->transprob->nvars * scip->stat->vsidsweight;
1905  conflictscoredown = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_DOWNWARDS) / scale;
1906  conflictscoreup = SCIPhistoryGetVSIDS(scip->stat->glbhistorycrun, SCIP_BRANCHDIR_UPWARDS) / scale;
1907 
1908  return SCIPbranchGetScore(scip->set, NULL, conflictscoredown, conflictscoreup);
1909 }
1910 
1911 /** gets the average inference score value over all variables
1912  *
1913  * @return the average inference score value over all variables
1914  *
1915  * @pre This method can be called if SCIP is in one of the following stages:
1916  * - \ref SCIP_STAGE_SOLVING
1917  * - \ref SCIP_STAGE_SOLVED
1918  */
1920  SCIP* scip /**< SCIP data structure */
1921  )
1922 {
1923  SCIP_Real conflictlengthdown;
1924  SCIP_Real conflictlengthup;
1925 
1926  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgConflictlengthScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1927 
1930 
1931  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
1932 }
1933 
1934 /** gets the average conflictlength score value over all variables, only using the conflictlength information of the
1935  * current run
1936  *
1937  * @return the average conflictlength score value over all variables, only using the conflictlength information of the
1938  * current run
1939  *
1940  * @pre This method can be called if SCIP is in one of the following stages:
1941  * - \ref SCIP_STAGE_SOLVING
1942  * - \ref SCIP_STAGE_SOLVED
1943  */
1945  SCIP* scip /**< SCIP data structure */
1946  )
1947 {
1948  SCIP_Real conflictlengthdown;
1949  SCIP_Real conflictlengthup;
1950 
1951  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgConflictlengthScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1952 
1955 
1956  return SCIPbranchGetScore(scip->set, NULL, conflictlengthdown, conflictlengthup);
1957 }
1958 
1959 /** returns the average number of inferences found after branching in given direction over all variables
1960  *
1961  * @return the average number of inferences found after branching in given direction over all variables
1962  *
1963  * @pre This method can be called if SCIP is in one of the following stages:
1964  * - \ref SCIP_STAGE_SOLVING
1965  * - \ref SCIP_STAGE_SOLVED
1966  */
1968  SCIP* scip, /**< SCIP data structure */
1969  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1970  )
1971 {
1972  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgInferences", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1973 
1974  return SCIPhistoryGetAvgInferences(scip->stat->glbhistory, dir);
1975 }
1976 
1977 /** returns the average number of inferences found after branching in given direction over all variables,
1978  * only using the inference information of the current run
1979  *
1980  * @return the average number of inferences found after branching in given direction over all variables,
1981  * only using the inference information of the current run
1982  *
1983  * @pre This method can be called if SCIP is in one of the following stages:
1984  * - \ref SCIP_STAGE_SOLVING
1985  * - \ref SCIP_STAGE_SOLVED
1986  */
1988  SCIP* scip, /**< SCIP data structure */
1989  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
1990  )
1991 {
1992  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgInferencesCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1993 
1994  return SCIPhistoryGetAvgInferences(scip->stat->glbhistorycrun, dir);
1995 }
1996 
1997 /** gets the average inference score value over all variables
1998  *
1999  * @return the average inference score value over all variables
2000  *
2001  * @pre This method can be called if SCIP is in one of the following stages:
2002  * - \ref SCIP_STAGE_SOLVING
2003  * - \ref SCIP_STAGE_SOLVED
2004  */
2006  SCIP* scip /**< SCIP data structure */
2007  )
2008 {
2009  SCIP_Real inferencesdown;
2010  SCIP_Real inferencesup;
2011 
2012  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgInferenceScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2013 
2016 
2017  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
2018 }
2019 
2020 /** gets the average inference score value over all variables, only using the inference information of the
2021  * current run
2022  *
2023  * @return the average inference score value over all variables, only using the inference information of the
2024  * current run
2025  *
2026  * @pre This method can be called if SCIP is in one of the following stages:
2027  * - \ref SCIP_STAGE_SOLVING
2028  * - \ref SCIP_STAGE_SOLVED
2029  */
2031  SCIP* scip /**< SCIP data structure */
2032  )
2033 {
2034  SCIP_Real inferencesdown;
2035  SCIP_Real inferencesup;
2036 
2037  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgInferenceScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2038 
2041 
2042  return SCIPbranchGetScore(scip->set, NULL, inferencesdown, inferencesup);
2043 }
2044 
2045 /** returns the average number of cutoffs found after branching in given direction over all variables
2046  *
2047  * @return the average number of cutoffs found after branching in given direction over all variables
2048  *
2049  * @pre This method can be called if SCIP is in one of the following stages:
2050  * - \ref SCIP_STAGE_SOLVING
2051  * - \ref SCIP_STAGE_SOLVED
2052  */
2054  SCIP* scip, /**< SCIP data structure */
2055  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
2056  )
2057 {
2058  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgCutoffs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2059 
2060  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistory, dir);
2061 }
2062 
2063 /** returns the average number of cutoffs found after branching in given direction over all variables,
2064  * only using the cutoff information of the current run
2065  *
2066  * @return the average number of cutoffs found after branching in given direction over all variables,
2067  * only using the cutoff information of the current run
2068  *
2069  * @pre This method can be called if SCIP is in one of the following stages:
2070  * - \ref SCIP_STAGE_SOLVING
2071  * - \ref SCIP_STAGE_SOLVED
2072  */
2074  SCIP* scip, /**< SCIP data structure */
2075  SCIP_BRANCHDIR dir /**< branching direction (downwards, or upwards) */
2076  )
2077 {
2078  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgCutoffsCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2079 
2080  return SCIPhistoryGetAvgCutoffs(scip->stat->glbhistorycrun, dir);
2081 }
2082 
2083 /** gets the average cutoff score value over all variables
2084  *
2085  * @return the average cutoff score value over all variables
2086  *
2087  * @pre This method can be called if SCIP is in one of the following stages:
2088  * - \ref SCIP_STAGE_SOLVING
2089  * - \ref SCIP_STAGE_SOLVED
2090  */
2092  SCIP* scip /**< SCIP data structure */
2093  )
2094 {
2095  SCIP_Real cutoffsdown;
2096  SCIP_Real cutoffsup;
2097 
2098  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgCutoffScore", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2099 
2102 
2103  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
2104 }
2105 
2106 /** gets the average cutoff score value over all variables, only using the cutoff score information of the current run
2107  *
2108  * @return the average cutoff score value over all variables, only using the cutoff score information of the current run
2109  *
2110  * @pre This method can be called if SCIP is in one of the following stages:
2111  * - \ref SCIP_STAGE_SOLVING
2112  * - \ref SCIP_STAGE_SOLVED
2113  */
2115  SCIP* scip /**< SCIP data structure */
2116  )
2117 {
2118  SCIP_Real cutoffsdown;
2119  SCIP_Real cutoffsup;
2120 
2121  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetAvgCutoffScoreCurrentRun", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2122 
2125 
2126  return SCIPbranchGetScore(scip->set, NULL, cutoffsdown, cutoffsup);
2127 }
2128 
2129 /** computes a deterministic measure of time from statistics
2130  *
2131  * @return the deterministic time
2132  *
2133  * @pre This method can be called if SCIP is in one of the following stages:
2134  * - \ref SCIP_STAGE_PRESOLVING
2135  * - \ref SCIP_STAGE_PRESOLVED
2136  * - \ref SCIP_STAGE_SOLVING
2137  * - \ref SCIP_STAGE_SOLVED
2138  */
2140  SCIP* scip /**< SCIP data structure */
2141  )
2142 {
2143 /* TODO: SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetDeterministicTime", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) ); */
2144  if(scip->stat == NULL)
2145  return 0.0;
2146 
2147  return 1e-6 * scip->stat->nnz * (
2148  0.00328285264101 * scip->stat->nprimalresolvelpiterations +
2149  0.00531625104146 * scip->stat->ndualresolvelpiterations +
2150  0.000738719124051 * scip->stat->nprobboundchgs +
2151  0.0011123144764 * scip->stat->nisstoppedcalls );
2152 }
2153 
2154 /** outputs problem to file stream */
2155 static
2157  SCIP* scip, /**< SCIP data structure */
2158  SCIP_PROB* prob, /**< problem data */
2159  FILE* file, /**< output file (or NULL for standard output) */
2160  const char* extension, /**< file format (or NULL for default CIP format) */
2161  SCIP_Bool genericnames /**< using generic variable and constraint names? */
2162  )
2163 {
2164  SCIP_RESULT result;
2165  int i;
2166  assert(scip != NULL);
2167  assert(prob != NULL);
2168 
2169  /* try all readers until one could read the file */
2170  result = SCIP_DIDNOTRUN;
2171  for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
2172  {
2173  SCIP_RETCODE retcode;
2174 
2175  if( extension != NULL )
2176  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, extension, genericnames, &result);
2177  else
2178  retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, file, "cip", genericnames, &result);
2179 
2180  /* check for reader errors */
2181  if( retcode == SCIP_WRITEERROR )
2182  return retcode;
2183 
2184  SCIP_CALL( retcode );
2185  }
2186 
2187  switch( result )
2188  {
2189  case SCIP_DIDNOTRUN:
2190  return SCIP_PLUGINNOTFOUND;
2191 
2192  case SCIP_SUCCESS:
2193  return SCIP_OKAY;
2194 
2195  default:
2196  assert(i < scip->set->nreaders);
2197  SCIPerrorMessage("invalid result code <%d> from reader <%s> writing <%s> format\n",
2198  result, SCIPreaderGetName(scip->set->readers[i]), extension);
2199  return SCIP_READERROR;
2200  } /*lint !e788*/
2201 }
2202 
2203 /** outputs original problem to file stream
2204  *
2205  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2206  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2207  *
2208  * @pre This method can be called if SCIP is in one of the following stages:
2209  * - \ref SCIP_STAGE_PROBLEM
2210  * - \ref SCIP_STAGE_TRANSFORMING
2211  * - \ref SCIP_STAGE_TRANSFORMED
2212  * - \ref SCIP_STAGE_INITPRESOLVE
2213  * - \ref SCIP_STAGE_PRESOLVING
2214  * - \ref SCIP_STAGE_EXITPRESOLVE
2215  * - \ref SCIP_STAGE_PRESOLVED
2216  * - \ref SCIP_STAGE_INITSOLVE
2217  * - \ref SCIP_STAGE_SOLVING
2218  * - \ref SCIP_STAGE_SOLVED
2219  * - \ref SCIP_STAGE_EXITSOLVE
2220  * - \ref SCIP_STAGE_FREETRANS
2221  */
2223  SCIP* scip, /**< SCIP data structure */
2224  FILE* file, /**< output file (or NULL for standard output) */
2225  const char* extension, /**< file format (or NULL for default CIP format)*/
2226  SCIP_Bool genericnames /**< using generic variable and constraint names? */
2227  )
2228 {
2229  SCIP_RETCODE retcode;
2230 
2231  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2232 
2233  assert(scip != NULL);
2234  assert( scip->origprob != NULL );
2235 
2236  retcode = printProblem(scip, scip->origprob, file, extension, genericnames);
2237 
2238  /* check for write errors */
2239  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
2240  return retcode;
2241  else
2242  {
2243  SCIP_CALL( retcode );
2244  }
2245 
2246  return SCIP_OKAY;
2247 }
2248 
2249 /** outputs transformed problem of the current node to file stream
2250  *
2251  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2252  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2253  *
2254  * @pre This method can be called if SCIP is in one of the following stages:
2255  * - \ref SCIP_STAGE_TRANSFORMED
2256  * - \ref SCIP_STAGE_INITPRESOLVE
2257  * - \ref SCIP_STAGE_PRESOLVING
2258  * - \ref SCIP_STAGE_EXITPRESOLVE
2259  * - \ref SCIP_STAGE_PRESOLVED
2260  * - \ref SCIP_STAGE_INITSOLVE
2261  * - \ref SCIP_STAGE_SOLVING
2262  * - \ref SCIP_STAGE_SOLVED
2263  * - \ref SCIP_STAGE_EXITSOLVE
2264  * - \ref SCIP_STAGE_FREETRANS
2265  */
2267  SCIP* scip, /**< SCIP data structure */
2268  FILE* file, /**< output file (or NULL for standard output) */
2269  const char* extension, /**< file format (or NULL for default CIP format)*/
2270  SCIP_Bool genericnames /**< using generic variable and constraint names? */
2271  )
2272 {
2273  SCIP_RETCODE retcode;
2274 
2275  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2276 
2277  assert(scip != NULL);
2278  assert(scip->transprob != NULL );
2279 
2280  retcode = printProblem(scip, scip->transprob, file, extension, genericnames);
2281 
2282  /* check for write errors */
2283  if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
2284  return retcode;
2285  else
2286  {
2287  SCIP_CALL( retcode );
2288  }
2289 
2290  return SCIP_OKAY;
2291 }
2292 
2293 /** outputs status statistics
2294  *
2295  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
2296  * thus may to correspond to the original status.
2297  *
2298  * @pre This method can be called if SCIP is in one of the following stages:
2299  * - \ref SCIP_STAGE_INIT
2300  * - \ref SCIP_STAGE_PROBLEM
2301  * - \ref SCIP_STAGE_TRANSFORMED
2302  * - \ref SCIP_STAGE_INITPRESOLVE
2303  * - \ref SCIP_STAGE_PRESOLVING
2304  * - \ref SCIP_STAGE_EXITPRESOLVE
2305  * - \ref SCIP_STAGE_PRESOLVED
2306  * - \ref SCIP_STAGE_SOLVING
2307  * - \ref SCIP_STAGE_SOLVED
2308  */
2310  SCIP* scip, /**< SCIP data structure */
2311  FILE* file /**< output file */
2312  )
2313 {
2314  assert(scip != NULL);
2315  assert(scip->set != NULL);
2316 
2317  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintStatusStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2318 
2319  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Status : ");
2320  SCIP_CALL_ABORT( SCIPprintStage(scip, file) );
2321  SCIPmessageFPrintInfo(scip->messagehdlr, file, "\n");
2322 }
2323 
2324 /** outputs statistics for original problem
2325  *
2326  * @pre This method can be called if SCIP is in one of the following stages:
2327  * - \ref SCIP_STAGE_PROBLEM
2328  * - \ref SCIP_STAGE_TRANSFORMED
2329  * - \ref SCIP_STAGE_INITPRESOLVE
2330  * - \ref SCIP_STAGE_PRESOLVING
2331  * - \ref SCIP_STAGE_EXITPRESOLVE
2332  * - \ref SCIP_STAGE_PRESOLVED
2333  * - \ref SCIP_STAGE_SOLVING
2334  * - \ref SCIP_STAGE_SOLVED
2335  */
2337  SCIP* scip, /**< SCIP data structure */
2338  FILE* file /**< output file */
2339  )
2340 {
2341  assert(scip != NULL);
2342  assert(scip->set != NULL);
2343 
2344  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintOrigProblemStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2345 
2346  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Original Problem :\n");
2347  SCIPprobPrintStatistics(scip->origprob, scip->set, scip->messagehdlr, file);
2348 }
2349 
2350 /** outputs statistics for transformed problem
2351  *
2352  * @pre This method can be called if SCIP is in one of the following stages:
2353  * - \ref SCIP_STAGE_PROBLEM
2354  * - \ref SCIP_STAGE_TRANSFORMED
2355  * - \ref SCIP_STAGE_INITPRESOLVE
2356  * - \ref SCIP_STAGE_PRESOLVING
2357  * - \ref SCIP_STAGE_EXITPRESOLVE
2358  * - \ref SCIP_STAGE_PRESOLVED
2359  * - \ref SCIP_STAGE_SOLVING
2360  * - \ref SCIP_STAGE_SOLVED
2361  */
2363  SCIP* scip, /**< SCIP data structure */
2364  FILE* file /**< output file */
2365  )
2366 {
2367  assert(scip != NULL);
2368  assert(scip->set != NULL);
2369 
2370  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintTransProblemStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2371 
2372  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolved Problem :\n");
2373  SCIPprobPrintStatistics(scip->transprob, scip->set, scip->messagehdlr, file);
2374 }
2375 
2376 /** outputs presolver statistics
2377  *
2378  * @pre This method can be called if SCIP is in one of the following stages:
2379  * - \ref SCIP_STAGE_TRANSFORMED
2380  * - \ref SCIP_STAGE_INITPRESOLVE
2381  * - \ref SCIP_STAGE_PRESOLVING
2382  * - \ref SCIP_STAGE_EXITPRESOLVE
2383  * - \ref SCIP_STAGE_PRESOLVED
2384  * - \ref SCIP_STAGE_SOLVING
2385  * - \ref SCIP_STAGE_SOLVED
2386  */
2388  SCIP* scip, /**< SCIP data structure */
2389  FILE* file /**< output file */
2390  )
2391 {
2392  int i;
2393 
2394  assert(scip != NULL);
2395  assert(scip->set != NULL);
2396 
2397  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintPresolverStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2398 
2399  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Presolvers : ExecTime SetupTime Calls FixedVars AggrVars ChgTypes ChgBounds AddHoles DelCons AddCons ChgSides ChgCoefs\n");
2400 
2401  /* sort presolvers w.r.t. their name */
2402  SCIPsetSortPresolsName(scip->set);
2403 
2404  /* presolver statistics */
2405  for( i = 0; i < scip->set->npresols; ++i )
2406  {
2407  SCIP_PRESOL* presol;
2408  presol = scip->set->presols[i];
2409  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpresolGetName(presol));
2410  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
2411  SCIPpresolGetTime(presol),
2412  SCIPpresolGetSetupTime(presol),
2413  SCIPpresolGetNCalls(presol),
2414  SCIPpresolGetNFixedVars(presol),
2415  SCIPpresolGetNAggrVars(presol),
2416  SCIPpresolGetNChgVarTypes(presol),
2417  SCIPpresolGetNChgBds(presol),
2418  SCIPpresolGetNAddHoles(presol),
2419  SCIPpresolGetNDelConss(presol),
2420  SCIPpresolGetNAddConss(presol),
2421  SCIPpresolGetNChgSides(presol),
2422  SCIPpresolGetNChgCoefs(presol));
2423  }
2424 
2425  /* sort propagators w.r.t. their name */
2426  SCIPsetSortPropsName(scip->set);
2427 
2428  for( i = 0; i < scip->set->nprops; ++i )
2429  {
2430  SCIP_PROP* prop;
2431  prop = scip->set->props[i];
2432  if( SCIPpropDoesPresolve(prop) )
2433  {
2434  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
2435  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
2436  SCIPpropGetPresolTime(prop),
2437  SCIPpropGetSetupTime(prop),
2439  SCIPpropGetNFixedVars(prop),
2440  SCIPpropGetNAggrVars(prop),
2442  SCIPpropGetNChgBds(prop),
2443  SCIPpropGetNAddHoles(prop),
2444  SCIPpropGetNDelConss(prop),
2445  SCIPpropGetNAddConss(prop),
2446  SCIPpropGetNChgSides(prop),
2447  SCIPpropGetNChgCoefs(prop));
2448  }
2449  }
2450 
2451  /* constraint handler presolving methods statistics */
2452  for( i = 0; i < scip->set->nconshdlrs; ++i )
2453  {
2454  SCIP_CONSHDLR* conshdlr;
2455  int maxnactiveconss;
2456 
2457  conshdlr = scip->set->conshdlrs[i];
2458  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
2459  if( SCIPconshdlrDoesPresolve(conshdlr)
2460  && (maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr)
2461  || SCIPconshdlrGetNFixedVars(conshdlr) > 0
2462  || SCIPconshdlrGetNAggrVars(conshdlr) > 0
2463  || SCIPconshdlrGetNChgVarTypes(conshdlr) > 0
2464  || SCIPconshdlrGetNChgBds(conshdlr) > 0
2465  || SCIPconshdlrGetNAddHoles(conshdlr) > 0
2466  || SCIPconshdlrGetNDelConss(conshdlr) > 0
2467  || SCIPconshdlrGetNAddConss(conshdlr) > 0
2468  || SCIPconshdlrGetNChgSides(conshdlr) > 0
2469  || SCIPconshdlrGetNChgCoefs(conshdlr) > 0
2470  || SCIPconshdlrGetNUpgdConss(conshdlr) > 0) )
2471  {
2472  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
2473  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %6d %10d %10d %10d %10d %10d %10d %10d %10d %10d\n",
2474  SCIPconshdlrGetPresolTime(conshdlr),
2475  SCIPconshdlrGetSetupTime(conshdlr),
2476  SCIPconshdlrGetNPresolCalls(conshdlr),
2477  SCIPconshdlrGetNFixedVars(conshdlr),
2478  SCIPconshdlrGetNAggrVars(conshdlr),
2479  SCIPconshdlrGetNChgVarTypes(conshdlr),
2480  SCIPconshdlrGetNChgBds(conshdlr),
2481  SCIPconshdlrGetNAddHoles(conshdlr),
2482  SCIPconshdlrGetNDelConss(conshdlr),
2483  SCIPconshdlrGetNAddConss(conshdlr),
2484  SCIPconshdlrGetNChgSides(conshdlr),
2485  SCIPconshdlrGetNChgCoefs(conshdlr));
2486  }
2487  }
2488 
2489  /* root node bound changes */
2490  SCIPmessageFPrintInfo(scip->messagehdlr, file, " root node : - - - %10d - - %10d - - - - -\n",
2491  scip->stat->nrootintfixings, scip->stat->nrootboundchgs);
2492 }
2493 
2494 /** outputs constraint statistics
2495  *
2496  * @pre This method can be called if SCIP is in one of the following stages:
2497  * - \ref SCIP_STAGE_TRANSFORMED
2498  * - \ref SCIP_STAGE_INITPRESOLVE
2499  * - \ref SCIP_STAGE_PRESOLVING
2500  * - \ref SCIP_STAGE_EXITPRESOLVE
2501  * - \ref SCIP_STAGE_PRESOLVED
2502  * - \ref SCIP_STAGE_SOLVING
2503  * - \ref SCIP_STAGE_SOLVED
2504  */
2506  SCIP* scip, /**< SCIP data structure */
2507  FILE* file /**< output file */
2508  )
2509 {
2510  int i;
2511 
2512  assert(scip != NULL);
2513  assert(scip->set != NULL);
2514 
2515  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintConstraintStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2516 
2517  /* Add maximal number of constraints of the same type? So far this information is not added because of lack of space. */
2518  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraints : Number MaxNumber #Separate #Propagate #EnfoLP #EnfoRelax #EnfoPS #Check #ResProp Cutoffs DomReds Cuts Applied Conss Children\n");
2519 
2520  for( i = 0; i < scip->set->nconshdlrs; ++i )
2521  {
2522  SCIP_CONSHDLR* conshdlr;
2523  int startnactiveconss;
2524  int maxnactiveconss;
2525 
2526  conshdlr = scip->set->conshdlrs[i];
2527  startnactiveconss = SCIPconshdlrGetStartNActiveConss(conshdlr);
2528  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
2529  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
2530  {
2531  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
2533  startnactiveconss,
2534  maxnactiveconss > startnactiveconss ? '+' : ' ',
2535  maxnactiveconss,
2536  SCIPconshdlrGetNSepaCalls(conshdlr),
2537  SCIPconshdlrGetNPropCalls(conshdlr),
2538  SCIPconshdlrGetNEnfoLPCalls(conshdlr),
2540  SCIPconshdlrGetNEnfoPSCalls(conshdlr),
2541  SCIPconshdlrGetNCheckCalls(conshdlr),
2542  SCIPconshdlrGetNRespropCalls(conshdlr),
2543  SCIPconshdlrGetNCutoffs(conshdlr),
2544  SCIPconshdlrGetNDomredsFound(conshdlr),
2545  SCIPconshdlrGetNCutsFound(conshdlr),
2546  SCIPconshdlrGetNCutsApplied(conshdlr),
2547  SCIPconshdlrGetNConssFound(conshdlr),
2548  SCIPconshdlrGetNChildren(conshdlr));
2549  }
2550  }
2551 }
2552 
2553 /** outputs constraint timing statistics
2554  *
2555  * @pre This method can be called if SCIP is in one of the following stages:
2556  * - \ref SCIP_STAGE_TRANSFORMED
2557  * - \ref SCIP_STAGE_INITPRESOLVE
2558  * - \ref SCIP_STAGE_PRESOLVING
2559  * - \ref SCIP_STAGE_EXITPRESOLVE
2560  * - \ref SCIP_STAGE_PRESOLVED
2561  * - \ref SCIP_STAGE_SOLVING
2562  * - \ref SCIP_STAGE_SOLVED
2563  */
2565  SCIP* scip, /**< SCIP data structure */
2566  FILE* file /**< output file */
2567  )
2568 {
2569  int i;
2570 
2571  assert(scip != NULL);
2572  assert(scip->set != NULL);
2573 
2574  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintConstraintTimingStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2575 
2576  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Constraint Timings : TotalTime SetupTime Separate Propagate EnfoLP EnfoPS EnfoRelax Check ResProp SB-Prop\n");
2577 
2578  for( i = 0; i < scip->set->nconshdlrs; ++i )
2579  {
2580  SCIP_CONSHDLR* conshdlr;
2581  int maxnactiveconss;
2582 
2583  conshdlr = scip->set->conshdlrs[i];
2584  maxnactiveconss = SCIPconshdlrGetMaxNActiveConss(conshdlr);
2585  if( maxnactiveconss > 0 || !SCIPconshdlrNeedsCons(conshdlr) )
2586  {
2587  SCIP_Real totaltime;
2588 
2589  totaltime = SCIPconshdlrGetSepaTime(conshdlr) + SCIPconshdlrGetPropTime(conshdlr)
2591  + SCIPconshdlrGetEnfoLPTime(conshdlr)
2592  + SCIPconshdlrGetEnfoPSTime(conshdlr)
2593  + SCIPconshdlrGetEnfoRelaxTime(conshdlr)
2594  + SCIPconshdlrGetCheckTime(conshdlr)
2595  + SCIPconshdlrGetRespropTime(conshdlr)
2596  + SCIPconshdlrGetSetupTime(conshdlr);
2597 
2598  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPconshdlrGetName(conshdlr));
2599  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",
2600  totaltime,
2601  SCIPconshdlrGetSetupTime(conshdlr),
2602  SCIPconshdlrGetSepaTime(conshdlr),
2603  SCIPconshdlrGetPropTime(conshdlr),
2604  SCIPconshdlrGetEnfoLPTime(conshdlr),
2605  SCIPconshdlrGetEnfoPSTime(conshdlr),
2606  SCIPconshdlrGetEnfoRelaxTime(conshdlr),
2607  SCIPconshdlrGetCheckTime(conshdlr),
2608  SCIPconshdlrGetRespropTime(conshdlr),
2610  }
2611  }
2612 }
2613 
2614 /** outputs propagator statistics
2615  *
2616  * @pre This method can be called if SCIP is in one of the following stages:
2617  * - \ref SCIP_STAGE_TRANSFORMED
2618  * - \ref SCIP_STAGE_INITPRESOLVE
2619  * - \ref SCIP_STAGE_PRESOLVING
2620  * - \ref SCIP_STAGE_EXITPRESOLVE
2621  * - \ref SCIP_STAGE_PRESOLVED
2622  * - \ref SCIP_STAGE_SOLVING
2623  * - \ref SCIP_STAGE_SOLVED
2624  */
2626  SCIP* scip, /**< SCIP data structure */
2627  FILE* file /**< output file */
2628  )
2629 {
2630  int i;
2631 
2632  assert(scip != NULL);
2633  assert(scip->set != NULL);
2634 
2635  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintPropagatorStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2636 
2637  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagators : #Propagate #ResProp Cutoffs DomReds\n");
2638 
2639  /* sort propagaters w.r.t. their name */
2640  SCIPsetSortPropsName(scip->set);
2641 
2642  for( i = 0; i < scip->set->nprops; ++i )
2643  {
2644  SCIP_PROP* prop;
2645  prop = scip->set->props[i];
2646 
2648  SCIPpropGetName(prop),
2649  SCIPpropGetNCalls(prop),
2651  SCIPpropGetNCutoffs(prop),
2652  SCIPpropGetNDomredsFound(prop));
2653  }
2654 
2655  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Propagator Timings : TotalTime SetupTime Presolve Propagate ResProp SB-Prop\n");
2656 
2657  for( i = 0; i < scip->set->nprops; ++i )
2658  {
2659  SCIP_PROP* prop;
2660  SCIP_Real totaltime;
2661 
2662  prop = scip->set->props[i];
2663  totaltime = SCIPpropGetPresolTime(prop) + SCIPpropGetTime(prop) + SCIPpropGetRespropTime(prop)
2665 
2666  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s:", SCIPpropGetName(prop));
2667  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10.2f %10.2f %10.2f %10.2f %10.2f\n",
2668  totaltime,
2669  SCIPpropGetSetupTime(prop),
2670  SCIPpropGetPresolTime(prop),
2671  SCIPpropGetTime(prop),
2672  SCIPpropGetRespropTime(prop),
2674  }
2675 }
2676 
2677 /** outputs conflict statistics
2678  *
2679  * @pre This method can be called if SCIP is in one of the following stages:
2680  * - \ref SCIP_STAGE_TRANSFORMED
2681  * - \ref SCIP_STAGE_INITPRESOLVE
2682  * - \ref SCIP_STAGE_PRESOLVING
2683  * - \ref SCIP_STAGE_EXITPRESOLVE
2684  * - \ref SCIP_STAGE_PRESOLVED
2685  * - \ref SCIP_STAGE_SOLVING
2686  * - \ref SCIP_STAGE_SOLVED
2687  */
2689  SCIP* scip, /**< SCIP data structure */
2690  FILE* file /**< output file */
2691  )
2692 {
2693  char initstoresize[SCIP_MAXSTRLEN];
2694  char maxstoresize[SCIP_MAXSTRLEN];
2695 
2696  assert(scip != NULL);
2697  assert(scip->set != NULL);
2698 
2699  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintConflictStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2700 
2701  if( scip->set->conf_maxstoresize == 0 )
2702  {
2703  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "inf");
2704  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "inf");
2705  }
2706  else
2707  {
2708  int initsize = SCIPconflictstoreGetInitPoolSize(scip->conflictstore);
2709  int maxsize = SCIPconflictstoreGetMaxPoolSize(scip->conflictstore);
2710 
2711  if( maxsize == -1 )
2712  {
2713  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "--");
2714  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "--");
2715  }
2716  else
2717  {
2718  assert(initsize >= 0);
2719  assert(maxsize >= 0);
2720 
2721  (void)SCIPsnprintf(initstoresize, SCIP_MAXSTRLEN, "%d", initsize);
2722  (void)SCIPsnprintf(maxstoresize, SCIP_MAXSTRLEN, "%d", maxsize);
2723  }
2724  }
2725  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);
2726  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",
2738  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",
2755  SCIPmessageFPrintInfo(scip->messagehdlr, file, " bound exceed. LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " - %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT " %10.1f %10" SCIP_LONGINT_FORMAT "\n",
2772  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",
2785  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",
2797  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied globally : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
2805  SCIPmessageFPrintInfo(scip->messagehdlr, file, " applied locally : - - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.1f - - %10" SCIP_LONGINT_FORMAT " - -\n",
2813 }
2814 
2815 /** outputs separator statistics
2816  *
2817  * @pre This method can be called if SCIP is in one of the following stages:
2818  * - \ref SCIP_STAGE_SOLVING
2819  * - \ref SCIP_STAGE_SOLVED
2820  */
2822  SCIP* scip, /**< SCIP data structure */
2823  FILE* file /**< output file */
2824  )
2825 {
2826  int i;
2827 
2828  assert(scip != NULL);
2829  assert(scip->set != NULL);
2830 
2831  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintSeparatorStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2832 
2833  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Separators : ExecTime SetupTime Calls Cutoffs DomReds Cuts Applied Conss\n");
2834  SCIPmessageFPrintInfo(scip->messagehdlr, file, " cut pool : %10.2f %10" SCIP_LONGINT_FORMAT " - - %10" SCIP_LONGINT_FORMAT " - - (maximal pool size: %d)\n",
2835  SCIPcutpoolGetTime(scip->cutpool),
2839 
2840  /* sort separators w.r.t. their name */
2841  SCIPsetSortSepasName(scip->set);
2842 
2843  for( i = 0; i < scip->set->nsepas; ++i )
2844  {
2845  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",
2846  SCIPsepaGetName(scip->set->sepas[i]),
2847  SCIPsepaGetTime(scip->set->sepas[i]),
2848  SCIPsepaGetSetupTime(scip->set->sepas[i]),
2849  SCIPsepaGetNCalls(scip->set->sepas[i]),
2850  SCIPsepaGetNCutoffs(scip->set->sepas[i]),
2851  SCIPsepaGetNDomredsFound(scip->set->sepas[i]),
2852  SCIPsepaGetNCutsFound(scip->set->sepas[i]),
2853  SCIPsepaGetNCutsApplied(scip->set->sepas[i]),
2854  SCIPsepaGetNConssFound(scip->set->sepas[i]));
2855  }
2856 }
2857 
2858 /** outputs pricer statistics
2859  *
2860  * @pre This method can be called if SCIP is in one of the following stages:
2861  * - \ref SCIP_STAGE_SOLVING
2862  * - \ref SCIP_STAGE_SOLVED
2863  */
2865  SCIP* scip, /**< SCIP data structure */
2866  FILE* file /**< output file */
2867  )
2868 {
2869  int i;
2870 
2871  assert(scip != NULL);
2872  assert(scip->set != NULL);
2873 
2874  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintPricerStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2875 
2876  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Pricers : ExecTime SetupTime Calls Vars\n");
2877  SCIPmessageFPrintInfo(scip->messagehdlr, file, " problem variables: %10.2f - %10d %10d\n",
2881 
2882  /* sort pricers w.r.t. their name */
2883  SCIPsetSortPricersName(scip->set);
2884 
2885  for( i = 0; i < scip->set->nactivepricers; ++i )
2886  {
2887  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10d %10d\n",
2888  SCIPpricerGetName(scip->set->pricers[i]),
2889  SCIPpricerGetTime(scip->set->pricers[i]),
2890  SCIPpricerGetSetupTime(scip->set->pricers[i]),
2891  SCIPpricerGetNCalls(scip->set->pricers[i]),
2892  SCIPpricerGetNVarsFound(scip->set->pricers[i]));
2893  }
2894 }
2895 
2896 /** outputs branching rule statistics
2897  *
2898  * @pre This method can be called if SCIP is in one of the following stages:
2899  * - \ref SCIP_STAGE_SOLVING
2900  * - \ref SCIP_STAGE_SOLVED
2901  */
2903  SCIP* scip, /**< SCIP data structure */
2904  FILE* file /**< output file */
2905  )
2906 {
2907  int i;
2908 
2909  assert(scip != NULL);
2910  assert(scip->set != NULL);
2911 
2912  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintBranchruleStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2913 
2914  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Branching Rules : ExecTime SetupTime BranchLP BranchExt BranchPS Cutoffs DomReds Cuts Conss Children\n");
2915 
2916  /* sort branching rules w.r.t. their name */
2918 
2919  for( i = 0; i < scip->set->nbranchrules; ++i )
2920  {
2933  }
2934 }
2935 
2936 /** outputs heuristics statistics
2937  *
2938  * @pre This method can be called if SCIP is in one of the following stages:
2939  * - \ref SCIP_STAGE_PRESOLVING
2940  * - \ref SCIP_STAGE_EXITPRESOLVE
2941  * - \ref SCIP_STAGE_PRESOLVED
2942  * - \ref SCIP_STAGE_SOLVING
2943  * - \ref SCIP_STAGE_SOLVED
2944  */
2946  SCIP* scip, /**< SCIP data structure */
2947  FILE* file /**< output file */
2948  )
2949 {
2950  int ndivesets = 0;
2951  int i;
2952 
2953  assert(scip != NULL);
2954  assert(scip->set != NULL);
2955  assert(scip->tree != NULL);
2956 
2957  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintHeuristicStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2958 
2959  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Primal Heuristics : ExecTime SetupTime Calls Found Best\n");
2960  SCIPmessageFPrintInfo(scip->messagehdlr, file, " LP solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
2962  scip->stat->nlpsolsfound, scip->stat->nlpbestsolsfound);
2963  SCIPmessageFPrintInfo(scip->messagehdlr, file, " relax solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
2965  scip->stat->nrelaxsolsfound, scip->stat->nrelaxbestsolsfound);
2966  SCIPmessageFPrintInfo(scip->messagehdlr, file, " pseudo solutions : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
2968  scip->stat->npssolsfound, scip->stat->npsbestsolsfound);
2969  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f - - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
2971  scip->stat->nsbsolsfound, scip->stat->nsbbestsolsfound);
2972 
2973  /* sort heuristics w.r.t. their names */
2974  SCIPsetSortHeursName(scip->set);
2975 
2976  for( i = 0; i < scip->set->nheurs; ++i )
2977  {
2978  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
2979  SCIPheurGetName(scip->set->heurs[i]),
2980  SCIPheurGetTime(scip->set->heurs[i]),
2981  SCIPheurGetSetupTime(scip->set->heurs[i]),
2982  SCIPheurGetNCalls(scip->set->heurs[i]),
2983  SCIPheurGetNSolsFound(scip->set->heurs[i]),
2984  SCIPheurGetNBestSolsFound(scip->set->heurs[i]));
2985 
2986  /* count heuristics that use diving; needed to determine output later */
2987  ndivesets += SCIPheurGetNDivesets(scip->set->heurs[i]);
2988  }
2989 
2990  SCIPmessageFPrintInfo(scip->messagehdlr, file, " other solutions : - - - %10" SCIP_LONGINT_FORMAT " -\n",
2991  scip->stat->nexternalsolsfound);
2992 
2993  if ( ndivesets > 0 )
2994  {
2995  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Diving Statistics : Calls Nodes LP Iters Backtracks Conflicts MinDepth MaxDepth AvgDepth RoundSols NLeafSols MinSolDpt MaxSolDpt AvgSolDpt\n");
2996  for( i = 0; i < scip->set->nheurs; ++i )
2997  {
2998  int s;
2999  for( s = 0; s < SCIPheurGetNDivesets(scip->set->heurs[i]); ++s )
3000  {
3001  SCIP_DIVESET* diveset = SCIPheurGetDivesets(scip->set->heurs[i])[s];
3002  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10d", SCIPdivesetGetName(diveset), SCIPdivesetGetNCalls(diveset));
3003  if( SCIPdivesetGetNCalls(diveset) > 0 )
3004  {
3005  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10d %10d %10.1f %10" SCIP_LONGINT_FORMAT,
3006  SCIPdivesetGetNProbingNodes(diveset),
3007  SCIPdivesetGetNLPIterations(diveset),
3008  SCIPdivesetGetNBacktracks(diveset),
3009  SCIPdivesetGetNConflicts(diveset),
3010  SCIPdivesetGetMinDepth(diveset),
3011  SCIPdivesetGetMaxDepth(diveset),
3012  SCIPdivesetGetAvgDepth(diveset),
3014 
3015  if( SCIPdivesetGetNSolutionCalls(diveset) > 0 )
3016  {
3017  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10d %10d %10d %10.1f\n",
3022  }
3023  else
3024  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - -\n");
3025  }
3026  else
3027  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - - - - - - - - - - -\n");
3028  }
3029  }
3030  }
3031 }
3032 
3033 /** outputs compression statistics
3034  *
3035  * @pre This method can be called if SCIP is in one of the following stages:
3036  * - \ref SCIP_STAGE_PRESOLVING
3037  * - \ref SCIP_STAGE_EXITPRESOLVE
3038  * - \ref SCIP_STAGE_PRESOLVED
3039  * - \ref SCIP_STAGE_SOLVING
3040  * - \ref SCIP_STAGE_SOLVED
3041  */
3043  SCIP* scip, /**< SCIP data structure */
3044  FILE* file /**< output file */
3045  )
3046 {
3047  int i;
3048 
3049  assert(scip != NULL);
3050 
3051  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintCompressionStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3052 
3053  /* only print compression statistics if tree reoptimization is enabled */
3054  if( !scip->set->reopt_enable )
3055  return;
3056 
3057  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Tree Compressions : ExecTime SetupTime Calls Found\n");
3058 
3059  /* sort compressions w.r.t. their names */
3060  SCIPsetSortComprsName(scip->set);
3061 
3062  for( i = 0; i < scip->set->ncomprs; ++i )
3063  {
3064  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
3065  SCIPcomprGetName(scip->set->comprs[i]),
3066  SCIPcomprGetTime(scip->set->comprs[i]),
3067  SCIPcomprGetSetupTime(scip->set->comprs[i]),
3068  SCIPcomprGetNCalls(scip->set->comprs[i]),
3069  SCIPcomprGetNFound(scip->set->comprs[i]));
3070  }
3071 }
3072 
3073 /** outputs LP statistics
3074  *
3075  * @pre This method can be called if SCIP is in one of the following stages:
3076  * - \ref SCIP_STAGE_SOLVING
3077  * - \ref SCIP_STAGE_SOLVED
3078  */
3080  SCIP* scip, /**< SCIP data structure */
3081  FILE* file /**< output file */
3082  )
3083 {
3084  assert(scip != NULL);
3085  assert(scip->stat != NULL);
3086  assert(scip->lp != NULL);
3087 
3088  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3089 
3090  SCIPmessageFPrintInfo(scip->messagehdlr, file, "LP : Time Calls Iterations Iter/call Iter/sec Time-0-It Calls-0-It ItLimit\n");
3091 
3092  SCIPmessageFPrintInfo(scip->messagehdlr, file, " primal LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3094  scip->stat->nprimallps + scip->stat->nprimalzeroitlps,
3095  scip->stat->nprimallpiterations,
3096  scip->stat->nprimallps > 0 ? (SCIP_Real)scip->stat->nprimallpiterations/(SCIP_Real)scip->stat->nprimallps : 0.0);
3097  if( SCIPclockGetTime(scip->stat->primallptime) >= 0.01 )
3099  else
3100  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
3101  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
3102  scip->stat->primalzeroittime,
3103  scip->stat->nprimalzeroitlps);
3104 
3105  SCIPmessageFPrintInfo(scip->messagehdlr, file, " dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3107  scip->stat->nduallps + scip->stat->ndualzeroitlps,
3108  scip->stat->nduallpiterations,
3109  scip->stat->nduallps > 0 ? (SCIP_Real)scip->stat->nduallpiterations/(SCIP_Real)scip->stat->nduallps : 0.0);
3110  if( SCIPclockGetTime(scip->stat->duallptime) >= 0.01 )
3112  else
3113  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
3114  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
3115  scip->stat->dualzeroittime,
3116  scip->stat->ndualzeroitlps);
3117 
3118  SCIPmessageFPrintInfo(scip->messagehdlr, file, " lex dual LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3120  scip->stat->nlexduallps,
3121  scip->stat->nlexduallpiterations,
3122  scip->stat->nlexduallps > 0 ? (SCIP_Real)scip->stat->nlexduallpiterations/(SCIP_Real)scip->stat->nlexduallps : 0.0);
3123  if( SCIPclockGetTime(scip->stat->lexduallptime) >= 0.01 )
3125  else
3126  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
3127 
3128  SCIPmessageFPrintInfo(scip->messagehdlr, file, " barrier LP : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3130  scip->stat->nbarrierlps,
3131  scip->stat->nbarrierlpiterations,
3132  scip->stat->nbarrierlps > 0 ? (SCIP_Real)scip->stat->nbarrierlpiterations/(SCIP_Real)scip->stat->nbarrierlps : 0.0);
3133  if( SCIPclockGetTime(scip->stat->barrierlptime) >= 0.01 )
3135  else
3136  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
3137  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %10.2f %10" SCIP_LONGINT_FORMAT "\n",
3138  scip->stat->barrierzeroittime,
3139  scip->stat->nbarrierzeroitlps);
3140 
3141  SCIPmessageFPrintInfo(scip->messagehdlr, file, " resolve instable : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3143  scip->stat->nresolveinstablelps,
3146  if( SCIPclockGetTime(scip->stat->resolveinstablelptime) >= 0.01 )
3148  else
3149  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
3150 
3151  SCIPmessageFPrintInfo(scip->messagehdlr, file, " diving/probing LP: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3153  scip->stat->ndivinglps,
3154  scip->stat->ndivinglpiterations,
3155  scip->stat->ndivinglps > 0 ? (SCIP_Real)scip->stat->ndivinglpiterations/(SCIP_Real)scip->stat->ndivinglps : 0.0);
3156  if( SCIPclockGetTime(scip->stat->divinglptime) >= 0.01 )
3158  else
3159  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
3160 
3161  SCIPmessageFPrintInfo(scip->messagehdlr, file, " strong branching : %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3163  scip->stat->nstrongbranchs,
3164  scip->stat->nsblpiterations,
3165  scip->stat->nstrongbranchs > 0 ? (SCIP_Real)scip->stat->nsblpiterations/(SCIP_Real)scip->stat->nstrongbranchs : 0.0);
3166  if( SCIPclockGetTime(scip->stat->strongbranchtime) >= 0.01 )
3168  else
3169  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -");
3170  SCIPmessageFPrintInfo(scip->messagehdlr, file, " - - %10d\n", scip->stat->nsbtimesiterlimhit);
3171 
3172  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (at root node) : - %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f -\n",
3173  scip->stat->nrootstrongbranchs,
3174  scip->stat->nrootsblpiterations,
3175  scip->stat->nrootstrongbranchs > 0
3177 
3178  SCIPmessageFPrintInfo(scip->messagehdlr, file, " conflict analysis: %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10.2f",
3180  scip->stat->nconflictlps,
3181  scip->stat->nconflictlpiterations,
3182  scip->stat->nconflictlps > 0 ? (SCIP_Real)scip->stat->nconflictlpiterations/(SCIP_Real)scip->stat->nconflictlps : 0.0);
3183  if( SCIPclockGetTime(scip->stat->conflictlptime) >= 0.01 )
3185  else
3186  SCIPmessageFPrintInfo(scip->messagehdlr, file, " -\n");
3187 }
3188 
3189 /** outputs NLP statistics
3190  *
3191  * @pre This method can be called if SCIP is in one of the following stages:
3192  * - \ref SCIP_STAGE_SOLVING
3193  * - \ref SCIP_STAGE_SOLVED
3194  */
3196  SCIP* scip, /**< SCIP data structure */
3197  FILE* file /**< output file */
3198  )
3199 {
3200  assert(scip != NULL);
3201  assert(scip->stat != NULL);
3202 
3203  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintNLPStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3204 
3205  if( scip->nlp == NULL )
3206  return;
3207 
3208  SCIPmessageFPrintInfo(scip->messagehdlr, file, "NLP : Time Calls\n");
3209 
3210  SCIPmessageFPrintInfo(scip->messagehdlr, file, " all NLPs : %10.2f %10" SCIP_LONGINT_FORMAT "\n",
3212  scip->stat->nnlps);
3213 }
3214 
3215 /** outputs relaxator statistics
3216  *
3217  * @pre This method can be called if SCIP is in one of the following stages:
3218  * - \ref SCIP_STAGE_SOLVING
3219  * - \ref SCIP_STAGE_SOLVED
3220  */
3222  SCIP* scip, /**< SCIP data structure */
3223  FILE* file /**< output file */
3224  )
3225 {
3226  int i;
3227 
3228  assert(scip != NULL);
3229  assert(scip->set != NULL);
3230 
3231  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintRelaxatorStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3232 
3233  if( scip->set->nrelaxs == 0 )
3234  return;
3235 
3236  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Relaxators : Time Calls\n");
3237 
3238  /* sort relaxators w.r.t. their name */
3239  SCIPsetSortRelaxsName(scip->set);
3240 
3241  for( i = 0; i < scip->set->nrelaxs; ++i )
3242  {
3243  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10" SCIP_LONGINT_FORMAT "\n",
3244  SCIPrelaxGetName(scip->set->relaxs[i]),
3245  SCIPrelaxGetTime(scip->set->relaxs[i]),
3246  SCIPrelaxGetNCalls(scip->set->relaxs[i]));
3247  }
3248 }
3249 
3250 /** outputs tree statistics
3251  *
3252  * @pre This method can be called if SCIP is in one of the following stages:
3253  * - \ref SCIP_STAGE_SOLVING
3254  * - \ref SCIP_STAGE_SOLVED
3255  */
3257  SCIP* scip, /**< SCIP data structure */
3258  FILE* file /**< output file */
3259  )
3260 {
3261  assert(scip != NULL);
3262  assert(scip->stat != NULL);
3263  assert(scip->tree != NULL);
3264 
3265  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintTreeStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3266 
3267  SCIPmessageFPrintInfo(scip->messagehdlr, file, "B&B Tree :\n");
3268  SCIPmessageFPrintInfo(scip->messagehdlr, file, " number of runs : %10d\n", scip->stat->nruns);
3269  SCIPmessageFPrintInfo(scip->messagehdlr, file,
3270  " nodes : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
3271  scip->stat->nnodes, scip->stat->ninternalnodes, scip->stat->nnodes - scip->stat->ninternalnodes );
3272  SCIPmessageFPrintInfo(scip->messagehdlr, file, " feasible leaves : %10d\n", scip->stat->nfeasleaves);
3273  SCIPmessageFPrintInfo(scip->messagehdlr, file, " infeas. leaves : %10d\n", scip->stat->ninfeasleaves);
3274  SCIPmessageFPrintInfo(scip->messagehdlr, file, " objective leaves : %10d\n", scip->stat->nobjleaves);
3275  SCIPmessageFPrintInfo(scip->messagehdlr, file,
3276  " nodes (total) : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " internal, %" SCIP_LONGINT_FORMAT " leaves)\n",
3278  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes left : %10d\n", SCIPtreeGetNNodes(scip->tree));
3279  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth : %10d\n", scip->stat->maxdepth);
3280  SCIPmessageFPrintInfo(scip->messagehdlr, file, " max depth (total): %10d\n", scip->stat->maxtotaldepth);
3281  SCIPmessageFPrintInfo(scip->messagehdlr, file, " backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nbacktracks,
3282  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nbacktracks / (SCIP_Real)scip->stat->nnodes : 0.0);
3283  SCIPmessageFPrintInfo(scip->messagehdlr, file, " early backtracks : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nearlybacktracks,
3284  scip->stat->nbacktracks > 0 ? 100.0 * (SCIP_Real)scip->stat->nearlybacktracks / (SCIP_Real)scip->stat->nbacktracks : 0.0);
3285  SCIPmessageFPrintInfo(scip->messagehdlr, file, " nodes exc. ref. : %10" SCIP_LONGINT_FORMAT " (%.1f%%)\n", scip->stat->nnodesaboverefbound,
3286  scip->stat->nnodes > 0 ? 100.0 * (SCIP_Real)scip->stat->nnodesaboverefbound / (SCIP_Real)scip->stat->nnodes : 0.0);
3287 
3288  SCIPmessageFPrintInfo(scip->messagehdlr, file, " delayed cutoffs : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->ndelayedcutoffs);
3289  SCIPmessageFPrintInfo(scip->messagehdlr, file, " repropagations : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " domain reductions, %" SCIP_LONGINT_FORMAT " cutoffs)\n",
3290  scip->stat->nreprops, scip->stat->nrepropboundchgs, scip->stat->nrepropcutoffs);
3291  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg switch length: %10.2f\n",
3292  scip->stat->nnodes > 0
3293  ? (SCIP_Real)(scip->stat->nactivatednodes + scip->stat->ndeactivatednodes) / (SCIP_Real)scip->stat->nnodes : 0.0);
3294  SCIPmessageFPrintInfo(scip->messagehdlr, file, " switching time : %10.2f\n", SCIPclockGetTime(scip->stat->nodeactivationtime));
3295 }
3296 
3297 /** outputs solution statistics
3298  *
3299  * @pre This method can be called if SCIP is in one of the following stages:
3300  * - \ref SCIP_STAGE_PRESOLVING
3301  * - \ref SCIP_STAGE_EXITPRESOLVE
3302  * - \ref SCIP_STAGE_PRESOLVED
3303  * - \ref SCIP_STAGE_SOLVING
3304  * - \ref SCIP_STAGE_SOLVED
3305  */
3307  SCIP* scip, /**< SCIP data structure */
3308  FILE* file /**< output file */
3309  )
3310 {
3311  SCIP_Real primalbound;
3312  SCIP_Real dualbound;
3313  SCIP_Real gap;
3314  SCIP_Real firstprimalbound;
3315  SCIP_Bool objlimitreached;
3316  char limsolstring[SCIP_MAXSTRLEN];
3317 
3318  assert(scip != NULL);
3319  assert(scip->stat != NULL);
3320  assert(scip->primal != NULL);
3321 
3322  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintSolutionStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3323 
3324  primalbound = SCIPgetPrimalbound(scip);
3325  dualbound = SCIPgetDualbound(scip);
3326  gap = SCIPgetGap(scip);
3327 
3328  /* We output that the objective limit has been reached if the problem has been solved, no solution respecting the
3329  * objective limit has been found (nlimsolsfound == 0) and the primal bound is finite. Note that it still might be
3330  * that the original problem is infeasible, even without the objective limit, i.e., we cannot be sure that we
3331  * actually reached the objective limit. */
3332  objlimitreached = FALSE;
3333  if( SCIPgetStage(scip) == SCIP_STAGE_SOLVED && scip->primal->nlimsolsfound == 0 && !SCIPisInfinity(scip, primalbound) )
3334  objlimitreached = TRUE;
3335 
3336  if( scip->primal->nsolsfound != scip->primal->nlimsolsfound )
3337  (void) SCIPsnprintf(limsolstring, SCIP_MAXSTRLEN, ", %" SCIP_LONGINT_FORMAT " respecting the objective limit", scip->primal->nlimsolsfound);
3338  else
3339  limsolstring[0] = '\0';
3340 
3341  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Solution :\n");
3342  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Solutions found : %10" SCIP_LONGINT_FORMAT " (%" SCIP_LONGINT_FORMAT " improvements%s)\n",
3343  scip->primal->nsolsfound, scip->primal->nbestsolsfound, limsolstring);
3344 
3345  if( SCIPsetIsInfinity(scip->set, REALABS(primalbound)) )
3346  {
3347  if( scip->set->stage == SCIP_STAGE_SOLVED )
3348  {
3349  if( scip->primal->nlimsolsfound == 0 )
3350  {
3351  if( SCIPgetStatus(scip) == SCIP_STATUS_INFORUNBD )
3352  {
3353  assert(!objlimitreached);
3354  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible or unbounded\n");
3355  }
3356  else
3357  {
3358  assert(SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE);
3359  if( objlimitreached )
3360  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible (objective limit reached)\n");
3361  else
3362  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : infeasible\n");
3363  }
3364  }
3365  else
3366  {
3367  assert(!objlimitreached);
3368  assert(SCIPgetStatus(scip) == SCIP_STATUS_UNBOUNDED);
3369  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : unbounded\n");
3370  }
3371  }
3372  else
3373  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : -\n");
3374  }
3375  else
3376  {
3377  if( scip->primal->nlimsolsfound == 0 )
3378  {
3379  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e (objective limit)\n", primalbound);
3380 
3381  /* display (best) primal bound */
3382  if( scip->primal->nsolsfound > 0 )
3383  {
3384  SCIP_Real bestsol;
3385  bestsol = SCIPsolGetObj(scip->primal->sols[0], scip->set, scip->transprob, scip->origprob);
3386  bestsol = SCIPretransformObj(scip, bestsol);
3387 
3388  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Best Solution : %+21.14e\n", bestsol);
3389  }
3390  }
3391  else
3392  {
3393  /* display first primal bound line */
3394  firstprimalbound = scip->stat->firstprimalbound;
3395  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First Solution : %+21.14e", firstprimalbound);
3396 
3397  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
3398  scip->stat->nrunsbeforefirst,
3399  scip->stat->nnodesbeforefirst,
3400  scip->stat->firstprimaltime,
3401  scip->stat->firstprimaldepth,
3402  ( scip->stat->firstprimalheur != NULL )
3403  ? ( SCIPheurGetName(scip->stat->firstprimalheur) )
3404  : (( scip->stat->nrunsbeforefirst == 0 ) ? "initial" : "relaxation"));
3405 
3406  if( SCIPisInfinity(scip, scip->stat->firstsolgap) )
3407  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : infinite\n");
3408  else
3409  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap First Sol. : %10.2f %%\n", 100.0 * scip->stat->firstsolgap);
3410 
3411  if( SCIPisInfinity(scip, scip->stat->lastsolgap) )
3412  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : infinite\n");
3413  else
3414  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap Last Sol. : %10.2f %%\n", 100.0 * scip->stat->lastsolgap);
3415 
3416  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Primal Bound : %+21.14e", primalbound);
3417 
3418  SCIPmessageFPrintInfo(scip->messagehdlr, file, " (in run %d, after %" SCIP_LONGINT_FORMAT " nodes, %.2f seconds, depth %d, found by <%s>)\n",
3419  SCIPsolGetRunnum(scip->primal->sols[0]),
3420  SCIPsolGetNodenum(scip->primal->sols[0]),
3421  SCIPsolGetTime(scip->primal->sols[0]),
3422  SCIPsolGetDepth(scip->primal->sols[0]),
3423  SCIPsolGetHeur(scip->primal->sols[0]) != NULL
3425  : (SCIPsolGetRunnum(scip->primal->sols[0]) == 0 ? "initial" : "relaxation"));
3426  }
3427  }
3428 
3429  if( SCIPsetIsInfinity(scip->set, REALABS(dualbound)) )
3430  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : -\n");
3431  else
3432  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Dual Bound : %+21.14e\n", dualbound);
3433 
3434  if( SCIPsetIsInfinity(scip->set, gap) )
3435  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : infinite\n");
3436  else
3437  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Gap : %10.2f %%\n", 100.0 * gap);
3438 
3439  if( scip->set->misc_calcintegral )
3440  {
3441  if( SCIPgetStatus(scip) == SCIP_STATUS_INFEASIBLE && ! objlimitreached )
3442  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (problem infeasible)\n");
3443  else
3444  {
3445  SCIP_Real avggap;
3446  SCIP_Real primaldualintegral;
3447 
3448  if( !SCIPisFeasZero(scip, SCIPgetSolvingTime(scip)) )
3449  {
3450  primaldualintegral = SCIPstatGetPrimalDualIntegral(scip->stat, scip->set, scip->transprob, scip->origprob);
3451  avggap = primaldualintegral/SCIPgetSolvingTime(scip);
3452  }
3453  else
3454  {
3455  avggap = 0.0;
3456  primaldualintegral = 0.0;
3457  }
3458 
3459  /* caution: this assert is non-deterministic since it depends on the solving time */
3460  assert(0.0 <= avggap && SCIPisLE(scip, avggap, 100.0));
3461 
3462  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : %10.2f %% (%.2f primal-dual integral)\n",
3463  avggap, primaldualintegral);
3464  }
3465  }
3466  else
3467  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Avg. Gap : - (not evaluated)\n");
3468 }
3469 
3470 /** outputs concurrent solver statistics
3471  *
3472  * @pre This method can be called if SCIP is in one of the following stages:
3473  * - \ref SCIP_STAGE_TRANSFORMED
3474  * - \ref SCIP_STAGE_INITPRESOLVE
3475  * - \ref SCIP_STAGE_PRESOLVING
3476  * - \ref SCIP_STAGE_EXITPRESOLVE
3477  * - \ref SCIP_STAGE_PRESOLVED
3478  * - \ref SCIP_STAGE_SOLVING
3479  * - \ref SCIP_STAGE_SOLVED
3480  */
3482  SCIP* scip, /**< SCIP data structure */
3483  FILE* file /**< output file */
3484  )
3485 {
3486  SCIP_CONCSOLVER** concsolvers;
3487  int nconcsolvers;
3488  int i;
3489  int winner;
3490 
3491  assert(scip != NULL);
3492  assert(scip->set != NULL);
3493 
3494  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintConcsolverStatistics", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3495 
3497  return;
3498 
3499  nconcsolvers = SCIPgetNConcurrentSolvers(scip);
3500  concsolvers = SCIPgetConcurrentSolvers(scip);
3501  winner = SCIPsyncstoreGetWinner(scip->syncstore);
3502 
3503  if( nconcsolvers > 0 )
3504  {
3505  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Concurrent Solvers : SolvingTime SyncTime Nodes LP Iters SolsShared SolsRecvd TighterBnds TighterIntBnds\n");
3506  for( i = 0; i < nconcsolvers; ++i )
3507  {
3508  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",
3509  winner == i ? '*' : ' ',
3510  SCIPconcsolverGetName(concsolvers[i]),
3511  SCIPconcsolverGetSolvingTime(concsolvers[i]),
3512  SCIPconcsolverGetSyncTime(concsolvers[i]),
3513  SCIPconcsolverGetNNodes(concsolvers[i]),
3514  SCIPconcsolverGetNLPIterations(concsolvers[i]),
3515  SCIPconcsolverGetNSolsShared(concsolvers[i]),
3516  SCIPconcsolverGetNSolsRecvd(concsolvers[i]),
3517  SCIPconcsolverGetNTighterBnds(concsolvers[i]),
3518  SCIPconcsolverGetNTighterIntBnds(concsolvers[i])
3519  );
3520  }
3521  }
3522 }
3523 
3524 /** display Benders' decomposition statistics */
3526  SCIP* scip, /**< SCIP data structure */
3527  FILE* file /**< output file */
3528  )
3529 {
3530  SCIP_BENDERS** benders;
3531  int nbenders;
3532  int i;
3533 
3534  assert(scip != NULL);
3535  assert(scip->set != NULL);
3536 
3537  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintBendersStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3538 
3539  if( SCIPgetNActiveBenders(scip) == 0 )
3540  return;
3541 
3542  nbenders = SCIPgetNBenders(scip);
3543  benders = SCIPgetBenders(scip);
3544 
3545  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Benders Decomp : ExecTime SetupTime Calls Found Transfer\n");
3546  for( i = 0; i < nbenders; ++i )
3547  {
3548  if( SCIPbendersIsActive(benders[i]) )
3549  {
3550  SCIP_BENDERSCUT** benderscuts;
3551  int nbenderscuts;
3552  int j;
3553 
3554  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-17.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT "\n",
3555  SCIPbendersGetName(scip->set->benders[i]),
3556  SCIPbendersGetTime(scip->set->benders[i]),
3557  SCIPbendersGetSetupTime(scip->set->benders[i]),
3558  SCIPbendersGetNCalls(scip->set->benders[i]),
3561 
3562  nbenderscuts = SCIPbendersGetNBenderscuts(scip->set->benders[i]);
3563  benderscuts = SCIPbendersGetBenderscuts(scip->set->benders[i]);
3564 
3565  for( j = 0; j < nbenderscuts; j++ )
3566  {
3567  SCIPmessageFPrintInfo(scip->messagehdlr, file, " %-15.17s: %10.2f %10.2f %10" SCIP_LONGINT_FORMAT " %10" SCIP_LONGINT_FORMAT " -\n",
3568  SCIPbenderscutGetName(benderscuts[j]),
3569  SCIPbenderscutGetTime(benderscuts[j]),
3570  SCIPbenderscutGetSetupTime(benderscuts[j]),
3571  SCIPbenderscutGetNCalls(benderscuts[j]),
3572  SCIPbenderscutGetNFound(benderscuts[j]));
3573  }
3574  }
3575  }
3576 }
3577 
3578 /** outputs root statistics
3579  *
3580  * @pre This method can be called if SCIP is in one of the following stages:
3581  * - \ref SCIP_STAGE_SOLVING
3582  * - \ref SCIP_STAGE_SOLVED
3583  */
3585  SCIP* scip, /**< SCIP data structure */
3586  FILE* file /**< output file */
3587  )
3588 {
3589  SCIP_Real dualboundroot;
3590  SCIP_Real firstdualboundroot;
3591  SCIP_Real firstlptime;
3592  SCIP_Real firstlpspeed;
3593 
3594  assert(scip != NULL);
3595  assert(scip->stat != NULL);
3596  assert(scip->primal != NULL);
3597 
3598  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintRootStatistics", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3599 
3600  dualboundroot = SCIPgetDualboundRoot(scip);
3601  firstdualboundroot = SCIPgetFirstLPDualboundRoot(scip);
3602  firstlptime = SCIPgetFirstLPTime(scip);
3603 
3604  if( firstlptime > 0.0 )
3605  firstlpspeed = (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime;
3606  else
3607  firstlpspeed = 0.0;
3608 
3609  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Root Node :\n");
3610  if( SCIPsetIsInfinity(scip->set, REALABS(firstdualboundroot)) )
3611  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : -\n");
3612  else
3613  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP value : %+21.14e\n", firstdualboundroot);
3614  if( firstlpspeed > 0.0 )
3615  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT " (%.2f Iter/sec)\n",
3617  (SCIP_Real)scip->stat->nrootfirstlpiterations/firstlptime);
3618  else
3619  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootfirstlpiterations);
3620  SCIPmessageFPrintInfo(scip->messagehdlr, file, " First LP Time : %10.2f\n", firstlptime);
3621 
3622  if( SCIPsetIsInfinity(scip->set, REALABS(dualboundroot)) )
3623  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : -\n");
3624  else
3625  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Dual Bound : %+21.14e\n", dualboundroot);
3626  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Final Root Iters : %10" SCIP_LONGINT_FORMAT "\n", scip->stat->nrootlpiterations);
3627 
3628  SCIPmessageFPrintInfo(scip->messagehdlr, file, " Root LP Estimate : ");
3629  if( scip->stat->rootlpbestestimate != SCIP_INVALID ) /*lint !e777*/
3630  {
3631  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%+21.14e\n", SCIPretransformObj(scip, scip->stat->rootlpbestestimate));
3632  }
3633  else
3634  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%21s\n","-");
3635 }
3636 
3637 /** outputs timing statistics
3638  *
3639  * @pre This method can be called if SCIP is in one of the following stages:
3640  * - \ref SCIP_STAGE_PROBLEM
3641  * - \ref SCIP_STAGE_TRANSFORMED
3642  * - \ref SCIP_STAGE_INITPRESOLVE
3643  * - \ref SCIP_STAGE_PRESOLVING
3644  * - \ref SCIP_STAGE_EXITPRESOLVE
3645  * - \ref SCIP_STAGE_PRESOLVED
3646  * - \ref SCIP_STAGE_SOLVING
3647  * - \ref SCIP_STAGE_SOLVED
3648  */
3650  SCIP* scip, /**< SCIP data structure */
3651  FILE* file /**< output file */
3652  )
3653 {
3654  SCIP_Real readingtime;
3655 
3656  assert(scip != NULL);
3657  assert(scip->set != NULL);
3658 
3659  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPprintTimingStatistics", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3660 
3661  readingtime = SCIPgetReadingTime(scip);
3662 
3663  if( SCIPgetStage(scip) == SCIP_STAGE_PROBLEM )
3664  {
3665  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", readingtime);
3666  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f\n", readingtime);
3667  }
3668  else
3669  {
3670  SCIP_Real totaltime;
3671  SCIP_Real solvingtime;
3672 
3673  solvingtime = SCIPclockGetTime(scip->stat->solvingtime);
3674 
3675  if( scip->set->time_reading )
3676  totaltime = solvingtime;
3677  else
3678  totaltime = solvingtime + readingtime;
3679 
3680  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Total Time : %10.2f\n", totaltime);
3681  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solvingtime);
3682  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", SCIPclockGetTime(scip->stat->presolvingtime));
3683  SCIPmessageFPrintInfo(scip->messagehdlr, file, " reading : %10.2f%s\n", readingtime, scip->set->time_reading ? " (included in solving)" : "");
3684 
3685  if( scip->stat->ncopies > 0 )
3686  {
3687  SCIP_Real copytime;
3688 
3689  copytime = SCIPclockGetTime(scip->stat->copyclock);
3690 
3691  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f (%d #copies) (minimal %.2f, maximal %.2f, average %.2f)\n",
3692  copytime, scip->stat->ncopies, scip->stat->mincopytime, scip->stat->maxcopytime, copytime / scip->stat->ncopies);
3693  }
3694  else
3695  SCIPmessageFPrintInfo(scip->messagehdlr, file, " copying : %10.2f %s\n", 0.0, "(0 times copied the problem)");
3696  }
3697 }
3698 
3699 /** comparison method for statistics tables */
3700 static
3702 { /*lint --e{715}*/
3703  return (SCIPtableGetPosition((SCIP_TABLE*)elem1) - (SCIPtableGetPosition((SCIP_TABLE*)elem2)));
3704 }
3705 
3706 /** outputs solving statistics
3707  *
3708  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3709  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3710  *
3711  * @note If limits have been changed between the solution and the call to this function, the status is recomputed and
3712  * thus may to correspond to the original status.
3713  *
3714  * @pre This method can be called if SCIP is in one of the following stages:
3715  * - \ref SCIP_STAGE_INIT
3716  * - \ref SCIP_STAGE_PROBLEM
3717  * - \ref SCIP_STAGE_TRANSFORMED
3718  * - \ref SCIP_STAGE_INITPRESOLVE
3719  * - \ref SCIP_STAGE_PRESOLVING
3720  * - \ref SCIP_STAGE_EXITPRESOLVE
3721  * - \ref SCIP_STAGE_PRESOLVED
3722  * - \ref SCIP_STAGE_SOLVING
3723  * - \ref SCIP_STAGE_SOLVED
3724  */
3726  SCIP* scip, /**< SCIP data structure */
3727  FILE* file /**< output file (or NULL for standard output) */
3728  )
3729 {
3730  SCIP_TABLE** tables;
3731  int ntables;
3732  int i;
3733 
3734  assert(scip != NULL);
3735  assert(scip->set != NULL);
3736 
3737  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3738 
3739  ntables = SCIPgetNTables(scip);
3740  tables = SCIPgetTables(scip);
3741 
3742  /* sort all tables by position unless this has already been done */
3743  if( ! scip->set->tablessorted )
3744  {
3745  SCIPsortPtr((void**)tables, tablePosComp, ntables);
3746 
3747  scip->set->tablessorted = TRUE;
3748  }
3749 
3750  for( i = 0; i < ntables; ++i )
3751  {
3752  /* skip tables which are not active or only used in later stages */
3753  if( ( ! SCIPtableIsActive(tables[i]) ) || SCIPtableGetEarliestStage(tables[i]) > SCIPgetStage(scip) )
3754  continue;
3755 
3756  SCIP_CALL( SCIPtableOutput(tables[i], scip->set, file) );
3757  }
3758 
3759  return SCIP_OKAY;
3760 }
3761 
3762 /** outputs reoptimization statistics
3763  *
3764  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3765  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3766  *
3767  * @pre This method can be called if SCIP is in one of the following stages:
3768  * - \ref SCIP_STAGE_INIT
3769  * - \ref SCIP_STAGE_PROBLEM
3770  * - \ref SCIP_STAGE_TRANSFORMED
3771  * - \ref SCIP_STAGE_INITPRESOLVE
3772  * - \ref SCIP_STAGE_PRESOLVING
3773  * - \ref SCIP_STAGE_EXITPRESOLVE
3774  * - \ref SCIP_STAGE_PRESOLVED
3775  * - \ref SCIP_STAGE_SOLVING
3776  * - \ref SCIP_STAGE_SOLVED
3777  */
3779  SCIP* scip, /**< SCIP data structure */
3780  FILE* file /**< output file (or NULL for standard output) */
3781  )
3782 {
3783  SCIP_Real solving;
3784  SCIP_Real presolving;
3785  SCIP_Real updatetime;
3786 
3787  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintReoptStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3788 
3789  /* skip if reoptimization is disabled */
3790  if( !scip->set->reopt_enable )
3791  return SCIP_OKAY;
3792 
3793  solving = SCIPclockGetTime(scip->stat->solvingtimeoverall);
3794  presolving = SCIPclockGetTime(scip->stat->presolvingtimeoverall);
3795  updatetime = SCIPclockGetTime(scip->stat->reoptupdatetime);
3796 
3797  SCIPmessageFPrintInfo(scip->messagehdlr, file, "SCIP Reopt Status : finish after %d runs.\n", scip->stat->nreoptruns);
3798  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Time (sec) :\n");
3799  SCIPmessageFPrintInfo(scip->messagehdlr, file, " solving : %10.2f\n", solving);
3800  SCIPmessageFPrintInfo(scip->messagehdlr, file, " presolving : %10.2f (included in solving)\n", presolving);
3801  SCIPmessageFPrintInfo(scip->messagehdlr, file, " save time : %10.2f\n", SCIPreoptGetSavingtime(scip->reopt));
3802  SCIPmessageFPrintInfo(scip->messagehdlr, file, " update time : %10.2f\n", updatetime);
3803  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Nodes : feas infeas pruned cutoff\n");
3804  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d %10d %10d\n",
3807  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : %10.2f %10.2f %10.2f %10.2f\n",
3812 
3813  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Restarts : global local\n");
3814  SCIPmessageFPrintInfo(scip->messagehdlr, file, " first : %10d --\n", SCIPreoptGetFirstRestarts(scip->reopt));
3815  SCIPmessageFPrintInfo(scip->messagehdlr, file, " last : %10d --\n", SCIPreoptGetLastRestarts(scip->reopt));
3816  SCIPmessageFPrintInfo(scip->messagehdlr, file, " total : %10d %10d\n", SCIPreoptGetNRestartsGlobal(scip->reopt),
3818  SCIPmessageFPrintInfo(scip->messagehdlr, file, " avg : -- %10.2f\n",
3820 
3821  return SCIP_OKAY;
3822 }
3823 
3824 /** outputs history statistics about branchings on variables
3825  *
3826  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3827  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3828  *
3829  * @pre This method can be called if SCIP is in one of the following stages:
3830  * - \ref SCIP_STAGE_INIT
3831  * - \ref SCIP_STAGE_PROBLEM
3832  * - \ref SCIP_STAGE_TRANSFORMED
3833  * - \ref SCIP_STAGE_INITPRESOLVE
3834  * - \ref SCIP_STAGE_PRESOLVING
3835  * - \ref SCIP_STAGE_EXITPRESOLVE
3836  * - \ref SCIP_STAGE_PRESOLVED
3837  * - \ref SCIP_STAGE_SOLVING
3838  * - \ref SCIP_STAGE_SOLVED
3839  */
3841  SCIP* scip, /**< SCIP data structure */
3842  FILE* file /**< output file (or NULL for standard output) */
3843  )
3844 {
3845  SCIP_VAR** vars;
3846  int totalnstrongbranchs;
3847  int v;
3848 
3849  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintBranchingStatistics", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3850 
3851  switch( scip->set->stage )
3852  {
3853  case SCIP_STAGE_INIT:
3854  case SCIP_STAGE_PROBLEM:
3855  SCIPmessageFPrintInfo(scip->messagehdlr, file, "problem not yet solved. branching statistics not available.\n");
3856  return SCIP_OKAY;
3857 
3860  case SCIP_STAGE_PRESOLVING:
3862  case SCIP_STAGE_PRESOLVED:
3863  case SCIP_STAGE_SOLVING:
3864  case SCIP_STAGE_SOLVED:
3865  SCIP_CALL( SCIPallocBufferArray(scip, &vars, scip->transprob->nvars) );
3866  for( v = 0; v < scip->transprob->nvars; ++v )
3867  {
3868  SCIP_VAR* var;
3869  int i;
3870 
3871  var = scip->transprob->vars[v];
3872  for( i = v; i > 0 && strcmp(SCIPvarGetName(var), SCIPvarGetName(vars[i-1])) < 0; i-- )
3873  vars[i] = vars[i-1];
3874  vars[i] = var;
3875  }
3876 
3877  SCIPmessageFPrintInfo(scip->messagehdlr, file, " locks branchings inferences cutoffs LP gain pscostcount gain variance \n");
3878  SCIPmessageFPrintInfo(scip->messagehdlr, file, "variable prio factor down up depth down up sb down up down up down up down up down up\n");
3879 
3880  totalnstrongbranchs = 0;
3881  for( v = 0; v < scip->transprob->nvars; ++v )
3882  {
3885  || SCIPgetVarNStrongbranchs(scip, vars[v]) > 0 )
3886  {
3887  int nstrongbranchs;
3888 
3889  nstrongbranchs = SCIPgetVarNStrongbranchs(scip, vars[v]);
3890  totalnstrongbranchs += nstrongbranchs;
3891  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",
3892  SCIPvarGetName(vars[v]),
3893  SCIPvarGetBranchPriority(vars[v]),
3894  SCIPvarGetBranchFactor(vars[v]),
3898  + SCIPvarGetAvgBranchdepth(vars[v], SCIP_BRANCHDIR_UPWARDS))/2.0 - 1.0,
3901  nstrongbranchs,
3904  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_DOWNWARDS),
3905  100.0 * SCIPvarGetAvgCutoffs(vars[v], scip->stat, SCIP_BRANCHDIR_UPWARDS),
3906  SCIPvarGetPseudocost(vars[v], scip->stat, -1.0),
3907  SCIPvarGetPseudocost(vars[v], scip->stat, +1.0),
3912  }
3913  }
3914  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",
3917  totalnstrongbranchs,
3936 
3937  SCIPfreeBufferArray(scip, &vars);
3938 
3939  return SCIP_OKAY;
3940 
3941  default:
3942  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
3943  return SCIP_INVALIDCALL;
3944  } /*lint !e788*/
3945 }
3946 
3947 /** outputs node information display line
3948  *
3949  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3950  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3951  *
3952  * @pre This method can be called if SCIP is in one of the following stages:
3953  * - \ref SCIP_STAGE_SOLVING
3954  */
3956  SCIP* scip, /**< SCIP data structure */
3957  FILE* file, /**< output file (or NULL for standard output) */
3958  SCIP_VERBLEVEL verblevel, /**< minimal verbosity level to actually display the information line */
3959  SCIP_Bool endline /**< should the line be terminated with a newline symbol? */
3960  )
3961 {
3962  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintDisplayLine", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
3963 
3964  if( (SCIP_VERBLEVEL)scip->set->disp_verblevel >= verblevel )
3965  {
3966  SCIP_CALL( SCIPdispPrintLine(scip->set, scip->messagehdlr, scip->stat, file, TRUE, endline) );
3967  }
3968 
3969  return SCIP_OKAY;
3970 }
3971 
3972 /** gets total number of implications between variables that are stored in the implication graph
3973  *
3974  * @return the total number of implications between variables that are stored in the implication graph
3975  *
3976  * @pre This method can be called if SCIP is in one of the following stages:
3977  * - \ref SCIP_STAGE_INITPRESOLVE
3978  * - \ref SCIP_STAGE_PRESOLVING
3979  * - \ref SCIP_STAGE_EXITPRESOLVE
3980  * - \ref SCIP_STAGE_PRESOLVED
3981  * - \ref SCIP_STAGE_INITSOLVE
3982  * - \ref SCIP_STAGE_SOLVING
3983  * - \ref SCIP_STAGE_SOLVED
3984  */
3986  SCIP* scip /**< SCIP data structure */
3987  )
3988 {
3989  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNImplications", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
3990 
3991  return scip->stat->nimplications;
3992 }
3993 
3994 /** stores conflict graph of binary variables' implications into a file, which can be used as input for the DOT tool
3995  *
3996  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
3997  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
3998  *
3999  * @pre This method can be called if SCIP is in one of the following stages:
4000  * - \ref SCIP_STAGE_TRANSFORMED
4001  * - \ref SCIP_STAGE_INITPRESOLVE
4002  * - \ref SCIP_STAGE_PRESOLVING
4003  * - \ref SCIP_STAGE_EXITPRESOLVE
4004  * - \ref SCIP_STAGE_PRESOLVED
4005  * - \ref SCIP_STAGE_INITSOLVE
4006  * - \ref SCIP_STAGE_SOLVING
4007  * - \ref SCIP_STAGE_SOLVED
4008  * - \ref SCIP_STAGE_EXITSOLVE
4009  *
4010  * @deprecated because binary implications are now stored as cliques, please use SCIPwriteCliqueGraph() instead
4011  *
4012  */
4014  SCIP* scip, /**< SCIP data structure */
4015  const char* filename /**< file name, or NULL for stdout */
4016  )
4017 { /*lint --e{715}*/
4018  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");
4019 
4020  return SCIP_OKAY;
4021 }
4022 
4023 /** update statistical information when a new solution was found */
4025  SCIP* scip /**< SCIP data structure */
4026  )
4027 {
4029 
4030  if( scip->primal->nsols == 1 )
4031  scip->stat->firstsolgap = scip->stat->lastsolgap;
4032 
4033  if( scip->set->stage == SCIP_STAGE_SOLVING && scip->set->misc_calcintegral )
4034  {
4036  }
4037 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_Real SCIPhistoryGetAvgConflictlength(SCIP_HISTORY *history, SCIP_BRANCHDIR dir)
Definition: history.c:554
SCIP_Real cutoffbound
Definition: struct_primal.h:46
SCIP_Longint SCIPbranchruleGetNConssFound(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2142
SCIP_Longint nlexduallps
Definition: struct_stat.h:182
SCIP_EXPORT SCIP_Real SCIPsepaGetSetupTime(SCIP_SEPA *sepa)
Definition: sepa.c:793
SCIP_Longint nprimallps
Definition: struct_stat.h:178
SCIP_Longint SCIPconflictGetNStrongbranchSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8733
SCIP_STAT * stat
Definition: struct_scip.h:69
int SCIPpresolGetNDelConss(SCIP_PRESOL *presol)
Definition: presol.c:757
void SCIPsetSortPropsName(SCIP_SET *set)
Definition: set.c:4272
SCIP_Longint ndualresolvelpiterations
Definition: struct_stat.h:61
int SCIPpropGetNAddConss(SCIP_PROP *prop)
Definition: prop.c:1216
SCIP_Longint SCIPgetNStrongbranchs(SCIP *scip)
SCIP_Longint SCIPgetNSolsFound(SCIP *scip)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
Definition: heur.c:1380
SCIP_EXPORT const char * SCIPreaderGetName(SCIP_READER *reader)
Definition: reader.c:547
SCIP_Longint SCIPbranchruleGetNLPCalls(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2090
SCIP_Real SCIPcomprGetSetupTime(SCIP_COMPR *compr)
Definition: compr.c:530
SCIP_Longint SCIPconflictGetNLocalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:3650
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5953
SCIP_Longint ninfeasleaves
Definition: struct_stat.h:77
SCIP_Real firstlpdualbound
Definition: struct_stat.h:118
void SCIPprintConflictStatistics(SCIP *scip, FILE *file)
#define NULL
Definition: def.h:253
SCIP_RETCODE SCIPprintDisplayLine(SCIP *scip, FILE *file, SCIP_VERBLEVEL verblevel, SCIP_Bool endline)
SCIP_Longint SCIPconflictGetNPropConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:5585
SCIP_Bool SCIPconshdlrNeedsCons(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:5107
SCIP_READER ** readers
Definition: struct_set.h:68
SCIP_Longint nnodelpiterations
Definition: struct_stat.h:63
SCIP_EXPORT SCIP_Bool SCIPtableIsActive(SCIP_TABLE *table)
Definition: table.c:339
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
Definition: heur.c:1390
SCIP_Longint nlpsolsfound
Definition: struct_stat.h:92
internal methods for storing primal CIP solutions
SCIP_Longint SCIPbenderscutGetNCalls(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:549
const char * SCIPheurGetName(SCIP_HEUR *heur)
Definition: heur.c:1254
SCIP_Longint nlpiterations
Definition: struct_stat.h:53
public methods for branching and inference history structure
SCIP_RETCODE SCIPprintStage(SCIP *scip, FILE *file)
Definition: scip_general.c:377
SCIP_Real SCIPpricerGetSetupTime(SCIP_PRICER *pricer)
Definition: pricer.c:652
internal methods for branch and bound tree
SCIP_Real SCIPpropGetSetupTime(SCIP_PROP *prop)
Definition: prop.c:1024
SCIP_Longint nfeasleaves
Definition: struct_stat.h:76
SCIP_CONFLICT * conflict
Definition: struct_scip.h:85
SCIP_Real SCIPconshdlrGetSepaTime(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4687
SCIP_EXPORT SCIP_Real SCIPsepaGetTime(SCIP_SEPA *sepa)
Definition: sepa.c:803
SCIP_Longint ndeactivatednodes
Definition: struct_stat.h:84
SCIP_Longint SCIPconflictGetNPropSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:5575
SCIP_Longint SCIPpropGetNRespropCalls(SCIP_PROP *prop)
Definition: prop.c:1096
int SCIPgetNConcurrentSolvers(SCIP *scip)
Definition: concurrent.c:107
SCIP_EXPORT int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
Definition: var.c:3241
public methods for memory management
SCIP_Real SCIPgetAvgInferences(SCIP *scip, SCIP_BRANCHDIR dir)
int npricerounds
Definition: struct_stat.h:216
int SCIPpricestoreGetNVars(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:602
SCIP_Longint SCIPbranchruleGetNChildren(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:2162
SCIP_STATUS SCIPgetStatus(SCIP *scip)
Definition: scip_general.c:466
SCIP_Longint SCIPconshdlrGetNChildren(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4907
int SCIPgetNCutsApplied(SCIP *scip)
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8359
int SCIPpricestoreGetNProbvarsFound(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:644
SCIP_Longint SCIPgetNDualResolveLPIterations(SCIP *scip)
SCIP_BENDERS ** SCIPgetBenders(SCIP *scip)
Definition: scip_benders.c:470
SCIP_RETCODE SCIPdispPrintLine(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, FILE *file, SCIP_Bool forcedisplay, SCIP_Bool endline)
Definition: disp.c:405
SCIP_Longint nlps
Definition: struct_stat.h:176
SCIP_Longint SCIPconflictGetNAppliedGlobalConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:3630
SCIP_Longint nbarrierlpiterations
Definition: struct_stat.h:59
SCIP_Real SCIPpricestoreGetProbPricingTime(SCIP_PRICESTORE *pricestore)
Definition: pricestore.c:624
SCIP_Longint SCIPconflictGetNBoundexceedingLPIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:8399
SCIP_CLOCK * conflictlptime
Definition: struct_stat.h:155
int nrunsbeforefirst
Definition: struct_stat.h:254
#define SCIP_MAXSTRLEN
Definition: def.h:274
SCIP_RETCODE SCIPwriteImplicationConflictGraph(SCIP *scip, const char *filename)
SCIP_Real SCIPbenderscutGetSetupTime(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:579
const char * SCIPbranchruleGetName(SCIP_BRANCHRULE *branchrule)
Definition: branch.c:1970
SCIP_Real rootlowerbound
Definition: struct_stat.h:119
SCIP_Longint SCIPconshdlrGetNEnfoPSCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4787
SCIP_EXPORT SCIP_Longint SCIPvarGetNBranchings(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Definition: var.c:15187
SCIP_Longint SCIPgetNFeasibleLeaves(SCIP *scip)
SCIP_Longint SCIPconshdlrGetNEnfoRelaxCalls(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4797
SCIP_Longint SCIPconflictGetNPseudoReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:9010
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip_message.c:122
internal methods for clocks and timing issues
SCIP_Longint ntotalnodes
Definition: struct_stat.h:78
SCIP_Real SCIPgetAvgLowerbound(SCIP *scip)
SCIP_Longint SCIPconflictGetNGlobalChgBds(SCIP_CONFLICT *conflict)
Definition: conflict.c:3620
int SCIPpricerGetNVarsFound(SCIP_PRICER *pricer)
Definition: pricer.c:642
SCIP_EXPORT SCIP_Real SCIPvarGetBranchFactor(SCIP_VAR *var)
Definition: var.c:17512
int SCIPgetNConflictConssFoundNode(SCIP *scip)
SCIP_Longint nrootfirstlpiterations
Definition: struct_stat.h:55
int nprops
Definition: struct_set.h:112
SCIP_Longint SCIPconflictGetNPseudoConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8990
SCIP_EXPORT int SCIPreoptGetNTotalPrunedNodes(SCIP_REOPT *reopt)
Definition: reopt.c:4984
SCIP_Longint ndivinglps
Definition: struct_stat.h:190
int SCIPconshdlrGetNChgBds(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4967
SCIP_Longint SCIPconflictGetNInfeasibleLPSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8269
static SCIP_DECL_SORTPTRCOMP(tablePosComp)
void SCIPsetSortComprsName(SCIP_SET *set)
Definition: set.c:4551
SCIP_EVENTQUEUE * eventqueue
Definition: struct_scip.h:78
SCIP_Longint nsbtimesiterlimhit
Definition: struct_stat.h:112
void SCIPprintLPStatistics(SCIP *scip, FILE *file)
SCIP_EXPORT SCIP_Longint SCIPsepaGetNCutsFound(SCIP_SEPA *sepa)
Definition: sepa.c:843
SCIP_Longint SCIPconflictGetNPropCalls(SCIP_CONFLICT *conflict)
Definition: conflict.c:5565
SCIP_Longint SCIPconflictGetNDualrayInfSuccess(SCIP_CONFLICT *conflict)
Definition: conflict.c:8663
SCIP_Real SCIPgetGap(SCIP *scip)
SCIP_EXPORT int SCIPreoptGetNTotalCutoffReoptnodes(SCIP_REOPT *reopt)
Definition: reopt.c:5004
int nintvars
Definition: struct_prob.h:63
SCIP_Longint SCIPdivesetGetNLPIterations(SCIP_DIVESET *diveset)
Definition: heur.c:468
public methods for timing
SCIP_PRIMAL * primal
Definition: struct_scip.h:83
SCIP_Longint SCIPgetNNodeInitLPIterations(SCIP *scip)
int SCIPcutpoolGetMaxNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1060
SCIP_Longint SCIPpropGetNDomredsFound(SCIP_PROP *prop)
Definition: prop.c:1116
int SCIPgetNEnabledConss(SCIP *scip)
SCIP_Real lastsolgap
Definition: struct_stat.h:124
int SCIPgetNCutsFoundRound(SCIP *scip)
SCIP_Longint SCIPconflictGetNStrongbranchIterations(SCIP_CONFLICT *conflict)
Definition: conflict.c:8783
SCIP_Longint nrootstrongbranchs
Definition: struct_stat.h:195
int SCIPpresolGetNCalls(SCIP_PRESOL *presol)
Definition: presol.c:807
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5813
SCIP_Bool time_reading
Definition: struct_set.h:552
internal methods for displaying statistics tables
int nreoptruns
Definition: struct_stat.h:257
SCIP_EXPORT SCIP_Longint SCIPrelaxGetNCalls(SCIP_RELAX *relax)
Definition: relax.c:566
SCIP_SOL ** sols
Definition: struct_primal.h:48
SCIP_Real SCIPbranchGetScore(SCIP_SET *set, SCIP_VAR *var, SCIP_Real downgain, SCIP_Real upgain)
Definition: branch.c:2189
SCIP_Real SCIPgetReadingTime(SCIP *scip)
Definition: scip_timing.c:386
SCIP_Longint SCIPgetNLimSolsFound(SCIP *scip)
SCIP_Longint nstrongbranchs
Definition: struct_stat.h:194
void SCIPstoreSolutionGap(SCIP *scip)
int SCIPsepastoreGetNCutsApplied(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1116
SCIP_Real SCIPgetAvgCutoffScoreCurrentRun(SCIP *scip)
SCIP_Bool tablessorted
Definition: struct_set.h:162
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:359
SCIP_Longint nrootsblpiterations
Definition: struct_stat.h:69
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceConss(SCIP_CONFLICT *conflict)
Definition: conflict.c:8299
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:8309
#define FALSE
Definition: def.h:73
SCIP_SEPA ** sepas
Definition: struct_set.h:77
SCIP_Longint SCIPbenderscutGetNFound(SCIP_BENDERSCUT *benderscut)
Definition: benderscut.c:559
public methods for Benders&#39; decomposition
int SCIPdivesetGetMaxSolutionDepth(SCIP_DIVESET *diveset)
Definition: heur.c:448
char * SCIPconcsolverGetName(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:290
SCIP_EXPORT SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
Definition: sol.c:2553
SCIP_STAGE stage
Definition: struct_set.h:63
#define TRUE
Definition: def.h:72
void SCIPprintBranchruleStatistics(SCIP *scip, FILE *file)
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Longint SCIPconflictGetNPropConflictLiterals(SCIP_CONFLICT *conflict)
Definition: conflict.c:5595
void SCIPprintSeparatorStatistics(SCIP *scip, FILE *file)
int nenabledconss
Definition: struct_stat.h:223
SCIP_Longint SCIPconcsolverGetNSolsShared(SCIP_CONCSOLVER *concsolver)
Definition: concsolver.c:582
SCIP_Longint nnlps
Definition: struct_stat.h:197
SCIP_Real SCIPprobInternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
Definition: prob.c:2096
SCIP_Longint nbacktracks
Definition: struct_stat.h:87
void SCIPprintConcsolverStatistics(SCIP *scip, FILE *file)