4 ms·
Yes, in julia A = rand(2,2) is a matrix, and reshape(A,:) is a vector view of the same continuous block of memory. You may also index A[i] directly, as if it we
by improbable22 8y ago
Yes, in julia A = rand(2,2) is a matrix, and reshape(A,:) is a vector view of the same continuous block of memory. You may also index A[i] directly, as if it were a vector; eachindex(A) is an iterator which uses whichever style of indexing is going to be quickest (and in cache-friendly order).