From 579bcc03f6b2033c89446f3ec8fbd01d49f487ad Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 30 Dec 2020 15:59:25 -0500 Subject: Clean up identity computation and restrict to right inverses --- src/r.bqn | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/r.bqn b/src/r.bqn index adc9b3eb..7e8a7ec1 100644 --- a/src/r.bqn +++ b/src/r.bqn @@ -1,6 +1,5 @@ # BQN runtime. Requires: # Type Decompose Glyph GetFill Log GroupLen GroupOrd !+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘ -Decompose Glyph ◶ ← {𝕨((𝕨𝔽𝕩)⊑𝕘){𝔽}𝕩} # LIMITED to number left operand result @@ -327,7 +326,16 @@ _onAxes_←{ + ↩ + _perv - ↩ - _perv ¬ ← 1+- -identity ← (0⊑⟨"´: Identity not found"!0˜⟩) {(0⊑𝕨){𝕗=𝕩}◶𝕩‿(1⊑𝕨)}´ ⟨+‿0,-‿0,×‿1,÷‿1,⋆‿1,√‿1,∧‿1,∨‿0,¬‿1,|‿0,⌊‿∞,⌈‿¯∞,<‿0,≤‿1,=‿1,≥‿1,>‿0,≠‿0⟩ +identity ← {(0⊑𝕨)˙⊸=◶𝕩‿(1⊑𝕨)}´ ⟨ + +‿0 , -‿0 + ×‿1 , ÷‿1 + ⋆‿1 , ¬‿1 + ⌊‿∞ , ⌈‿¯∞ + ∨‿0 , ∧‿1 + ≠‿0 , =‿1 + >‿0 , ≥‿1 + "´: Identity not found"!0˙ +⟩ Reshape←{ "𝕨⥊𝕩: 𝕨 must have rank at most 1" ! 1≥=𝕨 -- cgit v1.2.3