File: CbcGenCtlBlk.cpp

package info (click to toggle)
coinor-cbc 2.9.9+repack1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,848 kB
  • ctags: 5,787
  • sloc: cpp: 104,337; sh: 8,921; xml: 2,950; makefile: 520; ansic: 491; awk: 197
file content (687 lines) | stat: -rw-r--r-- 18,223 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
/*
  Copyright (C) 2007, Lou Hafer, International Business Machines Corporation
  and others.  All Rights Reserved.

  This code is licensed under the terms of the Eclipse Public License (EPL).

  $Id: CbcGenCtlBlk.cpp 1899 2013-04-09 18:12:08Z stefan $
*/
/*
  This file is part of cbc-generic.
*/

#include "CbcConfig.h"
#include "CoinPragma.hpp"

#include <cassert>

#include "CbcGenCtlBlk.hpp"

namespace {

char svnid[] = "$Id: CbcGenCtlBlk.cpp 1899 2013-04-09 18:12:08Z stefan $" ;

}

/*
  Constructor for cbc-generic control block.

  Set up defaults for the cbc-generic control block. Note that prototypes for
  cut generators and heuristics will be created on demand; see the access
  functions.

  Once this structure settles down, simple intialisation should move up to
  the standard `:' block. In the meantime, this avoids complaints about
  ordering.
*/

CbcGenCtlBlk::CbcGenCtlBlk ()

{
    version_ = CBC_GENERIC_VERSION ;
    /*
      It's unclear to me that this is a good choice for dfltDirectory. Makes
      sense for commands, but seems unnecessary for data files. Perhaps a null
      string instead?
    */
    char dirsep = CoinFindDirSeparator() ;
    dfltDirectory_ = (dirsep == '/' ? "./" : ".\\") ;
    lastMpsIn_ = "" ;
    allowImportErrors_ = false ;
    lastSolnOut_ = "stdout" ;
    printMode_ = 0 ;
    printMask_ = "" ;

    paramVec_ = 0 ;
    genParams_.first_ = 0 ;
    genParams_.last_ = 0 ;
    cbcParams_.first_ = 0 ;
    cbcParams_.last_ = 0 ;
    osiParams_.first_ = 0 ;
    osiParams_.last_ = 0 ;

    verbose_ = 0 ;
    paramsProcessed_ = 0 ;
    defaultSettings_ = true ;

    debugCreate_ = "" ;
    debugFile_ = "" ;
    debugSol_.numCols_ = -1 ;
    debugSol_.values_ = 0 ;

    printOpt_ = 0 ;

    /*
      Assigning us_en to cur_lang_ is entirely bogus, but CoinMessages::Language
      does not provide an `unspecified' code.
    */
    msgHandler_ = new CoinMessageHandler() ;
    ourMsgHandler_ = true ;
    cur_lang_ = CoinMessages::us_en ;
    msgs_ = 0 ;
    logLvl_ = 0 ;

    totalTime_ = 0.0 ;

    model_ = 0 ;
    dfltSolver_ = 0 ;
    goodModel_ = false ;
    bab_.majorStatus_ = BACInvalid ;
    bab_.minorStatus_ = BACmInvalid ;
    bab_.where_ = BACwInvalid ;
    bab_.haveAnswer_ = false ;
    bab_.answerSolver_ = 0 ;

    preProcess_ = CbcGenCtlBlk::IPPSOS ;
    cutDepth_ = -1 ;

    probing_.action_ = CbcGenCtlBlk::CGIfMove ;
    probing_.proto_ = 0 ;
    probing_.usingObjective_ = true ;
    probing_.maxPass_ = 3 ;
    probing_.maxPassRoot_ = 3 ;
    probing_.maxProbe_ = 10 ;
    probing_.maxProbeRoot_ = 50 ;
    probing_.maxLook_ = 10 ;
    probing_.maxLookRoot_ = 50 ;
    probing_.maxElements_ = 200 ;
    probing_.rowCuts_ = 3 ;

    clique_.action_ = CbcGenCtlBlk::CGIfMove ;
    clique_.proto_ = 0 ;
    clique_.starCliqueReport_ = false ;
    clique_.rowCliqueReport_ = false ;
    clique_.minViolation_ = 0.1 ;

    flow_.action_ = CbcGenCtlBlk::CGIfMove ;
    flow_.proto_ = 0 ;

    gomory_.action_ = CbcGenCtlBlk::CGIfMove ;
    gomory_.proto_ = 0 ;
    gomory_.limit_ = 50 ;
    gomory_.limitAtRoot_ = 512 ;

    knapsack_.action_ = CbcGenCtlBlk::CGIfMove ;
    knapsack_.proto_ = 0 ;

    // landp_action_ = CbcGenCtlBlk::CGOff ;
    // landp_.proto_ = 0 ;

    mir_.action_ = CbcGenCtlBlk::CGIfMove ;
    mir_.proto_ = 0 ;

    oddHole_.action_ = CbcGenCtlBlk::CGOff ;
    oddHole_.proto_ = 0 ;

    redSplit_.action_ = CbcGenCtlBlk::CGRoot ;
    redSplit_.proto_ = 0 ;

    twomir_.action_ = CbcGenCtlBlk::CGRoot ;
    twomir_.proto_ = 0 ;
    twomir_.maxElements_ = 250 ;

    fpump_.action_ = CbcGenCtlBlk::CGOn ;
    fpump_.proto_ = 0 ;

    combine_.action_ = CbcGenCtlBlk::CGOn ;
    combine_.proto_ = 0 ;
    combine_.trySwap_ = 1 ;

    greedyCover_.action_ = CbcGenCtlBlk::CGOn ;
    greedyCover_.proto_ = 0 ;
    greedyEquality_.action_ = CbcGenCtlBlk::CGOn ;
    greedyEquality_.proto_ = 0 ;

    localTree_.action_ = CbcGenCtlBlk::CGOff ;
    localTree_.proto_ = 0 ;
    localTree_.soln_ = 0 ;
    localTree_.range_ = 10 ;
    localTree_.typeCuts_ = 0 ;
    localTree_.maxDiverge_ = 0 ;
    localTree_.timeLimit_ = 10000 ;
    localTree_.nodeLimit_ = 2000 ;
    localTree_.refine_ = true ;

    rounding_.action_ = CbcGenCtlBlk::CGOn ;
    rounding_.proto_ = 0 ;

    djFix_.action_ = false ;
    djFix_.threshold_ = 1.0e100 ;

    priorityAction_ = CbcGenCtlBlk::BPOff ;
    /*
      The value for numBeforeTrust is as recommended by Achterberg. Cbc's
      implementation doesn't really have a parameter equivalent to Achterberg's
      dynamic limit on number of strong branching evaluations, so go with a fairly
      large default. As of 06.12.16, the magic number for shadow price mode meant
      `use shadow prices (penalties, I think) if there's no strong branching info'.
    */
    chooseStrong_.numBeforeTrust_ = 8 ;
    chooseStrong_.numStrong_ = 100 ;
    chooseStrong_.shadowPriceMode_ = 1 ;

    return ;
}

