source: trunk/ClpMessage.cpp @ 161

Last change on this file since 161 was 161, checked in by forrest, 16 years ago

Correct bad bound message

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 5.9 KB
Line 
1// Copyright (C) 2000, International Business Machines
2// Corporation and others.  All Rights Reserved.
3
4#include "CoinPragma.hpp"
5#include "ClpMessage.hpp"
6
7typedef struct {
8  CLP_Message internalNumber;
9  int externalNumber; // or continuation
10  char detail;
11  const char * message;
12} Clp_message;
13static Clp_message us_english[]=
14{
15  {CLP_SIMPLEX_FINISHED,0,1,"Optimal - objective value %g"},
16  {CLP_SIMPLEX_INFEASIBLE,1,1,"Primal infeasible - objective value %g"},
17  {CLP_SIMPLEX_UNBOUNDED,2,1,"Dual infeasible - objective value %g"},
18  {CLP_SIMPLEX_STOPPED,3,1,"Stopped - objective value %g"},
19  {CLP_SIMPLEX_ERROR,4,1,"Stopped due to errors - objective value %g"},
20  {CLP_SIMPLEX_STATUS,5,1,"%d  Objective %g%? Primal infeas %g (%d)%? Dual infeas %g (%d)%? without free dual infeas (%d)"},
21  {CLP_DUAL_BOUNDS,25,3,"Looking optimal checking bounds with %g"},
22  {CLP_SIMPLEX_ACCURACY,6,3,"Primal error %g, dual error %g"},
23  {CLP_SIMPLEX_BADFACTOR,7,1,"Singular factorization of basis - status %d"},
24  {CLP_SIMPLEX_BOUNDTIGHTEN,8,1,"Bounds were tightened %d times"},
25  {CLP_SIMPLEX_INFEASIBILITIES,9,1,"%d infeasibilities"},
26  {CLP_SIMPLEX_FLAG,10,3,"Flagging variable %c%d"},
27  {CLP_SIMPLEX_GIVINGUP,11,2,"Stopping as close enough"},
28  {CLP_DUAL_CHECKB,12,3,"Looking infeasible checking bounds with %g"},
29  {CLP_DUAL_ORIGINAL,13,3,"Going back to original objective"},
30  {CLP_SIMPLEX_PERTURB,14,1,"Perturbing problem by %g"},
31  {CLP_PRIMAL_ORIGINAL,15,2,"Going back to original tolerance"},
32  {CLP_PRIMAL_WEIGHT,16,2,"New infeasibility weight of %g"},
33  {CLP_PRIMAL_OPTIMAL,17,2,"Looking optimal with tolerance of %g"},
34  {CLP_SINGULARITIES,18,2,"%d total structurals rejected in initial factorization"},
35  {CLP_MODIFIEDBOUNDS,19,1,"%d variables/rows fixed as scaled bounds too close"},
36  {CLP_RIMSTATISTICS1,20,2,"Absolute values of scaled objective range from %g to %g"},
37  {CLP_RIMSTATISTICS2,21,2,"Absolute values of scaled bounds range from %g to %g, minimum gap %g"},
38  {CLP_RIMSTATISTICS3,22,2,"Absolute values of scaled rhs range from %g to %g, minimum gap %g"},
39  {CLP_POSSIBLELOOP,23,2,"Possible loop - %d matches (%x) after %d checks"},
40  {CLP_SMALLELEMENTS,24,0,"Matrix will be packed to eliminate %d small elements"},
41  {CLP_SIMPLEX_HOUSE1,101,32,"dirOut %d, dirIn %d, theta %g, out %g, dj %g, alpha %g"},
42  {CLP_SIMPLEX_HOUSE2,102,4,"%d %g In: %c%d Out: %c%d%? dj ratio %g distance %g%? dj %g distance %g"},
43  {CLP_SIMPLEX_NONLINEAR,103,4,"Primal nonlinear change %g (%d)"},
44  {CLP_SIMPLEX_FREEIN,104,32,"Free column in %d"},
45  {CLP_SIMPLEX_PIVOTROW,105,32,"Pivot row %d"},
46  {CLP_DUAL_CHECK,106,4,"Btran alpha %g, ftran alpha %g"},
47  {CLP_PRIMAL_DJ,107,4,"Btran dj %g, ftran dj %g"},
48  {CLP_PRESOLVE_COLINFEAS,501,2,"Problem is infeasible due to column %d, %g %g"},
49  {CLP_PRESOLVE_ROWINFEAS,502,2,"Problem is infeasible due to row %d, %g %g"},
50  {CLP_PRESOLVE_COLUMNBOUNDA,503,2,"Problem looks unbounded above due to column %d, %g %g"},
51  {CLP_PRESOLVE_COLUMNBOUNDB,504,2,"Problem looks unbounded below due to column %d, %g %g"},
52  {CLP_PRESOLVE_NONOPTIMAL,505,1,"Problem not optimal, resolve after postsolve"},
53  {CLP_PRESOLVE_STATS,506,1,"Presolve %d (%d) rows, %d (%d) columns and %d (%d) elements"},
54  {CLP_PRESOLVE_INFEAS,507,0,"Presolve determined that the problem was infeasible with tolerance of %g"},
55  {CLP_PRESOLVE_UNBOUND,508,0,"Presolve thinks problem is unbounded"},
56  {CLP_PRESOLVE_INFEASUNBOUND,509,0,"Presolve thinks problem is infeasible AND unbounded???"},
57  {CLP_PRESOLVE_INTEGERMODS,510,1,"Presolve is modifying %d integer bounds and re-presolving"},
58  {CLP_PRESOLVE_POSTSOLVE,511,0,"After Postsolve, objective %g, infeasibilities - dual %g (%d), primal %g (%d)"},
59  {CLP_PRESOLVE_NEEDS_CLEANING,512,0,"Presolved model was optimal, full model needs cleaning up"},
60  {CLP_PACKEDSCALE_INITIAL,1001,2,"Initial range of elements is %g to %g"},
61  {CLP_PACKEDSCALE_WHILE,1002,3,"Range of elements is %g to %g"},
62  {CLP_PACKEDSCALE_FINAL,1003,2,"Final range of elements is %g to %g"},
63  {CLP_PACKEDSCALE_FORGET,1004,2,"Not bothering to scale as good enough"},
64  {CLP_INITIALIZE_STEEP,1005,1,"Initializing steepest edge weights - old %g, new %g"},
65  {CLP_UNABLE_OPEN,6001,0,"Unable to open file %s for reading"},
66  {CLP_BAD_BOUNDS,6002,0,"%d bad bound pairs or bad objectives were found - first at %c%d"},
67  {CLP_BAD_MATRIX,6003,0,"Matrix has %d large values, first at column %d, row %d is %g"},
68  {CLP_LOOP,6004,0,"Can't get out of loop - stopping (Debug) (Don't panic, OsiClpSolverInterface will resolve)"},
69  {CLP_DUPLICATEELEMENTS,26,0,"Matrix will be packed to eliminate %d duplicate elements"},
70  {CLP_IMPORT_RESULT,27,1,"Model was imported from %s in %g seconds"},
71  {CLP_IMPORT_ERRORS,3001,1," There were %d errors when importing model from %s"},
72  {CLP_EMPTY_PROBLEM,3002,0,"Not solving empty problem - %d rows, %d columns and %d elements"},
73  {CLP_CRASH,28,1,"Crash put %d variables in basis, %d dual infeasibilities"},
74  {CLP_END_VALUES_PASS,29,1,"End of values pass after %d iterations"},
75  {CLP_DUMMY_END,999999,0,""}
76};
77static Clp_message uk_english[]=
78{
79  {CLP_SIMPLEX_FINISHED,0,1,"Optimal - objective value %g,\
80 okay CLP can solve some LPs but you really need Xpress from Dash Associates :-)"},
81  {CLP_DUMMY_END,999999,0,""}
82};
83/* Constructor */
84ClpMessage::ClpMessage(Language language) :
85  CoinMessages(sizeof(us_english)/sizeof(Clp_message))
86{
87  language_=language;
88  strcpy(source_,"Clp");
89  Clp_message * message = us_english;
90
91  while (message->internalNumber!=CLP_DUMMY_END) {
92     CoinOneMessage oneMessage(message->externalNumber,message->detail,
93                               message->message);
94     addMessage(message->internalNumber,oneMessage);
95     message ++;
96}
97
98  // now override any language ones
99
100  switch (language) {
101  case uk_en:
102    message = uk_english;
103    break;
104
105  default:
106    message=NULL;
107    break;
108  }
109
110  // replace if any found
111  if (message) {
112    while (message->internalNumber!=CLP_DUMMY_END) {
113      replaceMessage(message->internalNumber,message->message);
114      message ++;
115    }
116  }
117}
Note: See TracBrowser for help on using the repository browser.