2 ms·
Not a Julia expert, but these snippets don’t strike me as very idiomatic or algorithmically sound [1]. What they seem to do, instead, is to demonstrate that yo
by FabHK 5y ago
Not a Julia expert, but these snippets don’t strike me as very idiomatic or algorithmically sound [1].
What they seem to do, instead, is to demonstrate that you can write code in Julia that is quite close to the mathematical notation. (Whether you should do so is another question).
[1] for example, adding a row of ones to a matrix by using array comprehension:
𝐗 = [j==0 ? 1.0 : X[i][j] for i in 1:m, j in 0:n]
or solving a linear system by multiplying with the (pseudo-)inverse:
𝛉 = pinv(𝐗)\*y