diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-10-01 23:18:15 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-10-01 23:18:15 +0200 |
commit | 948cae3ca7279040627db393e4372a668f8a22f7 (patch) | |
tree | 89eae02aeba1f0bdc30a938c82dc3dfef06cd4af /src/Array.hs | |
parent | 1f13bc80915a26473e0622c4afa65c8276b396ff (diff) |
Reverse-by-forward, and checking neural (it's wrong)
Diffstat (limited to 'src/Array.hs')
-rw-r--r-- | src/Array.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Array.hs b/src/Array.hs index c939419..8507544 100644 --- a/src/Array.hs +++ b/src/Array.hs @@ -45,6 +45,9 @@ emptyShape :: SNat n -> Shape n emptyShape SZ = ShNil emptyShape (SS m) = emptyShape m `ShCons` 0 +enumShape :: Shape n -> [Index n] +enumShape sh = map (fromLinearIndex sh) [0 .. shapeSize sh - 1] + -- | TODO: this Vector is a boxed vector, which is horrendously inefficient. data Array (n :: Nat) t = Array (Shape n) (Vector t) |