source: branches/devel/Cbc/src/CbcMessage.cpp @ 424

Last change on this file since 424 was 424, checked in by forrest, 13 years ago

many changes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1// Copyright (C) 2002, International Business Machines
2// Corporation and others.  All Rights Reserved.
3#if defined(_MSC_VER)
4// Turn off compiler warning about long names
5#  pragma warning(disable:4786)
6#endif
7
8#include "CbcMessage.hpp"
9
10typedef struct {
11  CBC_Message internalNumber;
12  int externalNumber; // or continuation
13  char detail;
14  const char * message;
15} Cbc_message;
16static Cbc_message us_english[]=
17{
18  {CBC_END_GOOD,1,1,"Search completed - best objective %g, took %d iterations and %d nodes (%.2f seconds)"},
19  {CBC_MAXNODES,3,1,"Exiting on maximum nodes"},
20  {CBC_MAXTIME,20,1,"Exiting on maximum time"},
21  {CBC_MAXSOLS,19,1,"Exiting on maximum solutions"},
22  {CBC_EVENT,27,1,"Exiting on user event"},
23  {CBC_SOLUTION,4,1,"Integer solution of %g found after %d iterations and %d nodes (%.2f seconds)"},
24  {CBC_END_SOLUTION,34,2,"Final check on integer solution of %g found after %d iterations and %d nodes (%.2f seconds)"},
25  {CBC_SOLUTION2,33,1,"Integer solution of %g found (by alternate solver) after %d iterations and %d nodes (%.2f seconds)"},
26  {CBC_END,5,1,"Partial search - best objective %g (best possible %g), took %d iterations and %d nodes (%.2f seconds)"},
27  {CBC_INFEAS,6,1,"The LP relaxation is infeasible or too expensive"},
28  {CBC_STRONG,7,3,"Strong branching on %d (%d), down %g (%d) up %g (%d) value %g"},
29  {CBC_SOLINDIVIDUAL,8,2,"%d has value %g"},
30  {CBC_INTEGERINCREMENT,9,1,"Objective coefficients multiple of %g"},
31  {CBC_STATUS,10,1,"After %d nodes, %d on tree, %g best solution, best possible %g (%.2f seconds)"},
32  {CBC_GAP,11,1,"Exiting as integer gap of %g less than %g or %g%%"},
33  {CBC_ROUNDING,12,1,"Integer solution of %g found by heuristic after %d iterations and %d nodes (%.2f seconds)"},
34  {CBC_TREE_SOL,24,1,"Integer solution of %g found by subtree after %d iterations and %d nodes (%.2f seconds)"},
35  {CBC_ROOT,13,1,"At root node, %d cuts changed objective from %g to %g in %d passes"},
36  {CBC_GENERATOR,14,1,"Cut generator %d (%s) - %d row cuts (%d active), %d column cuts %? in %g seconds - new frequency is %d"},
37  {CBC_BRANCH,15,2,"Node %d Obj %g Unsat %d depth %d"},
38  {CBC_STRONGSOL,16,1,"Integer solution of %g found by strong branching after %d iterations and %d nodes (%.2f seconds)"},
39  {CBC_NOINT,3007,1,"No integer variables - nothing to do"},
40  {CBC_VUB_PASS,17,1,"%d solved, %d variables fixed, %d tightened"},
41  {CBC_VUB_END,18,1,"After tightenVubs, %d variables fixed, %d tightened"},
42  {CBC_NOTFEAS1,21,2,"On closer inspection node is infeasible"},
43  {CBC_NOTFEAS2,22,2,"On closer inspection objective value of %g above cutoff of %g"},
44  {CBC_NOTFEAS3,23,2,"Allowing solution, even though largest row infeasibility is %g"},
45  {CBC_CUTOFF_WARNING1,23,1,"Cutoff set to %g - equivalent to best solution of %g"},
46  {CBC_ITERATE_STRONG,25,3,"%d cleanup iterations before strong branching"},
47  {CBC_PRIORITY,26,1,"Setting priorities for objects %d to %d inclusive (out of %d)"},
48  {CBC_WARNING_STRONG,3008,1,"Strong branching is fixing too many variables, too expensively!"},
49  {CBC_START_SUB,28,1,"Starting sub-tree for %s - maximum nodes %d"},
50  {CBC_END_SUB,29,1,"Ending sub-tree for %s"},
51  {CBC_HEURISTIC_SOLUTION,30,1,"solution of %g found by %s after %2.f seconds"},
52  {CBC_CUTS_STATS,31,1,"%d added rows had average density of %g"},
53  {CBC_STRONG_STATS,32,1,"Strong branching done %d times (%d iterations), fathomed %d nodes and fixed %d variables"},
54  {CBC_UNBOUNDED,34,1,"The LP relaxation is unbounded!"},
55  {CBC_OTHER_STATS,35,1,"Maximum depth %d, %g variables fixed on reduced cost"},
56  {CBC_HEURISTICS_OFF,36,1,"Heuristics switched off as %d branching objects are of wrong type"},
57  {CBC_DUMMY_END,999999,0,""}
58};
59/* Constructor */
60CbcMessage::CbcMessage(Language language) :
61  CoinMessages(sizeof(us_english)/sizeof(Cbc_message))
62{
63  language_=language;
64  strcpy(source_,"Cbc");
65  class_ = 0; // branch and bound
66  Cbc_message * message = us_english;
67
68  while (message->internalNumber!=CBC_DUMMY_END) {
69    CoinOneMessage oneMessage(message->externalNumber,message->detail,
70                message->message);
71    addMessage(message->internalNumber,oneMessage);
72    message ++;
73  }
74
75  // now override any language ones
76
77  switch (language) {
78
79  default:
80    message=NULL;
81    break;
82  }
83
84  // replace if any found
85  if (message) {
86    while (message->internalNumber!=CBC_DUMMY_END) {
87      replaceMessage(message->internalNumber,message->message);
88      message ++;
89    }
90  }
91}
Note: See TracBrowser for help on using the repository browser.