From 20bab87530324e64fda9771df92224a0593b1ef9 Mon Sep 17 00:00:00 2001 From: Datseris Date: Sun, 22 Sep 2024 23:30:16 +0100 Subject: [PATCH] correct usage of size --- src/corrsum_based/correlationsum_boxassisted.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corrsum_based/correlationsum_boxassisted.jl b/src/corrsum_based/correlationsum_boxassisted.jl index 459bccd..83166b1 100644 --- a/src/corrsum_based/correlationsum_boxassisted.jl +++ b/src/corrsum_based/correlationsum_boxassisted.jl @@ -62,7 +62,7 @@ exact to the original [`correlationsum`](@ref). For any other `P`, some point pairs that should have been included may be skipped due to having smaller distance in the remaining dimensions, but larger distance in the first `P` dimensions. """ -function boxed_correlationsum(X; P = 2, kwargs...) +function boxed_correlationsum(X::AbstractStateSpaceSet; P = 2, kwargs...) P = min(P, dimension(X)) r0, ε0 = estimate_r0_buenoorovio(X, P) εs = 2.0 .^ range(log2(ε0), log2(r0); length = 16) @@ -75,7 +75,7 @@ boxed_correlationsum(X, e::Real, r0 = e; kwargs...) = boxed_correlationsum(X, [e function boxed_correlationsum( X, εs, r0 = maximum(εs); q = 2, P = 2, kwargs... ) - P ≤ size(X, 2) || error("Prism dimension has to be ≤ than `X` dimension.") + P ≤ dimension(X) || error("Prism dimension has to be ≤ than `X` dimension.") issorted(εs) || error("Sorted `εs` required for optimized version.") if r0 < maximum(εs) @warn("Box size `r0` has to be ≥ than `maximum(εs)`.")