It turns out that doesn't actually matter but there are other unrelated ill-typed variables in the code:
Xb, o, y, r, e, Nj, ind, q, t I haven't determined why this is happening, but something is ill-typed here. On Wed, Nov 26, 2014 at 1:20 PM, Tim Holy <tim.h...@gmail.com> wrote: > Stefan's point is more relevant than you realize; if the type of the > variable > is uncertain, the loop will be very slow. You can make that resize > operation a > separate function, from which you call your main routine. > > --Tim > > On Wednesday, November 26, 2014 09:26:35 AM Emerson Vitor Castelani wrote: > > Humm, It's useful but I guess that the problem is something in loop > while... > > > > Em quarta-feira, 26 de novembro de 2014 15h05min03s UTC-2, Stefan > Karpinski > > > > escreveu: > > > I'm not sure if this is the problem, but changing the type of a > variable > > > in a function body causes problems for type inference. For that reason, > > > the > > > first two lines of this code may cause performance issue if you call > this > > > with b and c as matrices. A more Julian idiom for this is to do > something > > > like this: > > > > > > function simplex(A::Matrix, b::Vector, c::Vector) > > > > > > (m,n) = size(A); > > > ... > > > > > > end > > > simplex(A::Matrix, b::Matrix, c::Matrix) = simplex(A, vec(b), vec(c)) > > > > > > > > > This also avoids copying the data of b and c needlessly. > > > > > > On Wednesday, November 26, 2014, Emerson Vitor Castelani < > > > > > > emerso...@gmail.com <javascript:>> wrote: > > >> Have you considered the example scsd8.mat? > > >> > > >> Em quarta-feira, 26 de novembro de 2014 14h39min14s UTC-2, Pileas > > >> > > >> escreveu: > > >>> Result with tic() toc() at the very beginning and at the very end: > > >>> > > >>> elapsed time: 0.025719973 seconds > > >>> > > >>> > > >>> Τη Τετάρτη, 26 Νοεμβρίου 2014 11:06:26 π.μ. UTC-5, ο χρήστης Emerson > > >>> > > >>> Vitor Castelani έγραψε: > > >>>> Well, I am tried to implement a simple version of simplex in Julia > and > > >>>> I have had some troubles. In Julia, my algorithm spends about 30 sec > > >>>> and in > > >>>> matlab/octave 3 sec for the same problem. So, I saw some tips in > order > > >>>> to > > >>>> get a better performance but the best that I got in Julia was 17-20 > > >>>> sec. > > >>>> The codes are in attachment. I am new in Julia and the algorithms > are > > >>>> little roughly implemented but they are very similar. > > >>>> > > >>>> Thanks > >