diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-12-30 15:59:25 -0500 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-12-30 15:59:25 -0500 |
| commit | 579bcc03f6b2033c89446f3ec8fbd01d49f487ad (patch) | |
| tree | 7d6275cd5a97fb43691a0282d5fc784b86cd91c9 /src | |
| parent | 248c15ba7c69a37c186819c11cb7d98bea36b3c7 (diff) | |
Clean up identity computation and restrict to right inverses
Diffstat (limited to 'src')
| -rw-r--r-- | src/r.bqn | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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≥=𝕨 |
