Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
AtCoder.Extra.DynSegTree.Raw
Description
Base module of a dynamic segment tree.
Since: 1.2.1.0
Synopsis
- data DynSegTree s a = DynSegTree {}
- newtype Index = Index {}
- newST :: (HasCallStack, Unbox a) => Bool -> Int -> Int -> Int -> (Int -> Int -> a) -> ST s (DynSegTree s a)
- newRootST :: (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> ST s Index
- newNodeST :: (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> a -> ST s Index
- newSeqST :: (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> Vector a -> ST s Index
- modifyMST :: forall m a. (HasCallStack, PrimMonad m, Monoid a, Unbox a) => DynSegTree (PrimState m) a -> Index -> (a -> m a) -> Int -> m Index
- prodST :: forall a s. (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> Index -> Int -> Int -> ST s a
- resetIntervalST :: forall a s. (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> Index -> Int -> Int -> ST s Index
- maxRightM :: (HasCallStack, PrimMonad m, Monoid a, Unbox a) => DynSegTree (PrimState m) a -> Index -> (a -> m Bool) -> m Int
Dynamic segment tree
data DynSegTree s a Source #
A dynamic segment tree that covers a half-open interval \([l_0, r_0)\). Is is dynamic in that the nodes are instantinated as needed.
Since: 1.2.1.0
Constructors
DynSegTree | |
Fields
|
Re-exports
Strongly typed index of pool items. User has to explicitly corece
on raw index use.
Instances
Constructors
newST :: (HasCallStack, Unbox a) => Bool -> Int -> Int -> Int -> (Int -> Int -> a) -> ST s (DynSegTree s a) Source #
\(O(n)\)
Since: 1.2.1.0
newRootST :: (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> ST s Index Source #
\(O(1)\)
Since: 1.2.1.0
newNodeST :: (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> a -> ST s Index Source #
\(O(1)\)
Since: 1.2.1.0
newSeqST :: (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> Vector a -> ST s Index Source #
\(O(L)\)
Since: 1.2.1.0
Accessing elements
modifyMST :: forall m a. (HasCallStack, PrimMonad m, Monoid a, Unbox a) => DynSegTree (PrimState m) a -> Index -> (a -> m a) -> Int -> m Index Source #
\(O(\log L)\)
Since: 1.2.1.0
Products
prodST :: forall a s. (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> Index -> Int -> Int -> ST s a Source #
\(O(\log L)\)
Since: 1.2.1.0
Tree operations
resetIntervalST :: forall a s. (HasCallStack, Monoid a, Unbox a) => DynSegTree s a -> Index -> Int -> Int -> ST s Index Source #
\(O(\log L)\) Resets an interval \([l, r)\) to initial monoid values.
Since: 1.2.1.0