Skip to content

Commit

Permalink
Remove internal method _funcweightedmean
Browse files Browse the repository at this point in the history
Instead deploy it as a method for `mean`
  • Loading branch information
itsdebartha committed Dec 17, 2023
1 parent f9984f8 commit c1768a6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/weights.jl
Original file line number Diff line number Diff line change
Expand Up @@ -697,10 +697,7 @@ w = rand(n)
mean(√, x, weights(w))
```
"""
mean(f, A::AbstractArray, w::AbstractWeights) =
_funcweightedmean(f, A, w)

function _funcweightedmean(f, A::AbstractArray, w::AbstractWeights)
function mean(f, A::AbstractArray, w::AbstractWeights)
return sum(Broadcast.instantiate(Broadcast.broadcasted(A, w) do a_i, wg
return f(a_i) * wg
end)) / sum(w)
Expand Down

0 comments on commit c1768a6

Please sign in to comment.