Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
SumMinMax
and AddChminChmax
on the segment tree beats.
Typical problems
Synopsis
- data SumMinMax a = SumMinMax {}
- singletonSMM :: a -> SumMinMax a
- data AddChminChmax a = AddChminChmax {}
- newAddACC :: (Num a, Ord a, Bounded a) => a -> AddChminChmax a
- newChminACC :: (Num a, Ord a, Bounded a) => a -> AddChminChmax a
- newChmaxACC :: (Num a, Ord a, Bounded a) => a -> AddChminChmax a
- type SumMinMaxRepr a = (a, a, a, a, a, (Int, Int, Bool))
- type AddChminChmaxRepr a = (a, a, a)
Documentation
Sum + Min + Max information on segment tree beats.
REMARK: Be sure to NOT use mempty
as initial values in segment tree beats, use
singletonSMM 0
instead.
TODO: Specialize and UNPACK
.
Instances
singletonSMM :: a -> SumMinMax a #
data AddChminChmax a #
Add first then apply chmin and chmax, works on segment tree beats.
TODO: Specialize and UNPACK
.
Instances
newChminACC :: (Num a, Ord a, Bounded a) => a -> AddChminChmax a #
newChmaxACC :: (Num a, Ord a, Bounded a) => a -> AddChminChmax a #
Unbox
instances
type SumMinMaxRepr a = (a, a, a, a, a, (Int, Int, Bool)) #
type AddChminChmaxRepr a = (a, a, a) #