/*
  Note that we don't want to delete dfltSolver_ here because it's just a
  copy of the pointer held in the solvers map over in CbcGenSolvers.cpp.
*/
CbcGenCtlBlk::~CbcGenCtlBlk ()

{
    if (model_) delete model_ ;
    if (bab_.answerSolver_) delete bab_.answerSolver_ ;

    if (probing_.proto_) delete probing_.proto_ ;
    if (clique_.proto_) delete clique_.proto_ ;
    if (flow_.proto_) delete flow_.proto_ ;
    if (gomory_.proto_) delete gomory_.proto_ ;
    if (knapsack_.proto_) delete knapsack_.proto_ ;
    if (mir_.proto_) delete mir_.proto_ ;
    if (oddHole_.proto_) delete oddHole_.proto_ ;
    if (redSplit_.proto_) delete redSplit_.proto_ ;
    if (twomir_.proto_) delete twomir_.proto_ ;

    if (fpump_.proto_) delete fpump_.proto_ ;
    if (combine_.proto_) delete combine_.proto_ ;
    if (greedyCover_.proto_) delete greedyCover_.proto_ ;
    if (greedyEquality_.proto_) delete greedyEquality_.proto_ ;
    if (rounding_.proto_) delete rounding_.proto_ ;

    if (msgHandler_ && ourMsgHandler_) delete msgHandler_ ;
    if (msgs_) delete msgs_ ;

    return ;
}

/*
  Access functions for cut generators and heuristics. These support lazy
  creation --- if action_ is other than CGOff, an object is created if
  necessary and a pointer is stored in proto_. The pointer is returned as
  a generic CglCutGenerator or CbcHeuristic. The return value of the function
  is the value of action_.

  Because the model may have changed, the default for heuristics is to delete
  any existing object and create a new one. This can be suppressed if desired.
*/

CbcGenCtlBlk::CGControl CbcGenCtlBlk::getProbing (CglCutGenerator *&gen)

