Skip to content

Commit 23a2309

Browse files
committed
Massive speedup of reconstruction!
Solved a bit "constant propagation" missunderstanding I had
1 parent 4b218c3 commit 23a2309

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/reconstruction.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ Systems and Turbulence*, Lecture Notes in Mathematics **366**, Springer (1981)
103103
"""
104104
@inline function reconstruct(s::AbstractVector{T}, D, τ) where {T}
105105
de::DelayEmbedding{D} = DelayEmbedding(Val{D}(), τ)
106+
return reconstruct(s, de)
107+
end
108+
@inline function reconstruct(s::AbstractVector{T}, de::DelayEmbedding{D}) where {T, D}
106109
L = length(s) - maximum(de.delays)
107110
data = Vector{SVector{D+1, T}}(undef, L)
108111
@inbounds for i in 1:L
@@ -170,6 +173,12 @@ end
170173
D, τ) where {A, B, T, M}
171174

172175
de::MTDelayEmbedding{D, B, D*B} = MTDelayEmbedding(D, τ, B)
176+
reconstruct(s, de)
177+
end
178+
@inline function reconstruct(
179+
s::Union{AbstractDataset{B, T}, SizedArray{Tuple{A, B}, T, 2, M}},
180+
de::MTDelayEmbedding{D, B, F}) where {A, B, T, M, D, F}
181+
173182
L = size(s)[1] - maximum(de.delays)
174183
X = (D+1)*B
175184
data = Vector{SVector{X, T}}(undef, L)

0 commit comments

Comments
 (0)