source: trunk/Alps/examples/Abc/AbcMessage.cpp @ 277

Last change on this file since 277 was 277, checked in by andreasw, 13 years ago

first working version with autotools

File size: 4.5 KB
Line 
1/*===========================================================================*
2 * This file is part of the Abstract Library for Parallel Search (ALPS).     *
3 *                                                                           *
4 * ALPS is distributed under the Common Public License as part of the        *
5 * COIN-OR repository (http://www.coin-or.org).                              *
6 *                                                                           *
7 * Authors: Yan Xu, SAS Institute Inc.                                       *
8 *          Ted Ralphs, Lehigh University                                    *
9 *          Laszlo Ladanyi, IBM T.J. Watson Research Center                  *
10 *          Matthew Saltzman, Clemson University                             *
11 *                                                                           *
12 *                                                                           *
13 * Copyright (C) 2001-2004, International Business Machines                  *
14 * Corporation, Lehigh University, Yan Xu, Ted Ralphs, Matthew Salzman and   *
15 * others. All Rights Reserved.                                              *
16 *===========================================================================*/
17
18#include "AbcMessage.h"
19
20//#############################################################################
21
22typedef struct {
23    ABC_Message internalNumber;
24    int externalNumber;              // or continuation
25    char detail;
26    const char * message;
27} Abc_message;
28
29//#############################################################################
30
31static Abc_message us_english[]=
32{
33    {ABC_END_GOOD,1,1,"Search completed - best objective %g, took %d iterations and %d nodes"},
34    {ABC_MAXNODES,3,1,"Exiting on maximum nodes"},
35    {ABC_MAXTIME,20,1,"Exiting on maximum time"},
36    {ABC_MAXSOLS,19,1,"Exiting on maximum solutions"},
37    {ABC_SOLUTION,4,1,"Integer solution of %g found after %d iterations and %d nodes"},
38    {ABC_END,5,1,"Partial search took %d iterations and %d nodes"},
39    {ABC_INFEAS,6,1,"The LP relaxation is infeasible or too expensive"},
40    {ABC_STRONG,7,3,"Strong branching on %d (%d), down %g (%d) up %g (%d) value %d"},
41    {ABC_SOLINDIVIDUAL,8,2,"%d has value %g"},
42    {ABC_INTEGERINCREMENT,9,1,"Objective coefficients multiple of %g"},
43    {ABC_STATUS,10,1,"Process[%d]: after %d nodes, %d on tree, %g best solution, best possible %g"},
44    {ABC_GAP,11,1,"Exiting as integer gap of %g less than %g"},
45    {ABC_ROUNDING,12,1,"Integer solution of %g found by rounding after %d iterations and %d nodes"},
46    {ABC_ROOT,13,3,"At root node, %d cuts changed objective from %g to %g in %d passes"},
47    {ABC_GENERATOR,14,2,"Cut generator %d (%s) - %d row cuts (%d active), %d column cuts - new frequency is %d"},
48    {ABC_BRANCH,15,3,"Node %d Obj %g Unsat %d depth %d"},
49    {ABC_STRONGSOL,16,1,"Integer solution of %g found by strong branching after %d iterations and %d nodes"},
50    {ABC_NOINT,3007,0,"No integer variables - nothing to do"},
51    {ABC_VUB_PASS,17,1,"%d solved, %d variables fixed, %d tightened"},
52    {ABC_VUB_END,18,1,"After tightenVubs, %d variables fixed, %d tightened"},
53    {ABC_NOTFEAS1,21,2,"On closer inspection node is infeasible"},
54    {ABC_NOTFEAS2,22,2,"On closer inspection objective value of %g above cutoff of %g"},
55    {ABC_NOTFEAS3,23,2,"Allowing solution, even though largest row infeasibility is %g"},
56    {ABC_CUTOFF_WARNING1,23,1,"Cutoff set to %g - equivalent to best solution of %g"},
57    {ABC_CUTS,24,1, "At node %d, %d cuts changed objective from %g to %g in %d passes"},
58    {ABC_BRANCHSOL,25,1,"Integer solution of %g found by branching after %d iterations and %d nodes"},
59    {ABC_DUMMY_END, 999999, 0, ""}
60};
61
62//#############################################################################
63
64/* Constructor */
65AbcMessage::AbcMessage(Language language) 
66    :
67    CoinMessages(sizeof(us_english) / sizeof(Abc_message))
68{
69    language_ = language;
70    strcpy(source_, "Abc");
71    Abc_message * message = us_english;
72
73    while (message->internalNumber != ABC_DUMMY_END) {
74        CoinOneMessage oneMessage(message->externalNumber, message->detail,
75                                  message->message);
76        addMessage(message->internalNumber, oneMessage);
77        message++;
78    }
79
80    // now override any language ones
81
82    switch (language) {
83
84    default:
85        message = NULL;
86        break;
87    }
88
89    // replace if any found
90    if (message) {
91        while (message->internalNumber != ABC_DUMMY_END) {
92            replaceMessage(message->internalNumber, message->message);
93            message++;
94        }
95    }
96}
Note: See TracBrowser for help on using the repository browser.