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

AtCoder.Extra.Ix0

Description

Opinionated zero-based \(n\)-dimensional index and their bounds.

Synopsis

Documentation

type Bounds0 (i :: k) = i Source #

Zero-based \(n\)-dimensional bounds: \([0, d_0) \times [0, d_1) \times .. \times [0, d_{n - 1})\).

class Ix0 i where Source #

Zero-based \(n\)-dimensional index.

Methods

rangeSize0 :: Bounds0 i -> Int Source #

Returns the size of the bounds: \(\Pi_i d_i\).

index0 :: Bounds0 i -> i -> Int Source #

Returns zero-based one dimensional index, without running boundary check.

inRange0 :: Bounds0 i -> i -> Bool Source #

Returns whether an index is contained in a bounds.

Instances

Instances details
Ix0 Int Source # 
Instance details

Defined in AtCoder.Extra.Ix0

Ix0 (Int, Int) Source # 
Instance details

Defined in AtCoder.Extra.Ix0

Ix0 (Int, Int, Int) Source # 
Instance details

Defined in AtCoder.Extra.Ix0

Ix0 (Int, Int, Int, Int) Source # 
Instance details

Defined in AtCoder.Extra.Ix0

Ix0 (Int, Int, Int, Int, Int) Source # 
Instance details

Defined in AtCoder.Extra.Ix0

Ix0 (Int, Int, Int, Int, Int, Int) Source # 
Instance details

Defined in AtCoder.Extra.Ix0