Skip to content

Commit 4cd1ae6

Browse files
authored
Cleanup of ellipticLCS.jl (#70)
1 parent 7377c30 commit 4cd1ae6

File tree

5 files changed

+82
-198
lines changed

5 files changed

+82
-198
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "CoherentStructures"
22
uuid = "0c1513b4-3a13-56f1-9cd2-8312eaec88c4"
3-
version = "0.3.6"
3+
version = "0.4.0"
44

55
[deps]
66
ArnoldiMethod = "ec485272-7323-5ecc-a04f-4719b315124d"

src/dynamicmetrics.jl

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,7 @@ end
275275
Return a sparse distance matrix as determined by the sparsification method `sp_method`
276276
and `metric`.
277277
"""
278-
function spdist(
279-
data::AbstractArray{<:SVector},
280-
sp_method::Neighborhood,
281-
metric::Dists.PreMetric = Distances.Euclidean(),
282-
)
278+
function spdist(data, sp_method::Neighborhood, metric::Dists.PreMetric = Distances.Euclidean())
283279
N = length(data) # number of states
284280
data = vec(data)
285281
# TODO: check for better leafsize values
@@ -292,11 +288,7 @@ function spdist(
292288
Vs = fill(1.0, length(Is))
293289
return sparse(Is, Js, Vs, N, N, *)
294290
end
295-
function spdist(
296-
data::AbstractVector{<:SVector},
297-
sp_method::Union{KNN,MutualKNN},
298-
metric::Dists.PreMetric = Distances.Euclidean(),
299-
)
291+
function spdist(data, sp_method::Union{KNN,MutualKNN}, metric::Dists.PreMetric = Distances.Euclidean())
300292
N = length(data) # number of states
301293
data = vec(data)
302294
# TODO: check for better leafsize values
@@ -315,11 +307,7 @@ function spdist(
315307
return min.(D, permutedims(D))
316308
end
317309
end
318-
function spdist(
319-
data::AbstractArray{<:AbstractArray{<:SVector}},
320-
sp_method::Neighborhood,
321-
metric::STmetric,
322-
)
310+
function spdist(data, sp_method::Neighborhood, metric::STmetric)
323311
N = length(data) # number of trajectories
324312
T = Dists.result_type(metric, first(data), first(data))
325313
I1 = collect(1:N)
@@ -352,11 +340,7 @@ function spdist(
352340
Vs = vcat(V1, getindex.(IJV, 3)...)
353341
return sparse(Is, Js, Vs, N, N)
354342
end
355-
function spdist(
356-
data::AbstractArray{<:AbstractArray{<:SVector}},
357-
sp_method::Union{KNN,MutualKNN},
358-
metric::STmetric,
359-
)
343+
function spdist(data, sp_method::Union{KNN,MutualKNN}, metric::STmetric)
360344
data = vec(data)
361345
N, k = length(data), sp_method.k
362346
Is = repeat(1:N, inner=k+1)

0 commit comments

Comments
 (0)