Re: [julia-users] Problem with if else in Julia

2015-05-16 Thread Tim Holy
If you don't need the square root, sumabs2 is even more efficient and can work over dimensions. --Tim On Saturday, May 16, 2015 06:05:06 AM Dominique Orban wrote: > It seems you're trying to compute a dot product. Try dot(M[:,1], M[:,1]) or > norm(M[:,1]). Of course, as a side comment, that quan

[julia-users] Problem with if else in Julia

2015-05-16 Thread Dominique Orban
It seems you're trying to compute a dot product. Try dot(M[:,1], M[:,1]) or norm(M[:,1]). Of course, as a side comment, that quantity can't be negative ;).

[julia-users] Problem with if else in Julia

2015-05-15 Thread Lytu
When i do: M=rand(5,5) a=M[:,1]' * M[:,1] if a<0 println("Less than 0") else println("more") end I have an error: " isless has no method matching isless(::Array{Float64,2}, ::Int 32) in < at operators.jl:32 Can anyone tell me please how to do this? Thank you