00001
00002
00003 #if defined(_MSC_VER)
00004
00005 # pragma warning(disable:4786)
00006 #endif
00007
00008 #include "CoinMessage.hpp"
00009
00010 typedef struct {
00011 COIN_Message internalNumber;
00012 int externalNumber;
00013 char detail;
00014 const char * message;
00015 } Coin_message;
00016 static Coin_message us_english[]=
00017 {
00018 {COIN_MPS_LINE,1,1,"At line %d %s"},
00019 {COIN_MPS_STATS,2,1,"Problem %s has %d rows, %d columns and %d elements"},
00020 {COIN_MPS_ILLEGAL,3001,0,"Illegal value for %s of %g"},
00021 {COIN_MPS_BADIMAGE,3002,0,"Bad image at line %d < %s >"},
00022 {COIN_MPS_DUPOBJ,3003,0,"Duplicate objective at line %d < %s >"},
00023 {COIN_MPS_DUPROW,3004,0,"Duplicate row %s at line %d < %s >"},
00024 {COIN_MPS_NOMATCHROW,3005,0,"No match for row %s at line %d < %s >"},
00025 {COIN_MPS_NOMATCHCOL,3006,0,"No match for column %s at line %d < %s >"},
00026 {COIN_MPS_FILE,6001,0,"Unable to open mps input file %s"},
00027 {COIN_MPS_BADFILE1,6002,0,"Unknown image %s at line %d of file %s"},
00028 {COIN_MPS_BADFILE2,6003,0,"Consider the possibility of a compressed file\
00029 which zlib is unable to read"},
00030 {COIN_MPS_EOF,6004,0,"EOF on file %s"},
00031 {COIN_MPS_RETURNING,6005,0,"Returning as too many errors"},
00032 {COIN_SOLVER_MPS,8,1,"%s read with %d errors"},
00033 {COIN_PRESOLVE_COLINFEAS,501,2,"Problem is infeasible due to column %d, %g %g"},
00034 {COIN_PRESOLVE_ROWINFEAS,502,2,"Problem is infeasible due to row %d, %g %g"},
00035 {COIN_PRESOLVE_COLUMNBOUNDA,503,2,"Problem looks unbounded above due to column %d, %g %g"},
00036 {COIN_PRESOLVE_COLUMNBOUNDB,504,2,"Problem looks unbounded below due to column %d, %g %g"},
00037 {COIN_PRESOLVE_NONOPTIMAL,505,1,"Presolved problem not optimal, resolve after postsolve"},
00038 {COIN_PRESOLVE_STATS,506,1,"Presolve %d (%d) rows, %d (%d) columns and %d (%d) elements"},
00039 {COIN_PRESOLVE_INFEAS,507,0,"Presolve determined that the problem was infeasible with tolerance of %g"},
00040 {COIN_PRESOLVE_UNBOUND,508,0,"Presolve thinks problem is unbounded"},
00041 {COIN_PRESOLVE_INFEASUNBOUND,509,0,"Presolve thinks problem is infeasible AND unbounded???"},
00042 {COIN_PRESOLVE_INTEGERMODS,510,1,"Presolve is modifying %d integer bounds and re-presolving"},
00043 {COIN_PRESOLVE_POSTSOLVE,511,1,"After Postsolve, objective %g, infeasibilities - dual %g (%d), primal %g (%d)"},
00044 {COIN_PRESOLVE_NEEDS_CLEANING,512,1,"Presolved model was optimal, full model needs cleaning up"},
00045 {COIN_PRESOLVE_PASS,513,3,"%d rows dropped after presolve pass %d"},
00046 {COIN_DUMMY_END,999999,0,""}
00047 };
00048
00049 static Coin_message italian[]=
00050 {
00051 {COIN_MPS_LINE,1,1,"al numero %d %s"},
00052 {COIN_MPS_STATS,2,1,"matrice %s ha %d file, %d colonne and %d elementi (diverso da zero)"},
00053 {COIN_DUMMY_END,999999,0,""}
00054 };
00055
00056 CoinMessage::CoinMessage(Language language) :
00057 CoinMessages(sizeof(us_english)/sizeof(Coin_message))
00058 {
00059 language_=language;
00060 strcpy(source_,"Coin");
00061 Coin_message * message = us_english;
00062
00063 while (message->internalNumber!=COIN_DUMMY_END) {
00064 CoinOneMessage oneMessage(message->externalNumber,message->detail,
00065 message->message);
00066 addMessage(message->internalNumber,oneMessage);
00067 message ++;
00068 }
00069
00070
00071
00072 switch (language) {
00073 case it:
00074 message = italian;
00075 break;
00076
00077 default:
00078 message=NULL;
00079 break;
00080 }
00081
00082
00083 if (message) {
00084 while (message->internalNumber!=COIN_DUMMY_END) {
00085 replaceMessage(message->internalNumber,message->message);
00086 message ++;
00087 }
00088 }
00089 }