source: trunk/Cbc/src/CbcMessage.cpp @ 1211

Last change on this file since 1211 was 1211, checked in by forrest, 11 years ago

changes for heuristic clone

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