toy-lib-0.1.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Vector.CSum

Description

Cumulative sum in one dimension.

Synopsis

Documentation

csum1D :: (Num a, Unbox a) => Vector a -> Vector a #

\(O(N)\) Immutable cumulative sum initialization. The first element is a guard.

(+!) :: (HasCallStack, Num a, Unbox a) => Vector a -> (Int, Int) -> a #

\(O(1)\) Retrieves a range sum from an immutable cumulative sum.

newCSumU :: (PrimMonad m, Num a, Unbox a) => Int -> m (MVector (PrimState m) a) #

\(O(N)\) Initialization of a mutable cumulative sum.

readCSum :: (PrimMonad m, Num a, MVector v a) => v (PrimState m) a -> Int -> Int -> m a #

\(O(1)\) The cumulative sum vector has a guard at index zero while l and r are zero-based.

appendCSum :: (PrimMonad m, Num a, MVector v a) => v (PrimState m) a -> Int -> a -> m () #

\(O(1)\) The cumulative sum vector has len + 1 element (guard).