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