Skip to content

Commit

Permalink
fix dist calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
francescoalemanno committed Apr 4, 2022
1 parent a8cb9ce commit 83078c4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "KissSmoothing"
uuid = "23b0397c-cd08-4270-956a-157331f0528f"
authors = ["Francesco Alemanno <francescoalemanno710@gmail.com>"]
version = "1.0.1"
version = "1.0.2"

[deps]
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Expand Down
Binary file modified rbf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/KissSmoothing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ function tps(r)
end

function dist(x, y)
mapreduce(+, x, y) do a, b
sqrt(mapreduce(+, x, y) do a, b
abs2(a - b)
end
end)
end

struct RBF{G<:AbstractArray{Float64},C<:AbstractArray{Float64}}
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ end
fn = fit_rbf(t,y,LinRange(0,2pi,20))
pred_y = fn(t)
error = sqrt(sum(abs2, pred_y .- y)/length(t))
@test error < 0.0005
@test error < 0.0006
end

0 comments on commit 83078c4

Please sign in to comment.