I wrote a program that works fine but has several hard-coded types (Float64, etc.) which I’m now trying to get rid of, because they get in the way of automatic differentiation.
I’ve hit a snag with the following: I initialise a matrix before a for
loop, and then fill it one row at a time. My original initialisation step was
cext = Array{Float64}(undef,(3,4))
for (...)
cext[ii,:] = ...
end
How would I got about this, without specifying the type Float64 in the constructor? I don’t mind if the results are temporarily stored in a different container (vector of rows), but again I’m not sure of the syntax to use (Vector(undef,3)
works, but I’m not sure if it’s a good idea as the size isn’t meaningfully allocated). The matrix isn’t too big, rows and columns in the hundreds typically.