diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-02 21:01:23 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-05-02 21:01:23 -0400 |
| commit | 85e745dd832e5386bfa17e7c44e3192a1e8227ca (patch) | |
| tree | 6f66054fcbbdf9f5876682631e680514345ecbe5 /src/r1.bqn | |
| parent | 07d50a2aaf4ff2bd9487af08077de950275b264d (diff) | |
Slightly quicker test for natural numbers
Diffstat (limited to 'src/r1.bqn')
| -rw-r--r-- | src/r1.bqn | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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˙ |
