Scippy

SCIP

Solving Constraint Integer Programs

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