Skip to content

Commit

Permalink
Add comment on applicability of sparse method
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapeyre committed Dec 2, 2021
1 parent 9b05b6f commit 93fa138
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/metrics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ end
eval_op_a(d, ai, b) = eval_op(d, ai, zero(eltype(b)))
eval_op_b(d, bi, a) = eval_op(d, zero(eltype(a)), bi)

# It is assumed that eval_reduce(d, s, eval_op(d, zero(eltype(a)), zero(eltype(b)))) == s
# This justifies ignoring all terms where both inputs are zero.
Base.@propagate_inbounds function _evaluate(d::UnionMetrics, a::SparseVectorUnion, b::SparseVectorUnion, ::Nothing)
@boundscheck if length(a) != length(b)
throw(DimensionMismatch("first array has length $(length(a)) which does not match the length of the second, $(length(b))."))
Expand Down

0 comments on commit 93fa138

Please sign in to comment.