iota-0.1.0.0
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Doubling

Synopsis

Documentation

newtype Doubling a Source #

Constructors

Doubling 

Fields

Instances

Instances details
(Semigroup a, Unbox a) => Semigroup (Doubling a) Source # 
Instance details

Defined in Data.Doubling

Methods

(<>) :: Doubling a -> Doubling a -> Doubling a #

sconcat :: NonEmpty (Doubling a) -> Doubling a #

stimes :: Integral b => b -> Doubling a -> Doubling a #

generateDoubling :: Unbox a => Int -> (Int -> (Int, a)) -> Doubling a Source #

doublingStepN Source #

Arguments

:: (Semigroup a, Unbox a) 
=> Int

n

-> Int

initial state

-> a

initial value

-> Doubling a 
-> (Int, a) 

O(Mlog N)

doublingStepN_ Source #

Arguments

:: Int

n

-> Int

initial state

-> Doubling () 
-> Int 

newtype DoublingTable a Source #

Constructors

DoublingTable (Vector (Doubling a)) 

doublingStepNQuery Source #

Arguments

:: (Semigroup a, Unbox a) 
=> Int

n

-> Int

initial state

-> a

initial value

-> DoublingTable a 
-> (Int, a) 

O(log N)