{
    if (probing_.action_ != CbcGenCtlBlk::CGOff && probing_.proto_ == 0) {
        probing_.proto_ = new CglProbing() ;
        probing_.proto_->setUsingObjective(probing_.usingObjective_) ;
        probing_.proto_->setMaxPass(probing_.maxPass_) ;
        probing_.proto_->setMaxPassRoot(probing_.maxPassRoot_) ;
        probing_.proto_->setMaxProbe(probing_.maxProbe_) ;
        probing_.proto_->setMaxProbeRoot(probing_.maxProbeRoot_) ;
        probing_.proto_->setMaxLook(probing_.maxLook_) ;
        probing_.proto_->setMaxLookRoot(probing_.maxLookRoot_) ;
        probing_.proto_->setMaxElements(probing_.maxElements_) ;
        probing_.proto_->setRowCuts(probing_.rowCuts_) ;
    }
    gen = dynamic_cast<CglCutGenerator *>(probing_.proto_) ;

    return (probing_.action_) ;
}


CbcGenCtlBlk::CGControl CbcGenCtlBlk::getClique (CglCutGenerator *&gen)

{
    if (clique_.action_ != CbcGenCtlBlk::CGOff && clique_.proto_ == 0) {
        clique_.proto_ = new CglClique() ;
        clique_.proto_->setStarCliqueReport(clique_.starCliqueReport_) ;
        clique_.proto_->setRowCliqueReport(clique_.rowCliqueReport_) ;
        clique_.proto_->setMinViolation(clique_.minViolation_) ;
    }
    gen = dynamic_cast<CglCutGenerator *>(clique_.proto_) ;

    return (clique_.action_) ;
}


CbcGenCtlBlk::CGControl CbcGenCtlBlk::getFlow (CglCutGenerator *&gen)

{
    if (flow_.action_ != CbcGenCtlBlk::CGOff && flow_.proto_ == 0) {
        flow_.proto_ = new CglFlowCover() ;
    }
    gen = dynamic_cast<CglCutGenerator *>(flow_.proto_) ;

    return (flow_.action_) ;
}


CbcGenCtlBlk::CGControl CbcGenCtlBlk::getGomory (CglCutGenerator *&gen)

{
    if (gomory_.action_ != CbcGenCtlBlk::CGOff && gomory_.proto_ == 0) {
        gomory_.proto_ = new CglGomory() ;
        gomory_.proto_->setLimitAtRoot(gomory_.limitAtRoot_) ;
        gomory_.proto_->setLimit(gomory_.limit_) ;
    }
    gen = dynamic_cast<CglCutGenerator *>(gomory_.proto_) ;

    return (gomory_.action_) ;
}


CbcGenCtlBlk::CGControl CbcGenCtlBlk::getKnapsack (CglCutGenerator *&gen)

{
    if (knapsack_.action_ != CbcGenCtlBlk::CGOff && knapsack_.proto_ == 0) {
        knapsack_.proto_ = new CglKnapsackCover() ;
    }
    gen = dynamic_cast<CglCutGenerator *>(knapsack_.proto_) ;

    return (knapsack_.action_) ;
}


CbcGenCtlBlk::CGControl CbcGenCtlBlk::getMir (CglCutGenerator *&gen)

{
    if (mir_.action_ != CbcGenCtlBlk::CGOff && mir_.proto_ == 0) {
        mir_.proto_ = new CglMixedIntegerRounding2() ;
    }
    gen = dynamic_cast<CglCutGenerator *>(mir_.proto_) ;

    return (mir_.action_) ;
}


CbcGenCtlBlk::CGControl CbcGenCtlBlk::getRedSplit (CglCutGenerator *&gen)

{
    if (redSplit_.action_ != CbcGenCtlBlk::CGOff && redSplit_.proto_ == 0) {
        redSplit_.proto_ = new CglRedSplit() ;
    }
    gen = dynamic_cast<CglCutGenerator *>(redSplit_.proto_) ;

    return (redSplit_.action_) ;
}


CbcGenCtlBlk::CGControl CbcGenCtlBlk::getTwomir (CglCutGenerator *&gen)

{
    if (twomir_.action_ != CbcGenCtlBlk::CGOff && twomir_.proto_ == 0) {
        twomir_.proto_ = new CglTwomir() ;
        twomir_.proto_->setMaxElements(twomir_.maxElements_) ;
    }
    gen = dynamic_cast<CglCutGenerator *>(twomir_.proto_) ;

    return (twomir_.action_) ;
}


CbcGenCtlBlk::CGControl
CbcGenCtlBlk::getFPump (CbcHeuristic *&gen, CbcModel *model,
                        bool alwaysCreate)

