In the past, when I only had R, Mathematica, Octave, Python, etc., I strongly felt the need for this:
function f(mat::AbstractMatrix{T}, u::AbstractVector{T})::AbstractMatrix where {T<:Real}
Julia introduces types to data science in a higher level.
#JuliaLang@JuliaLanguage
I’m going to just add Panama c bindings and wait for vector api to improve. I’m not sure how tbh since creating new vectors happens deep in AbstractVector
#Julia言語docs.julialang.org/en/v1/man…
一般に
❌
struct Foo
a
end
❌
struct Foo{T}
a::AbstractVector{T}
end
❌
struct Foo
a::Vector
end
のような書き方は型不安定になるので避けた方がよい。
⭕️
struct Foo{T, Ta<:AbstractVector{T}}
a::Ta
end
なら大丈夫。