[2] | 1 | // Copyright (C) 2000, International Business Machines |
---|
| 2 | // Corporation and others. All Rights Reserved. |
---|
| 3 | |
---|
[63] | 4 | #include "CoinPragma.hpp" |
---|
[2] | 5 | #include "ClpMessage.hpp" |
---|
[441] | 6 | /// Structure for use by ClpMessage.cpp |
---|
[2] | 7 | typedef struct { |
---|
| 8 | CLP_Message internalNumber; |
---|
| 9 | int externalNumber; // or continuation |
---|
| 10 | char detail; |
---|
| 11 | const char * message; |
---|
| 12 | } Clp_message; |
---|
[653] | 13 | static Clp_message clp_us_english[]= |
---|
[2] | 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"}, |
---|
[348] | 20 | {CLP_SIMPLEX_INTERRUPT,5,1,"Stopped by event handler - objective value %g"}, |
---|
| 21 | {CLP_SIMPLEX_STATUS,6,1,"%d Obj %g%? Primal inf %g (%d)%? Dual inf %g (%d)%? w.o. free dual inf (%d)"}, |
---|
[86] | 22 | {CLP_DUAL_BOUNDS,25,3,"Looking optimal checking bounds with %g"}, |
---|
[348] | 23 | {CLP_SIMPLEX_ACCURACY,60,3,"Primal error %g, dual error %g"}, |
---|
[238] | 24 | {CLP_SIMPLEX_BADFACTOR,7,2,"Singular factorization of basis - status %d"}, |
---|
[225] | 25 | {CLP_SIMPLEX_BOUNDTIGHTEN,8,3,"Bounds were tightened %d times"}, |
---|
[2] | 26 | {CLP_SIMPLEX_INFEASIBILITIES,9,1,"%d infeasibilities"}, |
---|
[50] | 27 | {CLP_SIMPLEX_FLAG,10,3,"Flagging variable %c%d"}, |
---|
[2] | 28 | {CLP_SIMPLEX_GIVINGUP,11,2,"Stopping as close enough"}, |
---|
[225] | 29 | {CLP_DUAL_CHECKB,12,2,"New dual bound of %g"}, |
---|
[2] | 30 | {CLP_DUAL_ORIGINAL,13,3,"Going back to original objective"}, |
---|
[225] | 31 | {CLP_SIMPLEX_PERTURB,14,1,"Perturbing problem by %g %% of %g - largest nonzero change %g (%% %g) - largest zero change %g"}, |
---|
[2] | 32 | {CLP_PRIMAL_ORIGINAL,15,2,"Going back to original tolerance"}, |
---|
| 33 | {CLP_PRIMAL_WEIGHT,16,2,"New infeasibility weight of %g"}, |
---|
| 34 | {CLP_PRIMAL_OPTIMAL,17,2,"Looking optimal with tolerance of %g"}, |
---|
[50] | 35 | {CLP_SINGULARITIES,18,2,"%d total structurals rejected in initial factorization"}, |
---|
| 36 | {CLP_MODIFIEDBOUNDS,19,1,"%d variables/rows fixed as scaled bounds too close"}, |
---|
| 37 | {CLP_RIMSTATISTICS1,20,2,"Absolute values of scaled objective range from %g to %g"}, |
---|
| 38 | {CLP_RIMSTATISTICS2,21,2,"Absolute values of scaled bounds range from %g to %g, minimum gap %g"}, |
---|
| 39 | {CLP_RIMSTATISTICS3,22,2,"Absolute values of scaled rhs range from %g to %g, minimum gap %g"}, |
---|
| 40 | {CLP_POSSIBLELOOP,23,2,"Possible loop - %d matches (%x) after %d checks"}, |
---|
[238] | 41 | {CLP_SMALLELEMENTS,24,1,"Matrix will be packed to eliminate %d small elements"}, |
---|
[2] | 42 | {CLP_SIMPLEX_HOUSE1,101,32,"dirOut %d, dirIn %d, theta %g, out %g, dj %g, alpha %g"}, |
---|
| 43 | {CLP_SIMPLEX_HOUSE2,102,4,"%d %g In: %c%d Out: %c%d%? dj ratio %g distance %g%? dj %g distance %g"}, |
---|
| 44 | {CLP_SIMPLEX_NONLINEAR,103,4,"Primal nonlinear change %g (%d)"}, |
---|
| 45 | {CLP_SIMPLEX_FREEIN,104,32,"Free column in %d"}, |
---|
| 46 | {CLP_SIMPLEX_PIVOTROW,105,32,"Pivot row %d"}, |
---|
| 47 | {CLP_DUAL_CHECK,106,4,"Btran alpha %g, ftran alpha %g"}, |
---|
[294] | 48 | {CLP_PRIMAL_DJ,107,4,"For %c%d btran dj %g, ftran dj %g"}, |
---|
[2] | 49 | {CLP_PACKEDSCALE_INITIAL,1001,2,"Initial range of elements is %g to %g"}, |
---|
| 50 | {CLP_PACKEDSCALE_WHILE,1002,3,"Range of elements is %g to %g"}, |
---|
| 51 | {CLP_PACKEDSCALE_FINAL,1003,2,"Final range of elements is %g to %g"}, |
---|
| 52 | {CLP_PACKEDSCALE_FORGET,1004,2,"Not bothering to scale as good enough"}, |
---|
[225] | 53 | {CLP_INITIALIZE_STEEP,1005,3,"Initializing steepest edge weights - old %g, new %g"}, |
---|
[2] | 54 | {CLP_UNABLE_OPEN,6001,0,"Unable to open file %s for reading"}, |
---|
[161] | 55 | {CLP_BAD_BOUNDS,6002,0,"%d bad bound pairs or bad objectives were found - first at %c%d"}, |
---|
[50] | 56 | {CLP_BAD_MATRIX,6003,0,"Matrix has %d large values, first at column %d, row %d is %g"}, |
---|
[260] | 57 | {CLP_LOOP,6004,0,"Can't get out of loop - stopping"}, |
---|
[238] | 58 | {CLP_DUPLICATEELEMENTS,26,1,"Matrix will be packed to eliminate %d duplicate elements"}, |
---|
[93] | 59 | {CLP_IMPORT_RESULT,27,1,"Model was imported from %s in %g seconds"}, |
---|
[2] | 60 | {CLP_IMPORT_ERRORS,3001,1," There were %d errors when importing model from %s"}, |
---|
[325] | 61 | {CLP_EMPTY_PROBLEM,3002,0,"Empty problem - %d rows, %d columns and %d elements"}, |
---|
[102] | 62 | {CLP_CRASH,28,1,"Crash put %d variables in basis, %d dual infeasibilities"}, |
---|
[137] | 63 | {CLP_END_VALUES_PASS,29,1,"End of values pass after %d iterations"}, |
---|
[225] | 64 | {CLP_QUADRATIC_BOTH,108,32,"%s %d (%g) and %d (%g) both basic"}, |
---|
| 65 | {CLP_QUADRATIC_PRIMAL_DETAILS,109,32,"coeff %g, %g, %g - dj %g - deriv zero at %g, sj at %g"}, |
---|
| 66 | {CLP_IDIOT_ITERATION,30,1,"%d infeas %g, obj %g - mu %g, its %d, %d interior"}, |
---|
| 67 | {CLP_INFEASIBLE,3003,1,"Analysis indicates model infeasible or unbounded"}, |
---|
| 68 | {CLP_MATRIX_CHANGE,31,2,"Matrix can not be converted into %s"}, |
---|
| 69 | {CLP_TIMING,32,1,"%s objective %.10g - %d iterations time %.2f2%?, Presolve %.2f%?, Idiot %.2f%?"}, |
---|
| 70 | {CLP_INTERVAL_TIMING,33,2,"%s took %.2f seconds (total %.2f)"}, |
---|
| 71 | {CLP_SPRINT,34,1,"Pass %d took %d iterations, objective %g, dual infeasibilities %g( %d)"}, |
---|
[263] | 72 | {CLP_BARRIER_ITERATION,35,1,"%d Primal %g Dual %g Complementarity %g - %d fixed, rank %d"}, |
---|
| 73 | {CLP_BARRIER_OBJECTIVE_GAP,36,3,"Feasible - objective gap %g"}, |
---|
| 74 | {CLP_BARRIER_GONE_INFEASIBLE,37,2,"Gone infeasible"}, |
---|
| 75 | {CLP_BARRIER_CLOSE_TO_OPTIMAL,38,2,"Close to optimal after %d iterations with complementarity %g"}, |
---|
| 76 | {CLP_BARRIER_COMPLEMENTARITY,39,2,"Complementarity %g - %s"}, |
---|
| 77 | {CLP_BARRIER_EXIT2,40,1,"Exiting - using solution from iteration %d"}, |
---|
| 78 | {CLP_BARRIER_STOPPING,41,1,"Exiting on iterations"}, |
---|
| 79 | {CLP_BARRIER_EXIT,42,1,"Optimal %s"}, |
---|
| 80 | {CLP_BARRIER_SCALING,43,3,"Scaling %s by %g"}, |
---|
| 81 | {CLP_BARRIER_MU,44,3,"Changing mu from %g to %g"}, |
---|
| 82 | {CLP_BARRIER_INFO,45,3,"Detail - %s"}, |
---|
| 83 | {CLP_BARRIER_END,46,1,"At end primal/dual infeasibilities %g/%g, complementarity gap %g, objective %g"}, |
---|
| 84 | {CLP_BARRIER_ACCURACY,47,2,"Relative error in phase %d, refinement %d is %g"}, |
---|
[371] | 85 | {CLP_BARRIER_SAFE,48,2,"Initial safe primal value %g, objective norm %g"}, |
---|
[263] | 86 | {CLP_BARRIER_NEGATIVE_GAPS,49,3,"%d negative gaps summing to %g"}, |
---|
| 87 | {CLP_BARRIER_REDUCING,50,2,"Reducing %s step from %g to %g"}, |
---|
| 88 | {CLP_BARRIER_DIAGONAL,51,3,"Range of diagonal values is %g to %g"}, |
---|
| 89 | {CLP_BARRIER_SLACKS,52,3,"%d slacks increased, %d decreased this iteration"}, |
---|
| 90 | {CLP_BARRIER_DUALINF,53,3,"Maximum dual infeasibility on fixed is %g"}, |
---|
| 91 | {CLP_BARRIER_KILLED,54,3,"%d variables killed this iteration"}, |
---|
| 92 | {CLP_BARRIER_ABS_DROPPED,55,2,"Absolute error on dropped rows is %g"}, |
---|
| 93 | {CLP_BARRIER_ABS_ERROR,56,2,"Primal error is %g and dual error is %g"}, |
---|
| 94 | {CLP_BARRIER_FEASIBLE,57,2,"Infeasibilities - bound %g , primal %g ,dual %g"}, |
---|
| 95 | {CLP_BARRIER_STEP,58,2,"Steps - primal %g ,dual %g , mu %g"}, |
---|
[544] | 96 | {CLP_BARRIER_KKT,6005,0,"Quadratic barrier needs a KKT factorization"}, |
---|
[336] | 97 | {CLP_RIM_SCALE,59,1,"Automatic rim scaling gives objective scale of %g and rhs/bounds scale of %g"}, |
---|
[393] | 98 | {CLP_SLP_ITER,58,1,"Pass %d objective %g - drop %g, largest delta %g"}, |
---|
[546] | 99 | {CLP_COMPLICATED_MODEL,3004,1,"Can not use addRows or addColumns on CoinModel as mixed, %d rows, %d columns"}, |
---|
| 100 | {CLP_BAD_STRING_VALUES,3005,1,"%d string elements had no values associated with them"}, |
---|
[618] | 101 | {CLP_CRUNCH_STATS,61,2,"Crunch %d (%d) rows, %d (%d) columns and %d (%d) elements"}, |
---|
[2] | 102 | {CLP_DUMMY_END,999999,0,""} |
---|
| 103 | }; |
---|
| 104 | static Clp_message uk_english[]= |
---|
| 105 | { |
---|
| 106 | {CLP_SIMPLEX_FINISHED,0,1,"Optimal - objective value %g,\ |
---|
| 107 | okay CLP can solve some LPs but you really need Xpress from Dash Associates :-)"}, |
---|
| 108 | {CLP_DUMMY_END,999999,0,""} |
---|
| 109 | }; |
---|
| 110 | /* Constructor */ |
---|
| 111 | ClpMessage::ClpMessage(Language language) : |
---|
[653] | 112 | CoinMessages(sizeof(clp_us_english)/sizeof(Clp_message)) |
---|
[2] | 113 | { |
---|
| 114 | language_=language; |
---|
| 115 | strcpy(source_,"Clp"); |
---|
[648] | 116 | class_ = 1; //solver |
---|
[653] | 117 | Clp_message * message = clp_us_english; |
---|
[2] | 118 | |
---|
| 119 | while (message->internalNumber!=CLP_DUMMY_END) { |
---|
[50] | 120 | CoinOneMessage oneMessage(message->externalNumber,message->detail, |
---|
| 121 | message->message); |
---|
| 122 | addMessage(message->internalNumber,oneMessage); |
---|
| 123 | message ++; |
---|
[2] | 124 | } |
---|
| 125 | |
---|
| 126 | // now override any language ones |
---|
| 127 | |
---|
| 128 | switch (language) { |
---|
| 129 | case uk_en: |
---|
| 130 | message = uk_english; |
---|
| 131 | break; |
---|
| 132 | |
---|
| 133 | default: |
---|
| 134 | message=NULL; |
---|
| 135 | break; |
---|
| 136 | } |
---|
| 137 | |
---|
| 138 | // replace if any found |
---|
| 139 | if (message) { |
---|
| 140 | while (message->internalNumber!=CLP_DUMMY_END) { |
---|
| 141 | replaceMessage(message->internalNumber,message->message); |
---|
| 142 | message ++; |
---|
| 143 | } |
---|
| 144 | } |
---|
| 145 | } |
---|