aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-30 15:59:25 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-12-30 15:59:25 -0500
commit579bcc03f6b2033c89446f3ec8fbd01d49f487ad (patch)
tree7d6275cd5a97fb43691a0282d5fc784b86cd91c9 /src
parent248c15ba7c69a37c186819c11cb7d98bea36b3c7 (diff)
Clean up identity computation and restrict to right inverses
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn12
1 files changed, 10 insertions, 2 deletions
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≥=𝕨