From e4634b49f32a8040eb1113f7c5f470aec20d8bb6 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 31 Jul 2020 13:23:54 -0400 Subject: =?UTF-8?q?Lookup-based=20=E2=81=BC=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- impl.bqn | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'impl.bqn') diff --git a/impl.bqn b/impl.bqn index 026c03f3..558ef06b 100644 --- a/impl.bqn +++ b/impl.bqn @@ -392,6 +392,20 @@ OccurrenceCount ← ⊐˜(⊢-⊏)⍋∘⍋ ProgressiveIndexOf ← {𝕨⊐○(≍˘⟜OccurrenceCount𝕨⊸⊐)𝕩} ⊒ ← OccurrenceCount⊘ ProgressiveIndexOf +inverse ← {(⊑(0⊏𝕩)⊐<) ⊑ ((1⊏𝕩)∾⟨!∘0⟩)˜} ⍉ (2∾˜2÷˜≠)⊸⥊ ⟨ + +, +⊘(-˜) + -, - + ×, ⊢⊘(÷˜) + ÷, ÷ + ⋆, Log + √, ⋆⟜2⊘(⋆˜) + ∧, ⊢⊘(÷˜) + ∨, ⊢⊘(-˜÷1-⊢) + <, {!IsArray𝕩⋄!0==𝕩⋄⊑𝕩}⊘(!∘0) + /, {!(⍋≡↕∘≠)𝕩⋄≠¨⊔𝕩}⊘(!∘0) +⟩ +⁼ ← {Inverse 𝕗} + _repeat_←{ n←𝕨𝔾𝕩 l←u←0 -- cgit v1.2.3