[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] [Fwd: output format]
From: |
glpk xypron |
Subject: |
Re: [Help-glpk] [Fwd: output format] |
Date: |
Thu, 10 Nov 2011 04:38:21 +0100 |
Hello Rachid,
> To: address@hidden, address@hidden, address@hidden
It is sufficient to address address@hidden
Please, register at https://lists.gnu.org/mailman/listinfo/help-glpk
> I want to have an output of this type
>
> variable = value
>
> is it possible?
To my understanding you are currently using the standalone solver
glpsol to read a file in CPLEX format and writing the solution to
a file, e.g.
glpk-4.47\w32\glpsol.exe --lp test.lp -o test.sol
Instead you could use the GMPL file format as described in
glpk-4.47\doc\gmpl.pdf
In GMPL you can format the output as you need it with the printf
statement, e.g.
printf "n1 = %f\n", n1;
You can also use the printf statement to write to a file:
printf "n1 = %f\n", n1 >> filename;
If you want to stick to the LP file format for the problem formulation,
you can use the GLPK library to write a program in C that does the job.
Language bindings for Java and Python and other languages are available.
http://en.wikibooks.org/wiki/GLPK/Language_Bindings
The documentation for the library is in
glpk-4.47\doc\glpk.pdf
The manuals are available in the GLPK source distribution
ftp://ftp.gnu.org/gnu/glpk/glpk-4.47.tar.gz
Best regards
Xypron
> -------- Forwarded Message --------
> Subject: output format
> Date: Wed, 9 Nov 2011 13:58:03 +0100
>
> my model is written so
>
> \Problem Name : typage DLAL
> Minimize
> obj:n1 + n2 + n3 + n4 + n5
>
> Subject To
> c1:p1 + n3 + n1 >= 0
> c2:p2 - p4 = 0
> c3:p3 - p4 - n5 = 0
> c4:p1 - n4 = 0
> c5:p4 + n5 >= 0
> c6:p1 + n3 >= 0
> c7:n4 + n1 >= 0
> c8:n2 + n1 >= 0
>
> Bounds
> n1 >= 0
> n3 = 0
> n5 = 0
> p2 >= 0
> p3 >= 0
> p1 >= 0
> n2 = 0
> n4 >= 0
> p4 >= 0
>
> integer
> n1
> n2
> n3
> n4
> n5
> p1
> p2
> p3
> p4
>
> end
>
>
> When we solved the command
>
> Problem:
> Rows: 8
> Columns: 9 (9 integer, 0 binary)
> Non-zeros: 18
> Status: INTEGER OPTIMAL
> Objective: obj = 0 (MINimum)
>
> No. Row name Activity Lower bound Upper bound
> ------ ------------ ------------- ------------- -------------
> 1 c1 0 0
> 2 c2 0 0 =
> 3 c3 0 0 =
> 4 c4 0 0 =
> 5 c5 0 0
> 6 c6 0 0
> 7 c7 0 0
> 8 c8 0 0
>
> No. Column name Activity Lower bound Upper bound
> ------ ------------ ------------- ------------- -------------
> 1 n1 * 0 0
> 2 n2 * 0 0 =
> 3 n3 * 0 0 =
> 4 n4 * 0 0
> 5 n5 * 0 0 =
> 6 p1 * 0 0
> 7 p2 * 0 0
> 8 p4 * 0 0
> 9 p3 * 0 0
>
> Integer feasibility conditions:
>
> KKT.PE: max.abs.err = 0.00e+00 on row 0
> max.rel.err = 0.00e+00 on row 0
> High quality
>
> KKT.PB: max.abs.err = 0.00e+00 on row 0
> max.rel.err = 0.00e+00 on row 0
> High quality
>
> End of output
>
>
> I want to have an output of this type
>
> variable = value
>
> is it possible?
>
> thanks
>
>
>
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-glpk
--
Follow me at http://twitter.com/#!/xypron
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de