Why am I copying?

In the implicit convert(Array{T,N}, ...) in the constructor of C. Note typeof(r) below.

julia> r = reshape(view(rand(9), :), 3, 3)
3×3 reshape(view(::Vector{Float64}, :), 3, 3) with eltype Float64:
 0.466486  0.796616   0.138344
 0.882214  0.651785   0.149842
 0.744935  0.0729783  0.0731422

julia> convert(Matrix{Float64}, r)
3×3 Matrix{Float64}:
 0.466486  0.796616   0.138344
 0.882214  0.651785   0.149842
 0.744935  0.0729783  0.0731422
2 Likes