The Floats type used here is a union of AbstractFloats and Complex and is a very sensible type for the goals of this package. Unfortunately that union is not quite general enough to include Unitful vectors because such vector's elements are subtypes of Number not of AbstractFloat. So simple methods like vscale! do not apply as currently written. MWE:
using LazyAlgebra
using Unitful: m
x = ones(5) * 1m
vscale!(x, 2)
ERROR: MethodError: no method matching vscale!(::Vector{Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}, ::Int64, ::Vector{Quantity{Float64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}})
It probably would be a major undertaking to support Unitful vectors here, so I am not really advocating for that.
But I am just reporting the issue here because it is relevant to another PR elsewhere:
emmt/LinearInterpolators.jl#9
The
Floatstype used here is a union of AbstractFloats and Complex and is a very sensible type for the goals of this package. Unfortunately that union is not quite general enough to include Unitful vectors because such vector's elements are subtypes ofNumbernot ofAbstractFloat. So simple methods likevscale!do not apply as currently written. MWE:It probably would be a major undertaking to support Unitful vectors here, so I am not really advocating for that.
But I am just reporting the issue here because it is relevant to another PR elsewhere:
emmt/LinearInterpolators.jl#9