I am initializing a MVector
and MMatrix
from StaticArrays
inside a function as follows
function test(v::Vector{T}) where{T<:Real}
n = length(v)
myvec = MVector{n, T}(undef)
mymat = MMatrix{n, n, T}(undef)
...
end
If I do
v=[1.0, 2.0]
@code_warntype test(v)
I get output that begins
Static Parameters
T = Float64
Arguments
#self#::Core.Const(test)
v::Vector{Float64}
Locals
mymat::Any
myvec::MArray{_A, Float64, 1} where _A<:Tuple
n::Int64
Body::Any
What am I doing wrong when I initialize my vector and matrix? Thanks.