Skip to content

Commit

Permalink
Add in testing of different input types
Browse files Browse the repository at this point in the history
  • Loading branch information
richardreeve committed Nov 30, 2023
1 parent e8e4983 commit 9da0398
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/test_dists.jl
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,8 @@ end # testset
@test (@inferred corr_dist(x, y)) cosine_dist(x .- mean(x), vec(y) .- mean(y))
@test (@inferred chisq_dist(x, y)) == sum((x - vec(y)).^2 ./ (x + vec(y)))
@test (@inferred spannorm_dist(x, y)) == maximum(x - vec(y)) - minimum(x - vec(y))
@test (@inferred kl_divergence(x, y)) sum(x[i] * log(x[i] / y[i]) for i in eachindex(x, y))
@test (@inferred gkl_divergence(x, y)) sum(x[i] * log(x[i] / y[i]) - x[i] + y[i] for i in eachindex(x, y))
@test (@inferred meanad(x, y)) mean(Float64[abs(x[i] - y[i]) for i in eachindex(x, y)])
@test (@inferred msd(x, y)) mean(Float64[abs2(x[i] - y[i]) for i in eachindex(x, y)])
@test (@inferred rmsd(x, y)) sqrt(msd(x, y))
Expand Down

0 comments on commit 9da0398

Please sign in to comment.