Closed as not planned
Description
Views of weights are not <:AbstractWeight
They are only <:AbstractVector
This messes with some dispatches.
For example:
julia> w = eweights(20,0.3);
julia> mean(1:10, w[1:10])
7.957353087579495
julia> mean(1:10, @view w[1:10])
ERROR: MethodError: objects of type UnitRange{Int64} are not callable
julia> mean_and_std(1:10, @view w[1:10])
ERROR: MethodError: no method matching mean_and_std(::UnitRange{Int64}, ::SubArray{Float64,1,Weights{Float64,Float64,Array{Float64,1}},Tuple{UnitRange{Int64}},false})
Work-around is to use:
AnalyticWeights(@view w[1:10])
A possible solution is to overload the functions the create views and make then return subtypes of AbstractWeight
Metadata
Metadata
Assignees
Labels
No labels