Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data DualSegTree s f a = DualSegTree {
- dualSegTreeDST :: !(MVector s f)
- primalsDST :: !(MVector s a)
- dualSizeDST :: !Int
- primalSizeDST :: !Int
- heightDST :: !Int
- buildDualSegTree :: (Monoid f, Unbox f, Unbox a, PrimMonad m) => Vector a -> m (DualSegTree (PrimState m) f a)
- freezeDualSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> m (Vector a)
- readDualSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> m a
- writeDualSegTree :: (MonoidAction f a, Unbox a, Unbox f, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> a -> m ()
- modifyDualSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> (a -> a) -> Int -> m ()
- appAt :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> f -> m ()
- appFromTo :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> Int -> f -> m ()
- evalAt :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> f -> m ()
- pushSegTree :: (MonoidAction f a, Unbox f, Unbox a, PrimMonad m) => DualSegTree (PrimState m) f a -> Int -> m ()
- extendToPowerOfTwo :: Int -> Int
Documentation
data DualSegTree s f a Source #
a
need not to be Semigroup
DualSegTree | |
|
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)
extendToPowerOfTwo :: Int -> Int Source #