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, 1//1, 0//1, 1//1, 1//1, 1//1, 0//1]

c = [c, repmat([0//1], size(b)[1])] # surely clumsy

M = [1//1 1//1 1//1 0//1 0//1 0//1 0//1 0//1 0//1;

    0//1 0//1 0//1 1//1 1//1 1//1 0//1 0//1 0//1;

    0//1 0//1 0//1 0//1 0//1 0//1 1//1 1//1 1//1;

    1//1 0//1 0//1 1//1 0//1 0//1 1//1 0//1 0//1;

    0//1 1//1 0//1 0//1 1//1 0//1 0//1 1//1 0//1;

    0//1 0//1 1//1 0//1 0//1 1//1 0//1 0//1 1//1]

Id = zeros(Rational{Int64}, size(M)[1], size(M)[1])

for i in 1:size(M)[1]

        Id[i,i] = 1//1

end

M = hcat(M, Id)


julia> simplex(c, :Min, M, b, ['=','=','=','=','=','='])

(:Optimal,[1//7,0//1,0//1,0//1,1//4,0//1,0//1,0//1,1//2,0//1,1//28,1//14,*3//28*,0//1,0//1])




Le jeudi 17 avril 2014 05:07:29 UTC+2, Iain Dunning a écrit :
>
> 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 my blog 
>> post<http://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 real 
>> nightmare.
>>
>

Reply via email to