iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.SegTree.Dual

Synopsis

Documentation

data DualSegTree s f a Source #

a need not to be Semigroup

Constructors

DualSegTree 

Fields

buildDualSegTree :: (Monoid f, Unbox f, Unbox a, PrimMonad m) => Vector a -> m (DualSegTree (PrimState m) f a) Source #

O(n)

freezeDualSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> m (Vector a) Source #

O(n)

readDualSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> m a Source #

O(log n)

writeDualSegTree :: (MonoidAction f a, Unbox a, Unbox f, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> a -> m () Source #

O(log n)

modifyDualSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> (a -> a) -> Int -> m () Source #

O(log n)

appAt :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> f -> m () Source #

modify f k O(log n)

appFromTo :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> Int -> f -> m () Source #

mapM_ (modify f) [l..r) O(log n)

evalAt :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> f -> m () Source #

O(1)

pushSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> m () Source #

O(1)