{
    if (fpump_.action_ != CbcGenCtlBlk::CGOff &&
            (fpump_.proto_ == 0 || alwaysCreate)) {
        if (fpump_.proto_) {
            delete fpump_.proto_ ;
        }
        fpump_.proto_ = new CbcHeuristicFPump(*model) ;
        fpump_.proto_->setMaximumPasses(fpump_.iters_) ;
    }
    gen = dynamic_cast<CbcHeuristic *>(fpump_.proto_) ;

    return (fpump_.action_) ;
}


CbcGenCtlBlk::CGControl
CbcGenCtlBlk::getCombine (CbcHeuristic *&gen, CbcModel *model,
                          bool alwaysCreate)

{
    if (combine_.action_ != CbcGenCtlBlk::CGOff &&
            (combine_.proto_ == 0 || alwaysCreate)) {
        if (combine_.proto_) {
            delete combine_.proto_ ;
        }
        combine_.proto_ = new CbcHeuristicLocal(*model) ;
        combine_.proto_->setSearchType(combine_.trySwap_) ;
    }
    gen = dynamic_cast<CbcHeuristic *>(combine_.proto_) ;

    return (combine_.action_) ;
}


CbcGenCtlBlk::CGControl
CbcGenCtlBlk::getGreedyCover (CbcHeuristic *&gen, CbcModel *model,
                              bool alwaysCreate)

{
    if (greedyCover_.action_ != CbcGenCtlBlk::CGOff &&
            (greedyCover_.proto_ == 0 || alwaysCreate)) {
        if (greedyCover_.proto_) {
            delete greedyCover_.proto_ ;
        }
        greedyCover_.proto_ = new CbcHeuristicGreedyCover(*model) ;
    }
    gen = dynamic_cast<CbcHeuristic *>(greedyCover_.proto_) ;

    return (greedyCover_.action_) ;
}


CbcGenCtlBlk::CGControl
CbcGenCtlBlk::getGreedyEquality (CbcHeuristic *&gen, CbcModel *model,
                                 bool alwaysCreate)

{
    if (greedyEquality_.action_ != CbcGenCtlBlk::CGOff &&
            (greedyEquality_.proto_ == 0 || alwaysCreate)) {
        if (greedyEquality_.proto_) {
            delete greedyEquality_.proto_ ;
        }
        greedyEquality_.proto_ = new CbcHeuristicGreedyEquality(*model) ;
    }
    gen = dynamic_cast<CbcHeuristic *>(greedyEquality_.proto_) ;

    return (greedyEquality_.action_) ;
}


CbcGenCtlBlk::CGControl
CbcGenCtlBlk::getRounding (CbcHeuristic *&gen, CbcModel *model,
                           bool alwaysCreate)

{
    if (rounding_.action_ != CbcGenCtlBlk::CGOff &&
            (rounding_.proto_ == 0 || alwaysCreate)) {
        if (rounding_.proto_) {
            delete rounding_.proto_ ;
        }
        rounding_.proto_ = new CbcRounding(*model) ;
    }
    gen = dynamic_cast<CbcHeuristic *>(rounding_.proto_) ;

    return (rounding_.action_) ;
}


CbcGenCtlBlk::CGControl
CbcGenCtlBlk::getTreeLocal (CbcTreeLocal *&localTree, CbcModel *model,
                            bool alwaysCreate)

{
    if (localTree_.action_ != CbcGenCtlBlk::CGOff &&
            (localTree_.proto_ == 0 || alwaysCreate)) {
        if (localTree_.proto_) {
            delete localTree_.proto_ ;
        }
        localTree_.proto_ =
            new CbcTreeLocal(model, localTree_.soln_, localTree_.range_,
                             localTree_.typeCuts_, localTree_.maxDiverge_,
                             localTree_.timeLimit_, localTree_.nodeLimit_,
                             localTree_.refine_) ;
    }
    localTree = localTree_.proto_ ;

    return (localTree_.action_) ;
}

/*
  A bunch of little translation helper routines leading up to a version of
  setBaBStatus that figures it all out given a CbcModel and BACWhere code.
  This translation needs to be centralised to avoid sprinkling magic numbers
  all through the code.

  Be a bit careful with the translation routines --- they aren't sensitive to
  where the search stopped.
*/

CbcGenCtlBlk::BACMajor CbcGenCtlBlk::translateMajor (int status)

{
    switch (status) {
    case -1: {
        return (BACNotRun) ;
    }
    case  0: {
        return (BACFinish) ;
    }
    case  1: {
        return (BACStop) ;
    }
    case  2: {
        return (BACAbandon) ;
    }
    case  5: {
        return (BACUser) ;
    }
    default: {
        return (BACInvalid) ;
    }
    }
}


