apl: outer product ∘.f (+12 tests, 151/151)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 53s

This commit is contained in:
2026-05-06 21:41:15 +00:00
parent 3489c9f131
commit 4332b4032f
3 changed files with 114 additions and 2 deletions

View File

@@ -996,3 +996,23 @@
(get a :ravel)
(get b :ravel)))
(error "length error: shape mismatch"))))))
(define
apl-outer
(fn
(f a b)
(let
((a-shape (get a :shape))
(b-shape (get b :shape))
(a-ravel (get a :ravel))
(b-ravel (get b :ravel)))
(make-array
(append a-shape b-shape)
(flatten
(map
(fn
(x)
(map
(fn (y) (disclose (f (apl-scalar x) (apl-scalar y))))
b-ravel))
a-ravel))))))