From 85e745dd832e5386bfa17e7c44e3192a1e8227ca Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 2 May 2021 21:01:23 -0400 Subject: Slightly quicker test for natural numbers --- src/r1.bqn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/r1.bqn b/src/r1.bqn index 160618c9..4c073ade 100644 --- a/src/r1.bqn +++ b/src/r1.bqn @@ -11,7 +11,7 @@ SetPrims ← {Decompose‿PrimInd ↩ 𝕩} IsArray ← 0=Type IsAtom ← 1≤Type Int ← (1=Type)◶⟨0,⌊⊸=⟩ -Nat ← (1=Type)◶⟨0,0⊸≤×⌊⊸=⟩ +Nat ← (1=Type)◶⟨0,|∘⌊⊸=⟩ ToArray ← <⍟IsAtom IsSimple ← 1×´IsAtom⌜ Deshape ← IsArray◶{𝕩Fill⟨𝕩⟩}‿⥊ @@ -304,7 +304,7 @@ RepInd←(2⌊=∘⊣)◶{ {e+↩r⋄1+𝕩}⍟{e=𝕨}˜`↕r×𝕩 }‿{ "𝕨/𝕩: Lengths of components of 𝕨 must match 𝕩" ! 𝕩=≠𝕨 - "𝕨/𝕩: Amounts to replicate must be natural numbers" ! 1×´(0⊸≤×⌊⊸=)⌜𝕨 + "𝕨/𝕩: Amounts to replicate must be natural numbers" ! 1×´|∘⌊⊸=⌜𝕨 Ind 𝕨 }‿{ "𝕨/𝕩: Replication argument must have rank 0 or 1" ! 0˙ -- cgit v1.2.3