CbcGenCtlBlk::BACMinor CbcGenCtlBlk::translateMinor (int status)

{
    switch (status) {
    case -1: {
        return (BACmInvalid) ;
    }
    case  0: {
        return (BACmFinish) ;
    }
    case  1: {
        return (BACmInfeas) ;
    }
    case  2: {
        return (BACmGap) ;
    }
    case  3: {
        return (BACmNodeLimit) ;
    }
    case  4: {
        return (BACmTimeLimit) ;
    }
    case  5: {
        return (BACmUser) ;
    }
    case  6: {
        return (BACmSolnLimit) ;
    }
    case  7: {
        return (BACmUbnd) ;
    }
    default: {
        return (BACmOther) ;
    }
    }
}

/*
  A bit different --- given an OSI, use its interrogation functions to choose
  an appropriate BACMinor code. Not everything matches up, eh?
*/
CbcGenCtlBlk::BACMinor
CbcGenCtlBlk::translateMinor (const OsiSolverInterface *osi)

{
    if (osi->isProvenOptimal()) {
        return (BACmFinish) ;
    } else if (osi->isProvenPrimalInfeasible()) {
        return (BACmInfeas) ;
    } else if (osi->isProvenDualInfeasible()) {
        return (BACmUbnd) ;
    } else {
        return (BACmOther) ;
    }
}


/*
  A routine to set the bab_ status block given a CbcModel and an indication
  of where we're at in the search. Really, this is just a big mapping from
  CbcModel codes to CbcGeneric codes.
*/

void CbcGenCtlBlk::setBaBStatus (const CbcModel *model, BACWhere where,
                                 bool haveAnswer,
                                 OsiSolverInterface *answerSolver)

{
    CbcGenCtlBlk::BACMajor major ;
    CbcGenCtlBlk::BACMinor minor ;

    major = translateMajor(model->status()) ;

    if (where == CbcGenCtlBlk::BACwBareRoot ||
            where == CbcGenCtlBlk::BACwIPPRelax) {
        minor = translateMinor(model->solver()) ;
    } else {
        minor = translateMinor(model->secondaryStatus()) ;
    }

    setBaBStatus(major, minor, where, haveAnswer, answerSolver) ;

    return ;
}


/*
  Last, but not least, a routine to print the result.
*/

void CbcGenCtlBlk::printBaBStatus ()

{
    std::cout << "BAC result: stopped " ;

    switch (bab_.where_) {
    case BACwNotStarted: {
        std::cout << "before root relaxation" ;
        break ;
    }
    case BACwBareRoot: {
        std::cout << "after root relaxation" ;
        break ;
    }
    case BACwIPP: {
        std::cout << "after integer preprocessing" ;
        break ;
    }
    case BACwIPPRelax: {
        std::cout << "after solving preprocessed relaxation" ;
        break ;
    }
    case BACwBAC: {
        std::cout << "after branch-and-cut" ;
        break ;
    }
    default: {
        std::cout << "!!invalid phase code!!" ;
        break ;
    }
    }

    std::cout << std::endl << "    Branch-and-cut " ;

    switch (bab_.majorStatus_) {
    case BACNotRun: {
        std::cout << "never got started" ;
        break ;
    }
    case BACFinish: {
        std::cout << "finished" ;
        break ;
    }
    case BACStop: {
        std::cout << "stopped on a limit" ;
        break ;
    }
    case BACAbandon: {
        std::cout << "was abandoned" ;
        break ;
    }
    case BACUser: {
        std::cout << "stopped due to a user event" ;
        break ;
    }
    default: {
        std::cout << "!!invalid major status code!!" ;
        break ;
    }
    }

    std::cout << "; minor status is " ;

    switch (bab_.minorStatus_) {
    case BACmFinish: {
        std::cout << "optimal" ;
        break ;
    }
    case BACmInfeas: {
        std::cout << "infeasible" ;
        break ;
    }
    case BACmUbnd: {
        std::cout << "unbounded" ;
        break ;
    }
    case BACmGap: {
        std::cout << "reached specified integrality gap." ;
        break ;
    }
    case BACmNodeLimit: {
        std::cout << "reached node limit" ;
        break ;
    }
    case BACmTimeLimit: {
        std::cout << "reached time limit" ;
        break ;
    }
    case BACmSolnLimit: {
        std::cout << "reached limit on number of solutions" ;
        break ;
    }
    case BACmUser: {
        std::cout << "stopped due to a user event" ;
        break ;
    }
    case BACmOther: {
        std::cout << "other" ;
        break ;
    }
    default: {
        std::cout << "!!invalid minor status code!!" ;
        break ;
    }
    }

    std::cout << "." << std::endl ;
}