Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
slice :: (Slice sh, Shape sh, Elt a) => Int -> Int -> Array (sh :. Int) a -> Array (sh :. Int) a
slice from to array =
fromFunction (z :. (to - from + 1)) (\(z :. ix) -> array ! (z :. (ix + from)))
where (z :. _) = extent array
cumsum ::
(FullShape uf ~ uf,
Slice uf,
Slice (SliceShape uf),
Shape uf,
Shape (SliceShape uf),
Elt a,
Num a) =>
Array (uf :. Int) a -> Array (uf :. Int) a
cumsum array = traverse array id $ cumsum' array
where
cumsum' array f (sh :. outer) =
Repa.sumAll $
Surf.slice 0 outer $
Repa.slice array (sh :. All)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.