From e72fc3c67ebbfe589d65ae9ce4703e18c95ff283 Mon Sep 17 00:00:00 2001 From: Azzaare Date: Thu, 25 Mar 2021 22:57:49 +0900 Subject: [PATCH 1/2] Fix rand --- src/intervals.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intervals.jl b/src/intervals.jl index 33b656f..a857ae1 100644 --- a/src/intervals.jl +++ b/src/intervals.jl @@ -35,7 +35,7 @@ function b_ismore(i₁, i₂) b₁ = value(i₁, :b) b₂ = value(i₂, :b) return b₁ == b₂ ? closed(i₁, :b) || opened(i₂, :b) : b₁ > b₂ -end +end b_isless(i₁, i₂) = b_ismore(i₂, i₁) @@ -50,7 +50,7 @@ Base.length(i::Interval) = 1 Base.size(i::Interval) = value(i, :b) - value(i, :a) Base.isempty(i::Interval) = size(i) == 0 && (opened(i, :a) || opened(i, :b)) Base.ndims(::Interval) = 1 -Base.rand(i::Interval) = rand() * length(i) + value(i, :a) +Base.rand(i::Interval) = rand() * size(i) + value(i, :a) mutable struct IntervalsFold{T <: Real} <: PatternFold{T, Interval{T}} pattern::Interval{T} From 7c8e19508e30bc8b2aa4e95c6605e06a7ce42d44 Mon Sep 17 00:00:00 2001 From: Azzaare Date: Thu, 25 Mar 2021 23:01:22 +0900 Subject: [PATCH 2/2] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ffbd698..722e0f6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "PatternFolds" uuid = "c18a7f1d-76ad-4ce4-950d-5419b888513b" authors = ["Jean-Francois Baffier"] -version = "0.1.4" +version = "0.1.5" [deps] Lazy = "50d2b5c4-7a5e-59d5-8109-a42b560f39c0"