From d68f37cb27271521c76adffdb824d689056721d6 Mon Sep 17 00:00:00 2001 From: jedlimlx Date: Sun, 12 May 2024 20:25:27 +0800 Subject: [PATCH] Incomplete attempt to implement strobing rules --- src/commonMain/kotlin/search/cfind/CFind.kt | 14 ++++++++++++++ src/jvmMain/kotlin/Main.jvm.kt | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/commonMain/kotlin/search/cfind/CFind.kt b/src/commonMain/kotlin/search/cfind/CFind.kt index 9fbccba..00bde7b 100644 --- a/src/commonMain/kotlin/search/cfind/CFind.kt +++ b/src/commonMain/kotlin/search/cfind/CFind.kt @@ -152,6 +152,19 @@ class CFind( } } + // Computing the background for strobing rules + val background = IntArray(this.period * maxOf(this.k, 1)) { -1 }.apply { + // Compute the offsets + var count = 0 + var index = 0 + while (count < period * k) { + val rem = count % period + for (i in 0 ..