Re: [julia-users] Re: How to use GLPK.exact ?

2014-05-02 Thread 'Stéphane Laurent' via julia-users
Thank you everybody, almost every point discussed here is now written on my blog http://stla.github.io/stlapblog/posts/KantorovichWithJulia.html.

Re: [julia-users] Re: How to use GLPK.exact ?

2014-05-02 Thread Miles Lubin
Looks good! On Friday, May 2, 2014 12:55:49 PM UTC-4, Stéphane Laurent wrote: Thank you everybody, almost every point discussed here is now written on my blog http://stla.github.io/stlapblog/posts/KantorovichWithJulia.html.

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-23 Thread Stéphane Laurent
Right, it works. Thank you. If I don't call GLPKMathProgInterface, does JuMP use an internal solver ? Le mardi 22 avril 2014 23:25:07 UTC+2, Carlo Baldassi a écrit : Note that you can still use GLPK.exact with JuMP, you just need to add change the m=Model() line to this: using

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-23 Thread Miles Lubin
On Wednesday, April 23, 2014 3:40:02 PM UTC-4, Stéphane Laurent wrote: If I don't call GLPKMathProgInterface, does JuMP use an internal solver ? If a solver isn't specified, JuMP (actually MathProgBase) will search for an available solver and pick one by default. JuMP does not have an

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-22 Thread Stéphane Laurent
Miles, I have successfully installed JuMP and GLPKMathProgInterface on Windows 32-bit. Your code works very well, this is really awesome !! However the result is not as precise as the one given by *GLPK.exact*. using JuMP mu = [1/7, 2/7, 4/7] nu = [1/4, 1/4, 1/2] n = length(mu) m =

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-22 Thread Miles Lubin
Cool! Glad to hear you got it working. Supporting exact coefficients in JuMP is technically possible, and I've opened an issue for it: https://github.com/JuliaOpt/JuMP.jl/issues/162. This will probably remain on the wishlist for a while. On Tuesday, April 22, 2014 2:28:01 PM UTC-4, Stéphane

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-22 Thread Carlo Baldassi
Note that you can still use GLPK.exact with JuMP, you just need to add change the m=Model() line to this: using GLPKMathProgInterface m = Model(solver=GLPKSolverLP(method=:Exact)) while all the rest stays the same. As an aside, it's really kind of annoying that GLPK.exact uses (basically)

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-21 Thread Stéphane Laurent
My blog post is updated. Iain, I have tried your code with the example of my blog. I see the good result in the output (*3//28*), but I don't understand how to know it is the good one. using RationalSimplex using Base.Test b = [1//7, 2//7, 4//7, 1//4, 1//4, 1//2] c = [0//1, 1//1, 1//1,

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-17 Thread Carlo Baldassi
Stéphane, sorry for the confusion (I should have made myself clearer before), but the new version of the blog post is not correct, in that the difference between 1-X and 1.-X has nothing to do with Int64 vs Float64, but rather with the difference between the operators `-` (minus) and `.-`

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-17 Thread Stéphane Laurent
Thank you Iain I will try your solver soon I hope. And thank you again Carlo, I will update my post.

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-16 Thread Iain Dunning
I implemented a version of simplex method for rational numbers - so you solve it exactly in pure Julia. https://github.com/IainNZ/RationalSimplex.jl Not for serious work - just for fun! On Saturday, April 12, 2014 11:50:26 AM UTC-4, Stéphane Laurent wrote: Thank you everybody. I have updated

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-16 Thread Miles Lubin
Where's the MathProgBase interface? :) On Wed, Apr 16, 2014 at 11:07 PM, Iain Dunning iaindunn...@gmail.com wrote: I implemented a version of simplex method for rational numbers - so you solve it exactly in pure Julia. https://github.com/IainNZ/RationalSimplex.jl Not for serious work - just

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-12 Thread Stéphane Laurent
Thank you everybody. I have updated my blog posthttp://stla.github.io/stlapblog/posts/KantorovichWithJulia.html, especially to include Carlo's comments. Unfortunately I have some problems to use JuMP (I have opened another discussion about it). And installing pycddlib on Windows 64bit is a

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Thank you for these precious informations. The JuMP package looks very awesome, I hope to give it a try soon. There was a Julia age during which BigInt(3)/BigInt(28) was equal to the BigRational 3/28, why this feature has been removed ? It would be too long to explain what my R appli here

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Miles Lubin
By the way for another problem I need to get the vertices of the polyhedron defined by the linear constraints, as with the cddlib library, do you know how I could get that ? Enumerating vertices requires a very different algorithm from optimizing over polyhedra. The best way to do this

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Tony Kelman
Unless I'm blind and just can't find one, it appears there is not yet a solid high-dimensional computational geometry package for Julia, like cddlib or the Multi-Parametric Toolbox for Matlab. I imagine a wrapper around cddlib would be fairly easy to write (perhaps even autogenerated), or you

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Carlo Baldassi
There was a Julia age during which BigInt(3)/BigInt(28) was equal to the BigRational 3/28, why this feature has been removed ? I don't think that command ever worked like that actually; in order to get Rational values, you need to use a double-slash // in stead of a single slash: big(3) //

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Again, thank you for all these answers. Sorry Carlo, I missed the double slash in your previous answer. It would be a good opportunity for me to call Python in order to train my skills in Python in addition to Julia. But what do you suggest me to call pycddlib with PyCall rather than calling

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Stéphane Laurent
Again, thank you for all these answers. Sorry Carlo, I missed the double slash in your previous answer. It would be a good opportunity for me to call Python in order to train my skills in Python in addition to Julia. But why do you suggest me to call pycddlib with PyCall rather than calling

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-10 Thread Joey Huchette
Either approach should work in principle (pycddlib vs. cddlib), but I suspect that the Python wrapper is higher-level, and will be easier to use from Julia. For reference, here's a snippet of how you might calculate the extreme points as rationals, calling pycddlib from Julia (adapted from code

[julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Stéphane Laurent
Hello guys, I hope you'll enjoy this article on my bloghttp://stla.github.io/stlapblog/posts/KantorovichWithJulia.html . If you're able to use GNU MP on your machine, would you be able to find *3/28* ? Any other comment is welcomed !

[julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Ivar Nesje
You might be exited when you find out that you can use μ, ν, M₁ and M₂ as variable names in Julia, because we support UTF-8. Sometimes it might give more readable code, when you compare it to the math texts. Ivar kl. 19:08:19 UTC+2 onsdag 9. april 2014 skrev Stéphane Laurent følgende:

[julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Carlo Baldassi
Hi Stéphane, nice post! I have a number of comments and suggestions which you may find useful. I accompanied these comments with some demo code, you can find here https://gist.github.com/carlobaldassi/10312215. A) Generic to Julia A.1) as Ivar said, you can use Unicode characters if you want;

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Carlo Baldassi
About GLPK.exact it is not possible to get the rational number 3/28 instead of a decimal approximation ? No, unfortunately. Also, for that to happen/make sense, you'd also need to be able to pass all the *inputs* as exact rational values, i.e. as 1//7 instead of 1/7. This would be possible if

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Iain Dunning
Todo: right generic simplex implementation - it'd be so easy in Julia! On Wednesday, April 9, 2014 6:18:26 PM UTC-4, Carlo Baldassi wrote: About GLPK.exact it is not possible to get the rational number 3/28 instead of a decimal approximation ? No, unfortunately. Also, for that to

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Miles Lubin
When we have a simplex solver (either in Julia or external) that supports rational inputs, we could consider making this work with JuMP, but for now JuMP stores all data as floating-point as well. Stephane, nice work. LP definitely needs more exposure in the probability community. Please

Re: [julia-users] Re: How to use GLPK.exact ?

2014-04-09 Thread Tony Kelman
Another semi-hacky option here is using a conventional double-precision LP solver to tell you the active set at the solution the solver considered optimal (up to whatever its tolerance was set to). Then you can take that active set and solve the arbitrary-precision version of the constraint

[julia-users] Re: How to use GLPK.exact ?

2014-04-08 Thread Stéphane Laurent
Hello Iain, I don't understand what you mean : *julia versioninfo()* *Julia Version 0.2.0* *Commit 05c6461 (2013-11-16 23:44 UTC)* *Platform Info:* * System: Windows (x86_64-w64-mingw32)* * WORD_SIZE: * *julia * *64* *julia * * BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH

[julia-users] Re: How to use GLPK.exact ?

2014-04-08 Thread Carlo Baldassi
Unfortunately, from insepcting GLPK source code it seems that whether to use GNU MP or GLPK bignum is decided at compile time. So it appears that the Windows binaries which are automatically downloaded by the Julia package are just not compiled with GNU MP. As far as I can tell, the options

[julia-users] Re: How to use GLPK.exact ?

2014-04-08 Thread Tony Kelman
It looks like those GLPK binaries are Visual Studio builds, and as I understand it recent versions of GMP are difficult if not impossible to compile with Visual Studio. In fact GMP was forked into MPIR (http://www.mpir.org/#about), with one major motivation being MSVC support. MPIR might be

[julia-users] Re: How to use GLPK.exact ?

2014-04-08 Thread Stéphane Laurent
Thank you for your answers. Unfortunately, (pre)-compiled binaries, dll, etc, is like Chinese for me. Moreover when you talk about GLP I don't know if you talk about the C library or the julia Package. Currently I was just trying GLPK for fun so this is not important. Thank you again.

[julia-users] Re: How to use GLPK.exact ?

2014-04-07 Thread Iain Dunning
I strongly recommend you update to Julia 0.2 at least and use the dedicated GLPK package https://github.com/JuliaOpt/GLPK.jl - I'm sure you'll get much better support. Version 0.1 of Julia (which had inbuilt GLPK - I had forgotten!) isn't supported anymore. How did you get version 0.1?