diff -rupN glpk-4.39/examples/glpsol.c glpk-4.39patch/examples/glpsol.c --- glpk-4.39/examples/glpsol.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/examples/glpsol.c 2009-11-06 21:30:01.000000000 +0100 @@ -4,7 +4,1080 @@ int main(int argc, const char *argv[]) { /* stand-alone LP/MIP solver */ - return glp_main(argc, argv); + + + +// ------------------ Gianluigi, 27-10-2009 + + + + +// +// input values +// +// ROWS (for read_rows function) +// + int nRows = 82; + char *CharRow[]={ + "N", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G", + "L","L","L","L","L","L","L","L","G" + }; + + int typeRows[nRows]; + +char * nameRows[] = { + "OBJECT" + ,"Ap0" + ,"Bp0" + ,"Cp0" + ,"Dp0" + ,"Am0" + ,"Bm0" + ,"Cm0" + ,"Dm0" + ,"LAMBDA0" + ,"Ap1" + ,"Bp1" + ,"Cp1" + ,"Dp1" + ,"Am1" + ,"Bm1" + ,"Cm1" + ,"Dm1" + ,"LAMBDA1" + ,"Ap2" + ,"Bp2" + ,"Cp2" + ,"Dp2" + ,"Am2" + ,"Bm2" + ,"Cm2" + ,"Dm2" + ,"LAMBDA2" + ,"Ap3" + ,"Bp3" + ,"Cp3" + ,"Dp3" + ,"Am3" + ,"Bm3" + ,"Cm3" + ,"Dm3" + ,"LAMBDA3" + ,"Ap4" + ,"Bp4" + ,"Cp4" + ,"Dp4" + ,"Am4" + ,"Bm4" + ,"Cm4" + ,"Dm4" + ,"LAMBDA4" + ,"Ap5" + ,"Bp5" + ,"Cp5" + ,"Dp5" + ,"Am5" + ,"Bm5" + ,"Cm5" + ,"Dm5" + ,"LAMBDA5" + ,"Ap6" + ,"Bp6" + ,"Cp6" + ,"Dp6" + ,"Am6" + ,"Bm6" + ,"Cm6" + ,"Dm6" + ,"LAMBDA6" + ,"Ap7" + ,"Bp7" + ,"Cp7" + ,"Dp7" + ,"Am7" + ,"Bm7" + ,"Cm7" + ,"Dm7" + ,"LAMBDA7" + ,"Ap8" + ,"Bp8" + ,"Cp8" + ,"Dp8" + ,"Am8" + ,"Bm8" + ,"Cm8" + ,"Dm8" + ,"LAMBDA8" + }; + +//------- end ROWS information + + +//--------begin COLUMNS information + + + int const NStructVar=41, // number of structural variables + NStructRows=72; // maximum number of ROWS in which a structural variable can be found + + double final_values[NStructVar]; + + + int NRowsInWhichStructVarArePresent[]={ + 36, + 36, + 36, + 36, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 72 + }; + + char *StructVarName[] = { + "m1", + "m2", + "q1", + "q2", + "lamp0", + "lamp1", + "lamp2", + "lamp3", + "lamp4", + "lamp5", + "lamp6", + "lamp7", + "lamp8", + "lamm0", + "lamm1", + "lamm2", + "lamm3", + "lamm4", + "lamm5", + "lamm6", + "lamm7", + "lamm8", + "sigmap0", + "sigmap1", + "sigmap2", + "sigmap3", + "sigmap4", + "sigmap5", + "sigmap6", + "sigmap7", + "sigmap8", + "sigmam0", + "sigmam1", + "sigmam2", + "sigmam3", + "sigmam4", + "sigmam5", + "sigmam6", + "sigmam7", + "sigmam8", + "DUMMY" + }; + + + char *AuxNameRowsInWhichStructVarArePresent[41][72]={ +// structural variable m1 + "Ap0","Am0","Bp0","Bm0" + ,"Ap1","Am1","Bp1","Bm1" + ,"Ap2","Am2","Bp2","Bm2" + ,"Ap3","Am3","Bp3","Bm3" + ,"Ap4","Am4","Bp4","Bm4" + ,"Ap5","Am5","Bp5","Bm5" + ,"Ap6","Am6","Bp6","Bm6" + ,"Ap7","Am7","Bp7","Bm7" + ,"Ap8","Am8","Bp8","Bm8" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","" +// m2 + ,"Ap0","Am0","Bp0","Bm0" + ,"Ap1","Am1","Bp1","Bm1" + ,"Ap2","Am2","Bp2","Bm2" + ,"Ap3","Am3","Bp3","Bm3" + ,"Ap4","Am4","Bp4","Bm4" + ,"Ap5","Am5","Bp5","Bm5" + ,"Ap6","Am6","Bp6","Bm6" + ,"Ap7","Am7","Bp7","Bm7" + ,"Ap8","Am8","Bp8","Bm8" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","" +// q1 + ,"Ap0","Am0","Bp0","Bm0" + ,"Ap1","Am1","Bp1","Bm1" + ,"Ap2","Am2","Bp2","Bm2" + ,"Ap3","Am3","Bp3","Bm3" + ,"Ap4","Am4","Bp4","Bm4" + ,"Ap5","Am5","Bp5","Bm5" + ,"Ap6","Am6","Bp6","Bm6" + ,"Ap7","Am7","Bp7","Bm7" + ,"Ap8","Am8","Bp8","Bm8" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","" +// q2 + ,"Ap0","Am0","Bp0","Bm0" + ,"Ap1","Am1","Bp1","Bm1" + ,"Ap2","Am2","Bp2","Bm2" + ,"Ap3","Am3","Bp3","Bm3" + ,"Ap4","Am4","Bp4","Bm4" + ,"Ap5","Am5","Bp5","Bm5" + ,"Ap6","Am6","Bp6","Bm6" + ,"Ap7","Am7","Bp7","Bm7" + ,"Ap8","Am8","Bp8","Bm8" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","" +// lamp0 + ,"Ap0","Bp0","Cp0","Dp0","LAMBDA0","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp1 + ,"Ap1","Bp1","Cp1","Dp1","LAMBDA1","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp2 + ,"Ap2","Bp2","Cp2","Dp2","LAMBDA2","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp3 + ,"Ap3","Bp3","Cp3","Dp3","LAMBDA3","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp4 + ,"Ap4","Bp4","Cp4","Dp4","LAMBDA4","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp5 + ,"Ap5","Bp5","Cp5","Dp5","LAMBDA5","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp6 + ,"Ap6","Bp6","Cp6","Dp6","LAMBDA6","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp7 + ,"Ap7","Bp7","Cp7","Dp7","LAMBDA7","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamp8 + ,"Ap8","Bp8","Cp8","Dp8","LAMBDA8","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm0 + ,"Am0","Bm0","Cm0","Dm0","LAMBDA0","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm1 + ,"Am1","Bm1","Cm1","Dm1","LAMBDA1","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm2 + ,"Am2","Bm2","Cm2","Dm2","LAMBDA2","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm3 + , "Am3","Bm3","Cm3","Dm3","LAMBDA3","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm4 + ,"Am4","Bm4","Cm4","Dm4","LAMBDA4","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm5 + ,"Am5","Bm5","Cm5","Dm5","LAMBDA5","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm6 + ,"Am6","Bm6","Cm6","Dm6","LAMBDA6","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm7 + ,"Am7","Bm7","Cm7","Dm7","LAMBDA7","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// lamm8 + ,"Am8","Bm8","Cm8","Dm8","LAMBDA8","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap0 + ,"OBJECT","Ap0","Bp0","Cp0","Dp0","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap1 + ,"OBJECT","Ap1","Bp1","Cp1","Dp1","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap2 + ,"OBJECT","Ap2","Bp2","Cp2","Dp2","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap3 + ,"OBJECT","Ap3","Bp3","Cp3","Dp3","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap4 + ,"OBJECT","Ap4","Bp4","Cp4","Dp4","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap5 + ,"OBJECT","Ap5","Bp5","Cp5","Dp5","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap6 + ,"OBJECT","Ap6","Bp6","Cp6","Dp6","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap7 + ,"OBJECT","Ap7","Bp7","Cp7","Dp7","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmap8 + ,"OBJECT","Ap8","Bp8","Cp8","Dp8","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam0 + ,"OBJECT","Am0","Bm0","Cm0","Dm0","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam1 + ,"OBJECT","Am1","Bm1","Cm1","Dm1","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam2 + ,"OBJECT","Am2","Bm2","Cm2","Dm2","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam3 + ,"OBJECT","Am3","Bm3","Cm3","Dm3","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam4 + ,"OBJECT","Am4","Bm4","Cm4","Dm4","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam5 + ,"OBJECT","Am5","Bm5","Cm5","Dm5","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam6 + ,"OBJECT","Am6","Bm6","Cm6","Dm6","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam7 + ,"OBJECT","Am7","Bm7","Cm7","Dm7","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// sigmam8 + ,"OBJECT","Am8","Bm8","Cm8","Dm8","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","","","","","","","","","" + ,"","" +// DUMMY + ,"Ap0","Am0","Bp0","Bm0","Cp0","Cm0","Dp0","Dm0" + ,"Ap1","Am1","Bp1","Bm1","Cp1","Cm1","Dp1","Dm1" + ,"Ap2","Am2","Bp2","Bm2","Cp2","Cm2","Dp2","Dm2" + ,"Ap3","Am3","Bp3","Bm3","Cp3","Cm3","Dp3","Dm3" + ,"Ap4","Am4","Bp4","Bm4","Cp4","Cm4","Dp4","Dm4" + ,"Ap5","Am5","Bp5","Bm5","Cp5","Cm5","Dp5","Dm5" + ,"Ap6","Am6","Bp6","Bm6","Cp6","Cm6","Dp6","Dm6" + ,"Ap7","Am7","Bp7","Bm7","Cp7","Cm7","Dp7","Dm7" + ,"Ap8","Am8","Bp8","Bm8","Cp8","Cm8","Dp8","Dm8" + + }; + + char *NameRowsInWhichStructVarArePresent[41*72]; + int n1,n2; + for(n1=0;n1<41;n1++){ + for(n2=0;n2<72;n2++){ + NameRowsInWhichStructVarArePresent[n1*72+n2] = AuxNameRowsInWhichStructVarArePresent[n1][n2]; + } + } + + double AuxCoefficients[41][72]={ +// m1 +0.0247869,0.0247869 +,-0.0247869,-0.0247869 +,0.0259459,0.0259459 +,-0.0259459,-0.0259459 +,0.0265537,0.0265537 +,-0.0265537,-0.0265537 +,0.0253408,0.0253408 +,-0.0253408,-0.0253408 +,0.0278883,0.0278883 +,-0.0278883,-0.0278883 +,0.0293638,0.0293638 +,-0.0293638,-0.0293638 +,0.0271906,0.0271906 +,-0.0271906,-0.0271906 +,0.0285919,0.0285919 +,-0.0285919,-0.0285919 +,0.0301453,0.0301453 +,-0.0301453,-0.0301453 + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0. +// m2 +,-0.0247869,-0.0247869 +,0.0247869,0.0247869 +,-0.0259459,-0.0259459 +,0.0259459,0.0259459 +,-0.0265537,-0.0265537 +,0.0265537,0.0265537 +,-0.0253408,-0.0253408 +,0.0253408,0.0253408 +,-0.0278883,-0.0278883 +,0.0278883,0.0278883 +,-0.0293638,-0.0293638 +,0.0293638,0.0293638 +,-0.0271906,-0.0271906 +,0.0271906,0.0271906 +,-0.0285919,-0.0285919 +,0.0285919,0.0285919 +,-0.0301453,-0.0301453 +,0.0301453,0.0301453 + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0. +// ora q1 +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. +,1.,1. +,-1.,-1. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +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.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +// sigmam7 + ,2141.62,-1.,-1.,1.,-1.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +// sigmam8 + ,11750.2,-1.,-1.,1.,-1.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. + ,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0. +// DUMMY + ,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. + ,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. + ,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. + ,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. + }; + + double *Coefficients; + Coefficients=&AuxCoefficients[0][0]; + +/* + int i1,i2; + for(i1=0;i1<41;i1++){ + for(i2=0;i2<72;i2++){ + *( *(Coefficients+i1) +i2) = AuxCoefficients[i1][i2]; + } + }; +*/ + + +//--------end COLUMNS information + + +//--------begin RHS information + + double ValueB[81]={ + 2.00438,1.99562 +,2.00024,2.99976 +,2.00422,1.99578 +,2.00024,2.99976 +,1. +,2.00456,1.99544 +,2.00071,2.99929 +,2.00409,1.99591 +,2.00071,2.99929 +,1. +,2.00474,1.99526 +,2.0001,2.9999 +,2.00467,1.99533 +,2.0001,2.9999 +,1. +,2.00483,1.99517 +,2.00056,2.99944 +,2.00446,1.99554 +,2.00056,2.99944 +,1. +,2.00489,1.99511 +,2.00044,2.99956 +,2.0046,1.9954 +,2.00044,2.99956 +,1. +,2.00514,1.99486 +,2.00111,2.99889 +,2.0044,1.9956 +,2.00111,2.99889 +,1. +,2.00544,1.99456 +,2.00098,2.99902 +,2.00479,1.99521 +,2.00098,2.99902 +,1. +,2.00534,1.99466 +,2.00047,2.99953 +,2.00503,1.99497 +,2.00047,2.99953 +,1. +,2.00528,1.99472 +,2.00009,2.99991 +,2.00522,1.99478 +,2.00009,2.99991 +,1. + }; + + +//--------end RHS information + +//--------begin RANGES information + + int nRanges = 9; + double ValueRanges[9]={1.,1.,1.,1.,1.,1.,1.,1.,1.}; + char *NameRanges[9]={ + "LAMBDA0","LAMBDA1","LAMBDA2","LAMBDA3","LAMBDA4","LAMBDA5","LAMBDA6","LAMBDA7","LAMBDA8" + }; + + +//--------end RANGES information +//--------start BOUNDS information + + int nBounds = 19; + double BoundValue[19]={ 0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,0.,2.}; + char *BoundStructVarName[] = { + "lamp0", + "lamp1", + "lamp2", + "lamp3", + "lamp4", + "lamp5", + "lamp6", + "lamp7", + "lamp8", + "lamm0", + "lamm1", + "lamm2", + "lamm3", + "lamm4", + "lamm5", + "lamm6", + "lamm7", + "lamm8", + "DUMMY" + }; + char *TypeofBound[] = { + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "BV", + "FX" + }; +//--------end BOUNDS information + +//----------------------- end input information. + + + + + +//--- not from input file but from input data. + int it; + for(it=0; it< nRows;it++){ + if (CharRow[it] == "N") + typeRows[it] = GLP_FR; + else if (CharRow[it] == "G") + typeRows[it] = GLP_LO; + else if (CharRow[it] == "L") + typeRows[it] = GLP_UP; + else if (CharRow[it] == "E") + typeRows[it] = GLP_FX; + } + + + + + + + + int status= glp_main( + nRows,nameRows,typeRows, // ROWS info + NStructVar, NStructRows, NRowsInWhichStructVarArePresent, // COLUMNS info + StructVarName, NameRowsInWhichStructVarArePresent, // COLUMNS info + Coefficients, // COLUMNS info + ValueB, // RHS info + nRanges, ValueRanges, NameRanges, // RANGES info + nBounds, BoundValue, BoundStructVarName, TypeofBound // BOUNDS info +// ,argc, argv + ,final_values + ); + + +printf("from main, final printout -------------------------------\n"); +printf(" number of structural variables %d\n",NStructVar); +int ica; +for(ica=0;icamsg_lev = GLP_MSG_ALL; +{ +// parm->msg_lev = GLP_MSG_ALL; + parm->msg_lev = GLP_MSG_OFF; parm->meth = GLP_PRIMAL; parm->pricing = GLP_PT_PSE; parm->r_test = GLP_RT_HAR; diff -rupN glpk-4.39/src/glpapi09.c glpk-4.39patch/src/glpapi09.c --- glpk-4.39/src/glpapi09.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpapi09.c 2009-11-03 17:55:41.000000000 +0100 @@ -229,8 +229,8 @@ static int driver1(glp_prob *mip, const goto done; } /* it seems all is ok */ - if (parm->msg_lev >= GLP_MSG_ALL) - xprintf("Integer optimization begins...\n"); +// if (parm->msg_lev >= GLP_MSG_ALL) +// xprintf("Integer optimization begins...\n"); /* create the branch-and-bound tree */ #if 0 ((glp_iocp *)parm)->msg_lev = GLP_MSG_DBG; @@ -243,7 +243,7 @@ static int driver1(glp_prob *mip, const { case 0: if (tree->mip->mip_stat == GLP_FEAS) { if (parm->msg_lev >= GLP_MSG_ALL) - xprintf("INTEGER OPTIMAL SOLUTION FOUND\n"); +// xprintf("INTEGER OPTIMAL SOLUTION FOUND\n"); tree->mip->mip_stat = GLP_OPT; } else @@ -398,10 +398,10 @@ nodfs: /* dual infeasibility is det int ni = lpx_get_num_int(prob); int nb = lpx_get_num_bin(prob); char s[50]; - xprintf("glp_intopt: presolved MIP has %d row%s, %d column%s, " - "%d non-zero%s\n", - m, m == 1 ? "" : "s", n, n == 1 ? "" : "s", - nnz, nnz == 1 ? "" : "s"); +// xprintf("glp_intopt: presolved MIP has %d row%s, %d column%s, " +// "%d non-zero%s\n", +// m, m == 1 ? "" : "s", n, n == 1 ? "" : "s", +// nnz, nnz == 1 ? "" : "s"); if (nb == 0) strcpy(s, "none of"); else if (ni == 1 && nb == 1) @@ -412,9 +412,9 @@ nodfs: /* dual infeasibility is det strcpy(s, "all of"); else sprintf(s, "%d of", nb); - xprintf( - "glp_intopt: %d integer column%s, %s which %s binary\n", - ni, ni == 1 ? "" : "s", s, nb == 1 ? "is" : "are"); +// xprintf( +// "glp_intopt: %d integer column%s, %s which %s binary\n", +// ni, ni == 1 ? "" : "s", s, nb == 1 ? "is" : "are"); } /* solve LP relaxation */ if (!term_out || parm->msg_lev < GLP_MSG_ALL) @@ -425,8 +425,8 @@ nodfs: /* dual infeasibility is det GLP_SF_GM | GLP_SF_EQ | GLP_SF_2N | GLP_SF_SKIP); glp_adv_basis(prob, 0); env->term_out = term_out; - if (parm->msg_lev >= GLP_MSG_ALL) - xprintf("Solving LP relaxation...\n"); +// if (parm->msg_lev >= GLP_MSG_ALL) +// xprintf("Solving LP relaxation...\n"); prob->it_cnt = orig->it_cnt; { glp_smcp smcp; glp_init_smcp(&smcp); diff -rupN glpk-4.39/src/glpapi19.c glpk-4.39patch/src/glpapi19.c --- glpk-4.39/src/glpapi19.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpapi19.c 2009-11-06 21:32:42.000000000 +0100 @@ -640,9 +640,22 @@ static int parse_cmdline(struct csa *csa typedef struct { double rhs, pi; } v_data; typedef struct { double low, cap, cost, x; } a_data; -int glp_main(int argc, const char *argv[]) + +int glp_main( + int nRows, char *nameRows[], int typeRows[], // ROWS info + int NStructVar, int NStructRows, int NRowsInWhichStructVarArePresent[], // COLUMNS info + char *StructVarName[],char *NameRowsInWhichStructVarArePresent[], // COLUMNS info + double *Coefficients, // COLUMNS info + double ValueB[], // RHS info + int nRanges, double ValueRanges[], char* NameRanges[], // RANGES info + int nBounds, double BoundValue[], char *BoundStructVarName[], char *TypeofBound[] // BOUNDS info +// ,int argc, const char *argv[] + ,double final_values[] + ) { /* stand-alone LP/MIP solver */ - struct csa _csa, *csa = &_csa; + + struct csa _csa, *csa = &_csa; + int ret; xlong_t start; /* perform initialization */ @@ -679,7 +692,14 @@ int glp_main(int argc, const char *argv[ csa->xcheck = 0; csa->nomip = 0; /* parse command-line parameters */ - ret = parse_cmdline(csa, argc, argv); + + +// ret = parse_cmdline(csa, argc, argv); + +ret=0; +csa->dir=GLP_MIN; // option : --min , it is for finding the MINIMUM +csa->out_sol="dummy_out"; +csa->in_file="dummy_in"; if (ret < 0) { ret = EXIT_SUCCESS; goto done; @@ -691,7 +711,7 @@ int glp_main(int argc, const char *argv[ /*--------------------------------------------------------------*/ /* remove all output files specified in the command line */ if (csa->out_dpy != NULL) remove(csa->out_dpy); - if (csa->out_sol != NULL) remove(csa->out_sol); +// if (csa->out_sol != NULL) remove(csa->out_sol); if (csa->out_res != NULL) remove(csa->out_res); if (csa->out_bnds != NULL) remove(csa->out_bnds); if (csa->out_mps != NULL) remove(csa->out_mps); @@ -711,154 +731,25 @@ int glp_main(int argc, const char *argv[ } /*--------------------------------------------------------------*/ /* print version information */ - print_version(1); +// print_version(1); /*--------------------------------------------------------------*/ /* read problem data from the input file */ - if (csa->in_file == NULL) - { xprintf("No input problem file specified; try %s --help\n", - argv[0]); - ret = EXIT_FAILURE; - goto done; - } - if (csa->format == FMT_MPS_DECK) - { ret = glp_read_mps(csa->prob, GLP_MPS_DECK, NULL, - csa->in_file); - if (ret != 0) -err1: { xprintf("MPS file processing error\n"); - ret = EXIT_FAILURE; - goto done; - } - } - else if (csa->format == FMT_MPS_FILE) - { ret = glp_read_mps(csa->prob, GLP_MPS_FILE, NULL, + + + ret = glp_read_mps( + nRows,nameRows,typeRows, // ROWS info + NStructVar, NStructRows, NRowsInWhichStructVarArePresent, // COLUMNS info + StructVarName, NameRowsInWhichStructVarArePresent, // COLUMNS info + Coefficients, // COLUMNS info + ValueB, // RHS info + nRanges, ValueRanges, NameRanges, // RANGES info + nBounds, BoundValue, BoundStructVarName, TypeofBound, // BOUNDS info + csa->prob, GLP_MPS_FILE, NULL, csa->in_file); - if (ret != 0) goto err1; - } - else if (csa->format == FMT_CPLEX_LP) - { ret = glp_read_lp(csa->prob, NULL, csa->in_file); - if (ret != 0) - { xprintf("CPLEX LP file processing error\n"); - ret = EXIT_FAILURE; - goto done; - } - } - else if (csa->format == FMT_MATHPROG) - { int k; - /* allocate the translator workspace */ - csa->tran = glp_mpl_alloc_wksp(); - /* read model section and optional data section */ - if (glp_mpl_read_model(csa->tran, csa->in_file, csa->ndf > 0)) -err2: { xprintf("MathProg model processing error\n"); - ret = EXIT_FAILURE; - goto done; - } - /* read optional data section(s), if necessary */ - for (k = 1; k <= csa->ndf; k++) - { if (glp_mpl_read_data(csa->tran, csa->in_data[k])) - goto err2; - } - /* generate the model */ - if (glp_mpl_generate(csa->tran, csa->out_dpy)) goto err2; - /* build the problem instance from the model */ - glp_mpl_build_prob(csa->tran, csa->prob); - } - else if (csa->format == FMT_MIN_COST) - { csa->graph = glp_create_graph(sizeof(v_data), sizeof(a_data)); - ret = glp_read_mincost(csa->graph, offsetof(v_data, rhs), - offsetof(a_data, low), offsetof(a_data, cap), - offsetof(a_data, cost), csa->in_file); - if (ret != 0) - { xprintf("DIMACS file processing error\n"); - ret = EXIT_FAILURE; - goto done; - } - glp_mincost_lp(csa->prob, csa->graph, GLP_ON, - offsetof(v_data, rhs), offsetof(a_data, low), - offsetof(a_data, cap), offsetof(a_data, cost)); - glp_set_prob_name(csa->prob, csa->in_file); - } - else if (csa->format == FMT_MAX_FLOW) - { int s, t; - csa->graph = glp_create_graph(sizeof(v_data), sizeof(a_data)); - ret = glp_read_maxflow(csa->graph, &s, &t, - offsetof(a_data, cap), csa->in_file); - if (ret != 0) - { xprintf("DIMACS file processing error\n"); - ret = EXIT_FAILURE; - goto done; - } - glp_maxflow_lp(csa->prob, csa->graph, GLP_ON, s, t, - offsetof(a_data, cap)); - glp_set_prob_name(csa->prob, csa->in_file); - } - else - xassert(csa != csa); - /*--------------------------------------------------------------*/ - /* change problem name, if required */ - if (csa->new_name != NULL) - glp_set_prob_name(csa->prob, csa->new_name); - /* change optimization direction, if required */ - if (csa->dir != 0) - glp_set_obj_dir(csa->prob, csa->dir); - /* order rows and columns of the constraint matrix */ - lpx_order_matrix(csa->prob); - /*--------------------------------------------------------------*/ - /* write problem data in fixed MPS format, if required */ - if (csa->out_mps != NULL) - { ret = glp_write_mps(csa->prob, GLP_MPS_DECK, NULL, - csa->out_mps); - if (ret != 0) - { xprintf("Unable to write problem in fixed MPS format\n"); - ret = EXIT_FAILURE; - goto done; - } - } - /* write problem data in free MPS format, if required */ - if (csa->out_freemps != NULL) - { ret = glp_write_mps(csa->prob, GLP_MPS_FILE, NULL, - csa->out_freemps); - if (ret != 0) - { xprintf("Unable to write problem in free MPS format\n"); - ret = EXIT_FAILURE; - goto done; - } - } - /* write problem data in CPLEX LP format, if required */ - if (csa->out_cpxlp != NULL) - { ret = glp_write_lp(csa->prob, NULL, csa->out_cpxlp); - if (ret != 0) - { xprintf("Unable to write problem in CPLEX LP format\n"); - ret = EXIT_FAILURE; - goto done; - } - } - /* write problem data in OPB format, if required */ - if (csa->out_pb != NULL) - { ret = lpx_write_pb(csa->prob, csa->out_pb, 0, 0); - if (ret != 0) - { xprintf("Unable to write problem in OPB format\n"); - ret = EXIT_FAILURE; - goto done; - } - } - /* write problem data in normalized OPB format, if required */ - if (csa->out_npb != NULL) - { ret = lpx_write_pb(csa->prob, csa->out_npb, 1, 1); - if (ret != 0) - { xprintf( - "Unable to write problem in normalized OPB format\n"); - ret = EXIT_FAILURE; - goto done; - } - } - /*--------------------------------------------------------------*/ - /* if only problem data check is required, skip computations */ - if (csa->check) - { ret = EXIT_SUCCESS; - goto done; - } - /*--------------------------------------------------------------*/ - /* determine the solution type */ + + + + if (!csa->nomip && glp_get_num_int(csa->prob) + glp_get_num_bin(csa->prob) > 0) { if (csa->solution == SOL_INTERIOR) @@ -871,22 +762,7 @@ err2: { xprintf("MathProg model proc } /*--------------------------------------------------------------*/ /* if solution is provided, read it and skip computations */ - if (csa->in_res != NULL) - { if (csa->solution == SOL_BASIC) - ret = glp_read_sol(csa->prob, csa->in_res); - else if (csa->solution == SOL_INTERIOR) - ret = glp_read_ipt(csa->prob, csa->in_res); - else if (csa->solution == SOL_INTEGER) - ret = glp_read_mip(csa->prob, csa->in_res); - else - xassert(csa != csa); - if (ret != 0) - { xprintf("Unable to read problem solution\n"); - ret = EXIT_FAILURE; - goto done; - } - goto skip; - } + /*--------------------------------------------------------------*/ /* scale the problem data, if required */ if (csa->scale) @@ -909,6 +785,7 @@ err2: { xprintf("MathProg model proc } /*--------------------------------------------------------------*/ /* solve the problem */ + start = xtime(); if (csa->solution == SOL_BASIC) { if (!csa->exact) @@ -939,23 +816,21 @@ err2: { xprintf("MathProg model proc { glp_set_bfcp(csa->prob, &csa->bfcp); glp_simplex(csa->prob, &csa->smcp); } -#if 0 - csa->iocp.msg_lev = GLP_MSG_DBG; - csa->iocp.pp_tech = GLP_PP_NONE; -#endif glp_intopt(csa->prob, &csa->iocp); } else xassert(csa != csa); /*--------------------------------------------------------------*/ /* display statistics */ - xprintf("Time used: %.1f secs\n", xdifftime(xtime(), start)); +/* + xprintf("Time used: %.1f secs\n", xdifftime(xtime(), start)); { xlong_t tpeak; char buf[50]; lib_mem_usage(NULL, NULL, NULL, &tpeak); xprintf("Memory used: %.1f Mb (%s bytes)\n", xltod(tpeak) / 1048576.0, xltoa(tpeak, buf)); } +*/ /*--------------------------------------------------------------*/ skip: /* postsolve the model, if necessary */ if (csa->tran != NULL) @@ -976,12 +851,31 @@ skip: /* postsolve the model, if necessa /*--------------------------------------------------------------*/ /* write problem solution in printable format, if required */ if (csa->out_sol != NULL) - { if (csa->solution == SOL_BASIC) + { + + if (csa->solution == SOL_BASIC) ret = lpx_print_sol(csa->prob, csa->out_sol); else if (csa->solution == SOL_INTERIOR) ret = lpx_print_ips(csa->prob, csa->out_sol); else if (csa->solution == SOL_INTEGER) - ret = lpx_print_mip(csa->prob, csa->out_sol); +{ +// +//---------------------- passing out the final values of the fit +int ica; +for(ica=1;ica<=NStructVar;ica++){ + final_values[ica-1] = csa->prob->col[ica]->mipx; +} +//---------------------------------------------------------------- +// final printout of the MIP problem result +// ret = lpx_print_mip(csa->prob, csa->out_sol); +// + + +//---------------------------------------------------------------- + + ret=0; + +} else xassert(csa != csa); if (ret != 0) @@ -992,7 +886,8 @@ skip: /* postsolve the model, if necessa } /* write problem solution in printable format, if required */ if (csa->out_res != NULL) - { if (csa->solution == SOL_BASIC) + { + if (csa->solution == SOL_BASIC) ret = glp_write_sol(csa->prob, csa->out_res); else if (csa->solution == SOL_INTERIOR) ret = glp_write_ipt(csa->prob, csa->out_res); @@ -1054,3 +949,4 @@ done: /* delete the LP/MIP problem objec } /* eof */ + diff -rupN glpk-4.39/src/glpini01.c glpk-4.39patch/src/glpini01.c --- glpk-4.39/src/glpini01.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpini01.c 2009-11-03 18:02:24.000000000 +0100 @@ -452,7 +452,7 @@ static void adv_basis(glp_prob *lp) int *rn, *cn, *rn_inv, *cn_inv; int typx, *tagx = xcalloc(1+m+n, sizeof(int)); double lb, ub; - xprintf("Constructing initial basis...\n"); +// xprintf("Constructing initial basis...\n"); #if 0 /* 13/V-2009 */ if (m == 0) xerror("glp_adv_basis: problem has no rows\n"); @@ -472,8 +472,8 @@ static void adv_basis(glp_prob *lp) rn = xcalloc(1+m, sizeof(int)); cn = xcalloc(1+m+n, sizeof(int)); size = triang(m, m+n, lp, mat, rn, cn); - if (lpx_get_int_parm(lp, LPX_K_MSGLEV) >= 3) - xprintf("Size of triangular part = %d\n", size); +// if (lpx_get_int_parm(lp, LPX_K_MSGLEV) >= 3) +// xprintf("Size of triangular part = %d\n", size); /* the first size rows and columns of the matrix P*A~*Q (where P and Q are permutation matrices defined by the arrays rn and cn) form a lower triangular matrix; build the arrays (rn_inv diff -rupN glpk-4.39/src/glpios03.c glpk-4.39patch/src/glpios03.c --- glpk-4.39/src/glpios03.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpios03.c 2009-11-03 18:11:03.000000000 +0100 @@ -1236,11 +1236,11 @@ more: /* minor loop starts here; at this is either to be solved for the first time or to be reoptimized due to reformulation */ /* display current progress of the search */ - if (tree->parm->msg_lev >= GLP_MSG_DBG || - tree->parm->msg_lev >= GLP_MSG_ON && - (double)(tree->parm->out_frq - 1) <= - 1000.0 * xdifftime(xtime(), tree->tm_lag)) - show_progress(tree, 0); +// if (tree->parm->msg_lev >= GLP_MSG_DBG || +// tree->parm->msg_lev >= GLP_MSG_ON && +// (double)(tree->parm->out_frq - 1) <= +// 1000.0 * xdifftime(xtime(), tree->tm_lag)) +// show_progress(tree, 0); if (tree->parm->msg_lev >= GLP_MSG_ALL && xdifftime(xtime(), ttt) >= 60.0) { xlong_t total; @@ -1311,11 +1311,11 @@ more: /* minor loop starts here; at this is either to be solved for the first time or to be reoptimized due to reformulation */ /* display current progress of the search */ - if (tree->parm->msg_lev >= GLP_MSG_DBG || - tree->parm->msg_lev >= GLP_MSG_ON && - (double)(tree->parm->out_frq - 1) <= - 1000.0 * xdifftime(xtime(), tree->tm_lag)) - show_progress(tree, 0); +// if (tree->parm->msg_lev >= GLP_MSG_DBG || +// tree->parm->msg_lev >= GLP_MSG_ON && +// (double)(tree->parm->out_frq - 1) <= +// 1000.0 * xdifftime(xtime(), tree->tm_lag)) +// show_progress(tree, 0); if (tree->parm->msg_lev >= GLP_MSG_ALL && xdifftime(xtime(), ttt) >= 60.0) { xlong_t total; @@ -1480,8 +1480,8 @@ more: /* minor loop starts here; at this { if (tree->parm->msg_lev >= GLP_MSG_DBG) xprintf("New integer feasible solution found\n"); record_solution(tree); - if (tree->parm->msg_lev >= GLP_MSG_ON) - show_progress(tree, 1); +// if (tree->parm->msg_lev >= GLP_MSG_ON) +// show_progress(tree, 1); #if 0 write_sol(tree); #endif @@ -1705,8 +1705,8 @@ fath: /* the current subproblem has been goto loop; #endif done: /* display status of the search on exit from the solver */ - if (tree->parm->msg_lev >= GLP_MSG_ON) - show_progress(tree, 0); +// if (tree->parm->msg_lev >= GLP_MSG_ON) +// show_progress(tree, 0); #if 1 if (tree->mir_gen != NULL) ios_mir_term(tree->mir_gen), tree->mir_gen = NULL; diff -rupN glpk-4.39/src/glpipp02.c glpk-4.39patch/src/glpipp02.c --- glpk-4.39/src/glpipp02.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpipp02.c 2009-11-03 18:29:27.000000000 +0100 @@ -658,8 +658,8 @@ int ipp_basic_tech(IPP *ipp) } for (row = ipp->row_ptr; row != NULL; row = row->next) nrows--; for (col = ipp->col_ptr; col != NULL; col = col->next) ncols--; - xprintf("ipp_basic_tech: %d row(s) and %d column(s) removed\n", - nrows, ncols); +// xprintf("ipp_basic_tech: %d row(s) and %d column(s) removed\n", +// nrows, ncols); return 0; } @@ -884,9 +884,9 @@ loop: /* start a next pass for all activ } total += count; if (count > 0) goto loop; - xprintf( - "ipp_reduce_bnds: %d pass(es) made, %d bound(s) reduced\n", - pass, total); +// xprintf( +// "ipp_reduce_bnds: %d pass(es) made, %d bound(s) reduced\n", +// pass, total); return 0; } @@ -1213,8 +1213,8 @@ loop: /* start a next pass for all activ } total += count; if (count > 0) goto loop; - xprintf("ipp_reduce_coef: %d pass(es) made, %d coefficient(s) red" - "uced\n", pass, total); +// xprintf("ipp_reduce_coef: %d pass(es) made, %d coefficient(s) red" +// "uced\n", pass, total); return; } diff -rupN glpk-4.39/src/glplpx01.c glpk-4.39patch/src/glplpx01.c --- glpk-4.39/src/glplpx01.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glplpx01.c 2009-11-03 18:33:46.000000000 +0100 @@ -1212,8 +1212,8 @@ double lpx_get_real_parm(LPX *lp, int pa LPX *lpx_read_mps(const char *fname) { /* read problem data in fixed MPS format */ LPX *lp = lpx_create_prob(); - if (glp_read_mps(lp, GLP_MPS_DECK, NULL, fname)) - lpx_delete_prob(lp), lp = NULL; +// if (glp_read_mps(lp, GLP_MPS_DECK, NULL, fname)) +// lpx_delete_prob(lp), lp = NULL; return lp; } @@ -1249,8 +1249,8 @@ int lpx_write_bas(LPX *lp, const char *f LPX *lpx_read_freemps(const char *fname) { /* read problem data in free MPS format */ LPX *lp = lpx_create_prob(); - if (glp_read_mps(lp, GLP_MPS_FILE, NULL, fname)) - lpx_delete_prob(lp), lp = NULL; +// if (glp_read_mps(lp, GLP_MPS_FILE, NULL, fname)) +// lpx_delete_prob(lp), lp = NULL; return lp; } @@ -1323,7 +1323,7 @@ int lpx_is_b_avail(glp_prob *lp) int lpx_main(int argc, const char *argv[]) { /* stand-alone LP/MIP solver */ - return glp_main(argc, argv); +// return glp_main(argc, argv); } /* eof */ diff -rupN glpk-4.39/src/glpmps.c glpk-4.39patch/src/glpmps.c --- glpk-4.39/src/glpmps.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpmps.c 2009-11-06 21:36:26.000000000 +0100 @@ -70,7 +70,7 @@ static void check_parm(const char *func, * * SYNOPSIS * -* int glp_read_mps(glp_prob *P, int fmt, const glp_mpscp *parm, +* int glp_read_mps(int nRows, glp_prob *P, int fmt, const glp_mpscp *parm, * const char *fname); * * DESCRIPTION @@ -234,7 +234,8 @@ loop: /* read the very first character o strcmp(csa->field, "ENDATA") == 0)) error(csa, "invalid indicator record\n"); if (!name) - { while (csa->c != '\n') + { + while (csa->c != '\n') read_char(csa); } ret = 1; @@ -404,47 +405,36 @@ static void read_name(struct csa *csa) return; } -static void read_rows(struct csa *csa) +static void read_rows(int nRows, char *nameRows[], int typeRows[], + struct csa *csa) { /* read ROWS section */ int i, type; -loop: if (indicator(csa, 0)) goto done; - /* field 1: row type */ - read_field(csa), strspx(csa->field); - if (strcmp(csa->field, "N") == 0) - type = GLP_FR; - else if (strcmp(csa->field, "G") == 0) - type = GLP_LO; - else if (strcmp(csa->field, "L") == 0) - type = GLP_UP; - else if (strcmp(csa->field, "E") == 0) - type = GLP_FX; - else if (csa->field[0] == '\0') - error(csa, "missing row type in field 1\n"); - else - error(csa, "invalid row type in field 1\n"); - /* field 2: row name */ - read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - error(csa, "missing row name in field 2\n"); - if (glp_find_row(csa->P, csa->field) != 0) - error(csa, "row `%s' multiply specified\n", csa->field); + +int j; +for(j=0; j< nRows; j++){ i = glp_add_rows(csa->P, 1); - glp_set_row_name(csa->P, i, csa->field); - glp_set_row_bnds(csa->P, i, type, 0.0, 0.0); - /* fields 3, 4, 5, and 6 must be blank */ - skip_field(csa); - skip_field(csa); - skip_field(csa); - skip_field(csa); - goto loop; -done: return; + glp_set_row_name(csa->P, i, nameRows[j]); + glp_set_row_bnds(csa->P, i, typeRows[j], 0.0, 0.0); +} + +// j=indicator(csa,0); + return; } -static void read_columns(struct csa *csa) +static void read_columns( + int NStructVar, int NStructRows, int NRowsInWhichStructVarArePresent[NStructVar], // COLUMNS info + char *StructVarName[NStructVar],char *NameRowsInWhichStructVarArePresent[], // COLUMNS info + double *Coefficients, // COLUMNS info + struct csa *csa) { /* read COLUMNS section */ int i, j, f, len, kind = GLP_CV, *ind; double aij, *val; char name[255+1], *flag; + + + int k,l; + + /* allocate working arrays */ csa->work1 = ind = xcalloc(1+csa->P->m, sizeof(int)); csa->work2 = val = xcalloc(1+csa->P->m, sizeof(double)); @@ -452,100 +442,37 @@ static void read_columns(struct csa *csa memset(&flag[1], 0, csa->P->m); /* no current column exists */ j = 0, len = 0; -loop: if (indicator(csa, 0)) goto done; - /* field 1 must be blank */ - if (csa->deck) - { read_field(csa); - if (csa->field[0] != '\0') - error(csa, "field 1 must be blank\n"); - } - else - csa->fldno++; - /* field 2: column or kind name */ - read_field(csa), patch_name(csa, csa->field); - strcpy(name, csa->field); - /* field 3: row name or keyword 'MARKER' */ - read_field(csa), patch_name(csa, csa->field); - if (strcmp(csa->field, "'MARKER'") == 0) - { /* process kind data record */ - /* field 4 must be blank */ - if (csa->deck) - { read_field(csa); - if (csa->field[0] != '\0') - error(csa, "field 4 must be blank\n"); - } - else - csa->fldno++; - /* field 5: keyword 'INTORG' or 'INTEND' */ - read_field(csa), patch_name(csa, csa->field); - if (strcmp(csa->field, "'INTORG'") == 0) - kind = GLP_IV; - else if (strcmp(csa->field, "'INTEND'") == 0) - kind = GLP_CV; - else if (csa->field[0] == '\0') - error(csa, "missing keyword in field 5\n"); - else - error(csa, "invalid keyword in field 5\n"); - /* field 6 must be blank */ - skip_field(csa); - goto loop; - } - /* process column name specified in field 2 */ - if (name[0] == '\0') - { /* the same column as in previous data record */ - if (j == 0) - error(csa, "missing column name in field 2\n"); - } - else if (j != 0 && strcmp(name, csa->P->col[j]->name) == 0) - { /* the same column as in previous data record */ - xassert(j != 0); - } - else - { /* store the current column */ + + + +//---------- + + for(k=0;kP, j, len, ind, val); while (len > 0) flag[ind[len--]] = 0; } - /* create new column */ - if (glp_find_col(csa->P, name) != 0) - error(csa, "column `%s' multiply specified\n", name); j = glp_add_cols(csa->P, 1); glp_set_col_name(csa->P, j, name); glp_set_col_kind(csa->P, j, kind); - if (kind == GLP_CV) - glp_set_col_bnds(csa->P, j, GLP_LO, 0.0, 0.0); - else if (kind == GLP_IV) - glp_set_col_bnds(csa->P, j, GLP_DB, 0.0, 1.0); - else - xassert(kind != kind); - } - /* process fields 3-4 and 5-6 */ - for (f = 3; f <= 5; f += 2) - { /* field 3 or 5: row name */ - if (f == 3) - { if (csa->field[0] == '\0') - error(csa, "missing row name in field 3\n"); - } - else - { read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - { /* if field 5 is blank, field 6 also must be blank */ - skip_field(csa); - continue; - } - } - i = glp_find_row(csa->P, csa->field); - if (i == 0) - error(csa, "row `%s' not found\n", csa->field); - if (flag[i]) - error(csa, "duplicate coefficient in row `%s'\n", - csa->field); - /* field 4 or 6: coefficient value */ - aij = read_number(csa); - if (fabs(aij) < csa->parm->tol_mps) aij = 0.0; - len++, ind[len] = i, val[len] = aij, flag[i] = 1; - } - goto loop; + glp_set_col_bnds(csa->P, j, GLP_LO, 0.0, 0.0); + + for(l=0; lfield, NameRowsInWhichStructVarArePresent[k*NStructRows+l]); +// aij = Coefficients[k][l]; + int kk = k*NStructRows + l; // Here NStructRows is right!! NOT NRowsInWhichStructVarArePresent[k]! + aij = *(Coefficients+kk); + i = glp_find_row(csa->P, csa->field); + if (fabs(aij) < csa->parm->tol_mps) aij = 0.0; + len++, ind[len] = i, val[len] = aij, flag[i] = 1; + } + } + + +//----------------------- + done: /* store the last column */ if (j != 0) glp_set_mat_col(csa->P, j, len, ind, val); @@ -554,69 +481,42 @@ done: /* store the last column */ xfree(val); xfree(flag); csa->work1 = csa->work2 = csa->work3 = NULL; + +// indicator(csa,0); + + return; } -static void read_rhs(struct csa *csa) +static void read_rhs( + int nRows, double ValueB[nRows], char *nameRows[nRows], + struct csa *csa) { /* read RHS section */ int i, f, v, type; double rhs; char name[255+1], *flag; + + + + + int j; + + + /* allocate working array */ csa->work3 = flag = xcalloc(1+csa->P->m, sizeof(char)); memset(&flag[1], 0, csa->P->m); /* no current RHS vector exists */ v = 0; -loop: if (indicator(csa, 0)) goto done; - /* field 1 must be blank */ - if (csa->deck) - { read_field(csa); - if (csa->field[0] != '\0') - error(csa, "field 1 must be blank\n"); - } - else - csa->fldno++; - /* field 2: RHS vector name */ - read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - { /* the same RHS vector as in previous data record */ - if (v == 0) - { warning(csa, "missing RHS vector name in field 2\n"); - goto blnk; - } - } - else if (v != 0 && strcmp(csa->field, name) == 0) - { /* the same RHS vector as in previous data record */ - xassert(v != 0); - } - else -blnk: { /* new RHS vector */ - if (v != 0) - error(csa, "multiple RHS vectors not supported\n"); - v++; - strcpy(name, csa->field); - } - /* process fields 3-4 and 5-6 */ - for (f = 3; f <= 5; f += 2) - { /* field 3 or 5: row name */ - read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - { if (f == 3) - error(csa, "missing row name in field 3\n"); - else - { /* if field 5 is blank, field 6 also must be blank */ - skip_field(csa); - continue; - } - } - i = glp_find_row(csa->P, csa->field); - if (i == 0) - error(csa, "row `%s' not found\n", csa->field); - if (flag[i]) - error(csa, "duplicate right-hand side for row `%s'\n", - csa->field); - /* field 4 or 6: right-hand side value */ - rhs = read_number(csa); + + + +//--------- + strcpy(name,"BOUND"); + for(j=1; jfield,nameRows[j]); + i = glp_find_row(csa->P, csa->field); + rhs=ValueB[j-1]; if (fabs(rhs) < csa->parm->tol_mps) rhs = 0.0; type = csa->P->row[i]->type; if (type == GLP_FR) @@ -629,73 +529,44 @@ blnk: { /* new RHS vector */ else glp_set_row_bnds(csa->P, i, type, rhs, rhs); flag[i] = 1; - } - goto loop; + } + +// indicator(csa, 0); + + done: /* free working array */ xfree(flag); csa->work3 = NULL; return; } -static void read_ranges(struct csa *csa) +static void read_ranges( + int nRanges, double ValueRanges[], char* NameRanges[], // RANGES info + struct csa *csa) { /* read RANGES section */ int i, f, v, type; double rhs, rng; char name[255+1], *flag; + + + + + int j; + + + /* allocate working array */ csa->work3 = flag = xcalloc(1+csa->P->m, sizeof(char)); memset(&flag[1], 0, csa->P->m); /* no current RANGES vector exists */ v = 0; -loop: if (indicator(csa, 0)) goto done; - /* field 1 must be blank */ - if (csa->deck) - { read_field(csa); - if (csa->field[0] != '\0') - error(csa, "field 1 must be blank\n"); - } - else - csa->fldno++; - /* field 2: RANGES vector name */ - read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - { /* the same RANGES vector as in previous data record */ - if (v == 0) - { warning(csa, "missing RANGES vector name in field 2\n"); - goto blnk; - } - } - else if (v != 0 && strcmp(csa->field, name) == 0) - { /* the same RANGES vector as in previous data record */ - xassert(v != 0); - } - else -blnk: { /* new RANGES vector */ - if (v != 0) - error(csa, "multiple RANGES vectors not supported\n"); - v++; - strcpy(name, csa->field); - } - /* process fields 3-4 and 5-6 */ - for (f = 3; f <= 5; f += 2) - { /* field 3 or 5: row name */ - read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - { if (f == 3) - error(csa, "missing row name in field 3\n"); - else - { /* if field 5 is blank, field 6 also must be blank */ - skip_field(csa); - continue; - } - } - i = glp_find_row(csa->P, csa->field); - if (i == 0) - error(csa, "row `%s' not found\n", csa->field); - if (flag[i]) - error(csa, "duplicate range for row `%s'\n", csa->field); - /* field 4 or 6: range value */ - rng = read_number(csa); + +//------------------------------- + strcpy(name,"RANGE"); + for(j=0;jfield,NameRanges[j]); + i = glp_find_row(csa->P, csa->field); + rng = ValueRanges[j]; if (fabs(rng) < csa->parm->tol_mps) rng = 0.0; type = csa->P->row[i]->type; if (type == GLP_FR) @@ -721,28 +592,47 @@ blnk: { /* new RANGES vector */ else xassert(type != type); flag[i] = 1; + } - goto loop; +// indicator(csa, 0); +//------------------------------- + + + done: /* free working array */ xfree(flag); csa->work3 = NULL; return; } -static void read_bounds(struct csa *csa) +static void read_bounds(int nBounds,double BoundValue[], char *BoundStructVarName[], char *TypeofBound[], // BOUNDS info + struct csa *csa) { /* read BOUNDS section */ GLPCOL *col; int j, v, mask, data; double bnd, lb, ub; char type[2+1], name[255+1], *flag; + + + + + + int k; + + + + /* allocate working array */ csa->work3 = flag = xcalloc(1+csa->P->n, sizeof(char)); memset(&flag[1], 0, csa->P->n); /* no current BOUNDS vector exists */ v = 0; -loop: if (indicator(csa, 0)) goto done; - /* field 1: bound type */ - read_field(csa); + + +//--------------------------- + + for(k=0;kfield,TypeofBound[k]); if (strcmp(csa->field, "LO") == 0) mask = 0x01, data = 1; else if (strcmp(csa->field, "UP") == 0) @@ -766,47 +656,26 @@ loop: if (indicator(csa, 0)) goto done; else error(csa, "invalid bound type in field 1\n"); strcpy(type, csa->field); + /* field 2: BOUNDS vector name */ - read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - { /* the same BOUNDS vector as in previous data record */ - if (v == 0) - { warning(csa, "missing BOUNDS vector name in field 2\n"); - goto blnk; - } - } - else if (v != 0 && strcmp(csa->field, name) == 0) - { /* the same BOUNDS vector as in previous data record */ - xassert(v != 0); - } - else -blnk: { /* new BOUNDS vector */ - if (v != 0) - error(csa, "multiple BOUNDS vectors not supported\n"); - v++; - strcpy(name, csa->field); - } + strcpy(name,"Bounds"); + /* field 3: column name */ - read_field(csa), patch_name(csa, csa->field); - if (csa->field[0] == '\0') - error(csa, "missing column name in field 3\n"); + strcpy(csa->field,BoundStructVarName[k]); j = glp_find_col(csa->P, csa->field); - if (j == 0) - error(csa, "column `%s' not found\n", csa->field); - if ((flag[j] & mask) == 0x01) - error(csa, "duplicate lower bound for column `%s'\n", - csa->field); - if ((flag[j] & mask) == 0x10) - error(csa, "duplicate upper bound for column `%s'\n", - csa->field); xassert((flag[j] & mask) == 0x00); /* field 4: bound value */ if (data) - { bnd = read_number(csa); + { bnd = BoundValue[k]; if (fabs(bnd) < csa->parm->tol_mps) bnd = 0.0; } else read_field(csa), bnd = 0.0; + + + + + /* get current column bounds */ col = csa->P->col[j]; if (col->type == GLP_FR) @@ -860,23 +729,39 @@ blnk: { /* new BOUNDS vector */ else glp_set_col_bnds(csa->P, j, GLP_FX, lb, ub); flag[j] |= (char)mask; - /* fields 5 and 6 must be blank */ - skip_field(csa); - skip_field(csa); - goto loop; + + + } + +// indicator(csa, 0); +//--------------------------- + + + + + done: /* free working array */ xfree(flag); csa->work3 = NULL; return; } -int glp_read_mps(glp_prob *P, int fmt, const glp_mpscp *parm, +int glp_read_mps( + int nRows, char *nameRows[], int typeRows[], // ROWS info + int NStructVar, int NStructRows, int NRowsInWhichStructVarArePresent[], // COLUMNS info + char *StructVarName[],char *NameRowsInWhichStructVarArePresent[], // COLUMNS info + double *Coefficients, // COLUMNS info + double ValueB[], // RHS info + int nRanges, double ValueRanges[], char* NameRanges[], // RANGES info + int nBounds, double BoundValue[], char *BoundStructVarName[], char *TypeofBound[], // BOUNDS info + glp_prob *P, int fmt, const glp_mpscp *parm, const char *fname) -{ /* read problem data in MPS format */ +{ + /* read problem data in MPS format */ glp_mpscp _parm; struct csa _csa, *csa = &_csa; int ret; - xprintf("Reading problem data from `%s'...\n", fname); +// xprintf("Reading problem data from `%s'...\n", fname); if (!(fmt == GLP_MPS_DECK || fmt == GLP_MPS_FILE)) xerror("glp_read_mps: fmt = %d; invalid parameter\n", fmt); if (parm == NULL) @@ -904,26 +789,29 @@ int glp_read_mps(glp_prob *P, int fmt, c glp_erase_prob(P); glp_create_index(P); /* open input MPS file */ - csa->fp = xfopen(fname, "r"); - if (csa->fp == NULL) - { xprintf("Unable to open `%s' - %s\n", fname, xerrmsg()); - ret = 1; - goto done; - } +// csa->fp = xfopen(fname, "r"); +// if (csa->fp == NULL) +// { xprintf("Unable to open `%s' - %s\n", fname, xerrmsg()); +// ret = 1; +// goto done; +// } /* read NAME indicator record */ - read_name(csa); - if (P->name != NULL) - xprintf("Problem: %s\n", P->name); +// read_name(csa); +// if (P->name != NULL) +// xprintf("Problem: %s\n", P->name); /* read ROWS section */ - if (!(indicator(csa, 0) && strcmp(csa->field, "ROWS") == 0)) - error(csa, "missing ROWS indicator record\n"); - read_rows(csa); +// if (!(indicator(csa, 0) && strcmp(csa->field, "ROWS") == 0)) +// error(csa, "missing ROWS indicator record\n"); + read_rows(nRows, nameRows , typeRows ,csa); + + /* determine objective row */ if (parm->obj_name == NULL || parm->obj_name[0] == '\0') { /* use the first row of N type */ int i; for (i = 1; i <= P->m; i++) - { if (P->row[i]->type == GLP_FR) + { + if (P->row[i]->type == GLP_FR) { csa->obj_row = i; break; } @@ -946,13 +834,18 @@ int glp_read_mps(glp_prob *P, int fmt, c parm->obj_name); } if (csa->obj_row != 0) - { glp_set_obj_name(P, P->row[csa->obj_row]->name); - xprintf("Objective: %s\n", P->obj); + { + glp_set_obj_name(P, P->row[csa->obj_row]->name); +// xprintf("Objective: %s\n", P->obj); } /* read COLUMNS section */ - if (strcmp(csa->field, "COLUMNS") != 0) - error(csa, "missing COLUMNS indicator record\n"); - read_columns(csa); +// if (strcmp(csa->field, "COLUMNS") != 0) +// error(csa, "missing COLUMNS indicator record\n"); + read_columns( + NStructVar, NStructRows, NRowsInWhichStructVarArePresent, // COLUMNS info + StructVarName, NameRowsInWhichStructVarArePresent, // COLUMNS info + Coefficients, // COLUMNS info + csa); /* set objective coefficients */ if (csa->obj_row != 0) { GLPAIJ *aij; @@ -960,22 +853,27 @@ int glp_read_mps(glp_prob *P, int fmt, c aij->r_next) glp_set_obj_coef(P, aij->col->j, aij->val); } /* read optional RHS section */ - if (strcmp(csa->field, "RHS") == 0) - read_rhs(csa); +// if (strcmp(csa->field, "RHS") == 0) + read_rhs(nRows, ValueB, nameRows, + csa); /* read optional RANGES section */ - if (strcmp(csa->field, "RANGES") == 0) - read_ranges(csa); +// if (strcmp(csa->field, "RANGES") == 0) + read_ranges(nRanges,ValueRanges,NameRanges, // RANGES info + csa); /* read optional BOUNDS section */ - if (strcmp(csa->field, "BOUNDS") == 0) - read_bounds(csa); +// if (strcmp(csa->field, "BOUNDS") == 0) + read_bounds( nBounds, BoundValue, BoundStructVarName, TypeofBound, // BOUNDS info + csa); /* read ENDATA indicator record */ - if (strcmp(csa->field, "ENDATA") != 0) - error(csa, "invalid use of %s indicator record\n", - csa->field); +// if (strcmp(csa->field, "ENDATA") != 0) +// error(csa, "invalid use of %s indicator record\n", +// csa->field); /* print some statistics */ - xprintf("%d row%s, %d column%s, %d non-zero%s\n", - P->m, P->m == 1 ? "" : "s", P->n, P->n == 1 ? "" : "s", - P->nnz, P->nnz == 1 ? "" : "s"); +// xprintf("%d row%s, %d column%s, %d non-zero%s\n", +// P->m, P->m == 1 ? "" : "s", P->n, P->n == 1 ? "" : "s", +// P->nnz, P->nnz == 1 ? "" : "s"); + +/* if (glp_get_num_int(P) > 0) { int ni = glp_get_num_int(P); int nb = glp_get_num_bin(P); @@ -986,7 +884,8 @@ int glp_read_mps(glp_prob *P, int fmt, c xprintf("One variable is binary\n"); } else - { xprintf("%d integer variables, ", ni); + { + xprintf("%d integer variables, ", ni); if (nb == 0) xprintf("none"); else if (nb == 1) @@ -998,7 +897,8 @@ int glp_read_mps(glp_prob *P, int fmt, c xprintf(" of which %s binary\n", nb == 1 ? "is" : "are"); } } - xprintf("%d records were read\n", csa->recno); +*/ +// xprintf("%d records were read\n", csa->recno); /* problem data has been successfully read */ glp_delete_index(P); lpx_order_matrix(P); diff -rupN glpk-4.39/src/glpscl.c glpk-4.39patch/src/glpscl.c --- glpk-4.39/src/glpscl.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpscl.c 2009-11-03 18:38:58.000000000 +0100 @@ -390,14 +390,14 @@ static void scale_prob(glp_prob *lp, int { static const char *fmt = "%s: min|aij| = %10.3e max|aij| = %10.3e ratio = %10.3e\n"; double min_aij, max_aij, ratio; - xprintf("Scaling...\n"); +// xprintf("Scaling...\n"); /* cancel the current scaling effect */ glp_unscale_prob(lp); /* report original scaling "quality" */ min_aij = min_mat_aij(lp, 1); max_aij = max_mat_aij(lp, 1); ratio = max_aij / min_aij; - xprintf(fmt, " A", min_aij, max_aij, ratio); +// xprintf(fmt, " A", min_aij, max_aij, ratio); /* check if the problem is well scaled */ if (min_aij >= 0.10 && max_aij <= 10.0) { xprintf("Problem data seem to be well scaled\n"); @@ -410,7 +410,7 @@ static void scale_prob(glp_prob *lp, int min_aij = min_mat_aij(lp, 1); max_aij = max_mat_aij(lp, 1); ratio = max_aij / min_aij; - xprintf(fmt, "GM", min_aij, max_aij, ratio); +// xprintf(fmt, "GM", min_aij, max_aij, ratio); } /* perform equilibration scaling, if required */ if (flags & GLP_SF_EQ) @@ -418,7 +418,7 @@ static void scale_prob(glp_prob *lp, int min_aij = min_mat_aij(lp, 1); max_aij = max_mat_aij(lp, 1); ratio = max_aij / min_aij; - xprintf(fmt, "EQ", min_aij, max_aij, ratio); +// xprintf(fmt, "EQ", min_aij, max_aij, ratio); } /* round scale factors to nearest power of two, if required */ if (flags & GLP_SF_2N) @@ -430,7 +430,7 @@ static void scale_prob(glp_prob *lp, int min_aij = min_mat_aij(lp, 1); max_aij = max_mat_aij(lp, 1); ratio = max_aij / min_aij; - xprintf(fmt, "2N", min_aij, max_aij, ratio); +// xprintf(fmt, "2N", min_aij, max_aij, ratio); } done: return; } diff -rupN glpk-4.39/src/glpspx01.c glpk-4.39patch/src/glpspx01.c --- glpk-4.39/src/glpspx01.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpspx01.c 2009-11-03 18:40:52.000000000 +0100 @@ -2386,8 +2386,8 @@ static void display(struct csa *csa, con } if (type[k] == GLP_FX) cnt++; } - xprintf("%c%6d: obj = %17.9e infeas = %10.3e (%d)\n", - phase == 1 ? ' ' : '*', csa->it_cnt, eval_obj(csa), sum, cnt); +// xprintf("%c%6d: obj = %17.9e infeas = %10.3e (%d)\n", +// phase == 1 ? ' ' : '*', csa->it_cnt, eval_obj(csa), sum, cnt); csa->it_dpy = csa->it_cnt; skip: return; } @@ -2772,8 +2772,8 @@ loop: /* main loop starts here */ d_stat = (csa->q == 0 ? GLP_FEAS : GLP_INFEAS); break; case 2: - if (parm->msg_lev >= GLP_MSG_ALL) - xprintf("OPTIMAL SOLUTION FOUND\n"); +// if (parm->msg_lev >= GLP_MSG_ALL) +// xprintf("OPTIMAL SOLUTION FOUND\n"); p_stat = d_stat = GLP_FEAS; break; default: diff -rupN glpk-4.39/src/glpspx02.c glpk-4.39patch/src/glpspx02.c --- glpk-4.39/src/glpspx02.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpspx02.c 2009-11-03 18:43:15.000000000 +0100 @@ -2434,12 +2434,12 @@ static void display(struct csa *csa, con cnt = 0; for (i = 1; i <= m; i++) if (orig_type[head[i]] == GLP_FX) cnt++; - if (csa->phase == 1) - xprintf(" %6d: %24s infeas = %10.3e (%d)\n", - csa->it_cnt, "", sum, cnt); - else - xprintf("|%6d: obj = %17.9e infeas = %10.3e (%d)\n", - csa->it_cnt, eval_obj(csa), sum, cnt); +// if (csa->phase == 1) +// xprintf(" %6d: %24s infeas = %10.3e (%d)\n", +// csa->it_cnt, "", sum, cnt); +// else +// xprintf("|%6d: obj = %17.9e infeas = %10.3e (%d)\n", +// csa->it_cnt, eval_obj(csa), sum, cnt); csa->it_dpy = csa->it_cnt; skip: return; } diff -rupN glpk-4.39/src/glpssx02.c glpk-4.39patch/src/glpssx02.c --- glpk-4.39/src/glpssx02.c 2009-07-26 11:00:00.000000000 +0200 +++ glpk-4.39patch/src/glpssx02.c 2009-11-03 18:49:17.000000000 +0100 @@ -131,16 +131,22 @@ int ssx_phase_I(SSX *ssx) ssx_eval_pi(ssx); ssx_eval_cbar(ssx); /* display initial progress of the search */ - show_progress(ssx, 1); +// show_progress(ssx, 1); /* main loop starts here */ for (;;) { /* display current progress of the search */ + +/* + #if 0 if (utime() - ssx->tm_lag >= ssx->out_frq - 0.001) #else if (xdifftime(xtime(), ssx->tm_lag) >= ssx->out_frq - 0.001) #endif - show_progress(ssx, 1); +;// show_progress(ssx, 1); + +*/ + /* we do not need to wait until all artificial variables have left the basis */ if (mpq_sgn(bbar[0]) == 0) @@ -242,7 +248,7 @@ int ssx_phase_I(SSX *ssx) ssx->it_cnt++; } /* display final progress of the search */ - show_progress(ssx, 1); +// show_progress(ssx, 1); /* restore components of the original problem, which were changed by the routine */ for (k = 1; k <= m+n; k++) @@ -281,16 +287,23 @@ int ssx_phase_I(SSX *ssx) int ssx_phase_II(SSX *ssx) { int ret; /* display initial progress of the search */ - show_progress(ssx, 2); +// show_progress(ssx, 2); /* main loop starts here */ for (;;) { /* display current progress of the search */ + +/* + #if 0 if (utime() - ssx->tm_lag >= ssx->out_frq - 0.001) #else if (xdifftime(xtime(), ssx->tm_lag) >= ssx->out_frq - 0.001) #endif - show_progress(ssx, 2); +; // show_progress(ssx, 2); + +*/ + + /* check if the iterations limit has been exhausted */ if (ssx->it_lim == 0) { ret = 2; @@ -346,7 +359,7 @@ int ssx_phase_II(SSX *ssx) ssx->it_cnt++; } /* display final progress of the search */ - show_progress(ssx, 2); +// show_progress(ssx, 2); /* return to the calling program */ return ret; } diff -rupN glpk-4.39/src/libglpk.la glpk-4.39patch/src/libglpk.la --- glpk-4.39/src/libglpk.la 1970-01-01 01:00:00.000000000 +0100 +++ glpk-4.39patch/src/libglpk.la 2009-11-06 21:37:17.000000000 +0100 @@ -0,0 +1,41 @@ +# libglpk.la - a libtool library file +# Generated by libtool (GNU libtool 1.3087 2008-08-02) 2.2.7a +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='libglpk.so.0' + +# Names of this library. +library_names='libglpk.so.0.24.0 libglpk.so.0 libglpk.so' + +# The name of the static archive. +old_library='libglpk.a' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -lm' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libglpk. +current=24 +age=24 +revision=0 + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/local/lib'