source: branches/devel-1/ClpMessage.cpp @ 15

Last change on this file since 15 was 15, checked in by forrest, 18 years ago

Hope this works from wincvs

Fix error in values pass

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1// Copyright (C) 2000, 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 "ClpMessage.hpp"
9
10typedef struct {
11  CLP_Message internalNumber;
12  int externalNumber; // or continuation
13  char detail;
14  const char * message;
15} Clp_message;
16static Clp_message us_english[]=
17{
18  {CLP_SIMPLEX_FINISHED,0,1,"Optimal - objective value %g"},
19  {CLP_SIMPLEX_INFEASIBLE,1,1,"Primal infeasible - objective value %g"},
20  {CLP_SIMPLEX_UNBOUNDED,2,1,"Dual infeasible - objective value %g"},
21  {CLP_SIMPLEX_STOPPED,3,1,"Stopped - objective value %g"},
22  {CLP_SIMPLEX_ERROR,4,1,"Stopped due to errors - objective value %g"},
23  {CLP_SIMPLEX_STATUS,5,1,"%d  Objective %g%? Primal infeas %g (%d)%? Dual infeas %g (%d)%? without free dual infeas (%d)"},
24  {CLP_DUAL_BOUNDS,5,3,"Looking optimal checking bounds with %g"},
25  {CLP_SIMPLEX_ACCURACY,6,3,"Primal error %g, dual error %g"},
26  {CLP_SIMPLEX_BADFACTOR,7,1,"Singular factorization of basis - status %d"},
27  {CLP_SIMPLEX_BOUNDTIGHTEN,8,1,"Bounds were tightened %d times"},
28  {CLP_SIMPLEX_INFEASIBILITIES,9,1,"%d infeasibilities"},
29  {CLP_SIMPLEX_FLAG,10,3,"Flagging variable %c%d"},
30  {CLP_SIMPLEX_GIVINGUP,11,2,"Stopping as close enough"},
31  {CLP_DUAL_CHECKB,12,3,"Looking infeasible checking bounds with %g"},
32  {CLP_DUAL_ORIGINAL,13,3,"Going back to original objective"},
33  {CLP_SIMPLEX_PERTURB,14,1,"Perturbing problem by %g"},
34  {CLP_PRIMAL_ORIGINAL,15,2,"Going back to original tolerance"},
35  {CLP_PRIMAL_WEIGHT,16,2,"New infeasibility weight of %g"},
36  {CLP_PRIMAL_OPTIMAL,17,2,"Looking optimal with tolerance of %g"},
37  {CLP_SINGULARITIES,18,2,"%d total structurals rejected in initial factorization"},
38  {CLP_SIMPLEX_HOUSE1,101,32,"dirOut %d, dirIn %d, theta %g, out %g, dj %g, alpha %g"},
39  {CLP_SIMPLEX_HOUSE2,102,4,"%d %g In: %c%d Out: %c%d%? dj ratio %g distance %g%? dj %g distance %g"},
40  {CLP_SIMPLEX_NONLINEAR,103,4,"Primal nonlinear change %g (%d)"},
41  {CLP_SIMPLEX_FREEIN,104,32,"Free column in %d"},
42  {CLP_SIMPLEX_PIVOTROW,105,32,"Pivot row %d"},
43  {CLP_DUAL_CHECK,106,4,"Btran alpha %g, ftran alpha %g"},
44  {CLP_PRIMAL_DJ,107,4,"Btran dj %g, ftran dj %g"},
45  {CLP_PACKEDSCALE_INITIAL,1001,2,"Initial range of elements is %g to %g"},
46  {CLP_PACKEDSCALE_WHILE,1002,3,"Range of elements is %g to %g"},
47  {CLP_PACKEDSCALE_FINAL,1003,2,"Final range of elements is %g to %g"},
48  {CLP_PACKEDSCALE_FORGET,1004,2,"Not bothering to scale as good enough"},
49  {CLP_INITIALIZE_STEEP,1005,1,"Initializing steepest edge weights - old %g, new %g"},
50  {CLP_UNABLE_OPEN,6001,0,"Unable to open file %s for reading"},
51  {CLP_IMPORT_RESULT,18,1,"Model was imported from %s in %g seconds"},
52  {CLP_IMPORT_ERRORS,3001,1," There were %d errors when importing model from %s"},
53  {CLP_DUMMY_END,999999,0,""}
54};
55static Clp_message uk_english[]=
56{
57  {CLP_SIMPLEX_FINISHED,0,1,"Optimal - objective value %g,\
58 okay CLP can solve some LPs but you really need Xpress from Dash Associates :-)"},
59  {CLP_DUMMY_END,999999,0,""}
60};
61/* Constructor */
62ClpMessage::ClpMessage(Language language) :
63  OsiMessages(sizeof(us_english)/sizeof(Clp_message))
64{
65  language_=language;
66  strcpy(source_,"Clp");
67  Clp_message * message = us_english;
68
69  while (message->internalNumber!=CLP_DUMMY_END) {
70      OsiOneMessage oneMessage(message->externalNumber,message->detail,
71                message->message);
72    addMessage(message->internalNumber,oneMessage);
73    message ++;
74}
75
76  // now override any language ones
77
78  switch (language) {
79  case uk_en:
80    message = uk_english;
81    break;
82
83  default:
84    message=NULL;
85    break;
86  }
87
88  // replace if any found
89  if (message) {
90    while (message->internalNumber!=CLP_DUMMY_END) {
91      replaceMessage(message->internalNumber,message->message);
92      message ++;
93    }
94  }
95}
Note: See TracBrowser for help on using the repository browser.