File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 33
44# Extract real
55R ↚ ◌°ℂ
6- # Floating point epsilon
7- ε ← 2.2204460492503131e-16
86
97# -- Averages --
108
@@ -32,16 +30,22 @@ GaussEliminate‼ ↚ ∧(
3230 ⊢⍖⊸⌵⍜⊙↙×0⟜⊡⤚⊸⊙⍉
3331 ⍜⊏⇌ ⊃⊙⊙∘^0 ⊟⤙⊙⊙∘ ⊙(⊃⋅⊙∘^1 ⍤.≥ε⊸⌵) ⟜⊡
3432 ⊸⍜⊡(÷⊸⊡:),
35- ⍜(°⊂↻|⊙-: ⊸⊞×: ⊙(⊡⤚˜⊙⍉)),
33+ ⍜(°⊂↻|𝄐⌞-˜ ⊸⊞×⊙(⊡⤚˜⊙⍉)),
3634)°⊏
3735
3836# Matrix Determinant
39- MDet ← ◌⍣GaussEliminate‼(⍥¯/≠⊙⋅⋅∘|×⊙⋅⋅∘)⊙0 ⊙1
37+ MDet ← ◌⍣GaussEliminate‼(⍥¯𝄐𝄐/≠)𝄐𝄐× ⊙0 ⊙1
4038
4139# Perform Gauss-Jordan elimination
4240Mgje ← ⍣GaussEliminate‼(|)(⍤"Elimination cannot be completed"0)
4341# Matrix Inverse
44- MInv ← ⌅(⍜⍉(↘÷2⊸⧻) ⍣Mgje(⍤"Matrix has no inverse"0) ≡⊂:⊞=.°⊏)
42+ MInv ← ⌅(⍜⍉(↘÷2⊸⧻) ⍣Mgje(⍤"Matrix has no inverse"0) ˜≡⊂˙⊞=°⊏)
43+
44+ ┌─╴test
45+ ⍤⤙≍ 5 ⁅₃ MDet [1_¯3_¯1 1_¯1_¯2 1_0_0]
46+ ⍤⤙≍ [0_0_1 ¯0.4_0.2_0.2 0.2_¯0.6_0.4] ⁅₃ MInv [1_¯3_¯1 1_¯1_¯2 1_0_0]
47+ ⍤⤙≍ ˙⊞=⇡3 ⁅₃ Mgje [1_¯3_¯1 1_¯1_¯2 1_0_0]
48+ └─╴
4549
4650MSquarify ↚ ⍜△[.√⊢]
4751# Matrix Cofactors
@@ -387,5 +391,5 @@ RPFFT ← ⌅(⍥(⍉fft)⧻△.|⍥°(⍉fft)⧻△.)
387391 Valid ← ⍥R=0↥⊃∩type(↘-+1⌵⊙⟜(×√/×⊸△⍜∩RPFFT×∩⌞⬚0↙)⊃-↥◡∩△)
388392 # Convolution that maintains the shape of the larger input
389393 # **CURRENTLY UNIMPLEMENTED** - PR welcome
390- Same ← ⍤"Not yet implemented (make a PR?) "0 ⋅∘
394+ Same ← ⍤"Not yet implemented"0 ⋅∘
391395└─╴
You can’t perform that action at this time.
0 commit comments