Skip to content

Commit

Permalink
Simple constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed May 25, 2020
1 parent f235e11 commit c10d9be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/distance_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ end
Base.@kwdef struct FastDTW{D} <: DTWDistance{D}
radius::Int
dist::D = SqEuclidean()
FastDTW(r, dist=SqEuclidean()) = new{typeof(dist)}(r, dist)
end


Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ using Distances, Plots
@test soft_dtw_cost(Float64.(a),Float64.(b), γ=0.0001) cost rtol = 1e-2
@test soft_dtw_cost(Float64.(a),Float64.(b), γ=0.0001) == SoftDTW(0.0001)(a,b)

a = zeros(Int, 6)
a = zeros(6)
b = 1 .+ a
cost, match1, match2 = dtw(a, b)
@test dtw_cost(a, b, SqEuclidean(), length(a)) == cost
Expand Down

0 comments on commit c10d9be

Please sign in to comment.