ac-library-hs-0.1.0.0: Data structures and algorithms
Safe HaskellNone
LanguageGHC2021

AtCoder.Extra.Monoid.RangeSetId

Description

SegAct instance of range set action over ideomponent monoids. It can set an interval \([l, r)\) to an idempotent monoid \(x\) such as Max Int.

Since: 1.0.0

Synopsis

RangeSetId

newtype RangeSetId a #

SegAct instance of range set action over ideomponent monoids.

Example

>>> import AtCoder.Extra.Monoid (SegAct(..), RangeSetId(..))
>>> import AtCoder.LazySegTree qualified as LST
>>> import Data.Semigroup (Max(..))
>>> seg <- LST.build @_ @(RangeSetId (Max Int)) @(Max Int) $ VU.generate 3 (Max . (+ 10)) -- [10, 11, 12]
>>> LST.applyIn seg 0 2 $ RangeSetId (True, Max 5) -- [5, 5, 12]
>>> getMax <$> LST.prod seg 0 3
12

Since: 1.0.0

Constructors

RangeSetId (RangeSetIdRepr a) 

Instances

Instances details
Unbox a => Vector Vector (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Unbox a => MVector MVector (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Monoid a => Monoid (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Semigroup (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Show a => Show (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Eq a => Eq (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Methods

(==) :: RangeSetId a -> RangeSetId a -> Bool #

(/=) :: RangeSetId a -> RangeSetId a -> Bool #

Ord a => Ord (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Unbox a => Unbox (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

(Ord a, Bounded a) => SegAct (RangeSetId (Max a)) (Max a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Methods

segAct :: RangeSetId (Max a) -> Max a -> Max a #

segActWithLength :: Int -> RangeSetId (Max a) -> Max a -> Max a #

(Ord a, Bounded a) => SegAct (RangeSetId (Min a)) (Min a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

Methods

segAct :: RangeSetId (Min a) -> Min a -> Min a #

segActWithLength :: Int -> RangeSetId (Min a) -> Min a -> Min a #

newtype MVector s (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

newtype MVector s (RangeSetId a) = MV_RangeSetId (MVector s (RangeSetIdRepr a))
newtype Vector (RangeSetId a) #

Since: 1.0.0

Instance details

Defined in AtCoder.Extra.Monoid.RangeSetId

newtype Vector (RangeSetId a) = V_RangeSetId (Vector (RangeSetIdRepr a))

Constructor

new :: a -> RangeSetId a #

Creates a new RangeSet action.

Since: 1.0.0

Action

act :: RangeSetId a -> a -> a #

Applies one-length range set: \(f: x \rightarrow y\).

Since: 1.0.0