On Wednesday, 22 October 2014 21:38:39 UTC-6, Mike wrote:
>
> I'd like to be able to do linear programming to arbitrary precision.  The 
> documentation that I've found claims that both the glpk  and PPL solvers 
> should do this, but I haven't been able to get either to work.
>
> As an example, the following code prints c to high precision, but the 
> solutions only to 12 digits.  Where should I look for guidance?
> Note: this seeks to maximize x+y given that 3x<=1 and 3y<=1, so the 
> solution is (1/3, 1/3)
>
> Mike M
>
> R=RealField(100)
> c=Matrix(R, 2, 1, [-1, -1])
> G=Matrix(R, 2, 2, [3, 0, 0, 3])
> h=Matrix(R, 2, 1, [1, 1])
> print c  # To check the precision being used by "print"
> print
>
> sol=linear_program(c,G,h)
> print sol['x']
> sol=linear_program(c,G,h, solver='glpk')
> print sol['x']
> sol=linear_program(c,G,h, solver='PPL')
> print sol['x']
>
>
My "straightforward" simplex method for teaching can handle this one 
correctly:

http://sagecell.sagemath.org/?z=eJxljUGLwjAQhe-F_oeHe0kgLa2ee60XhVL3JoukSdwOGxNJIui_31hkYRHeDLx58_HGbjTS9mSsZm3T8LJQ3V6mQHc2CqwFWoFjlVfVfuVw-z_MOm4EmkWb58P8TudZ2Gsgl6CAD3x6qNmoH6TZ4BqMokjeYTLkvnGLRmN6YLUAqxdYFmUxoMNuGIKfrLkcknRaBt37cGFbgbm2FBPjAqxS_GX-aof6TE7akyaVcpUMD8brSUZSp-jt7Xlj_BfTdE8X&lang=sage

It can get pretty bad on degenerate problems, however, since it assumes all 
computations are exact even when they are not.

Andrey

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to