Reputation: 1041
I am using GLPK for solving a minimization linear programming problem in octave. its giving me some variable values like 0.0000000000277
or 0.999999999999
. I want to get that 0.0000000000277
as 0
and that 0.999999999999
as 1
. Does GLPK has any option for doing this? Any help will be really appreciated.
Upvotes: 2
Views: 238
Reputation: 22516
GLPK has an option called Solution Rounding which you can set to round off tiny values 0. Look for Solution Rounding among these options in GLPK.
However, for other values you will have to do a bit of post-processing by writing some code.
If 0.9 < x < 1.1, set x = 1 etc.
Upvotes: 3