Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- newtype Doubling a = Doubling {
- getDoubling :: Vector (Int, a)
- generateDoubling :: Unbox a => Int -> (Int -> (Int, a)) -> Doubling a
- generateDoubling_ :: Int -> (Int -> Int) -> Doubling ()
- doublingStepN :: (Semigroup a, Unbox a) => Int -> Int -> a -> Doubling a -> (Int, a)
- doublingStepN_ :: Int -> Int -> Doubling () -> Int
- newtype DoublingTable a = DoublingTable (Vector (Doubling a))
- buildDoublingTable :: (Semigroup a, Unbox a) => Doubling a -> DoublingTable a
- doublingStepNQuery :: (Semigroup a, Unbox a) => Int -> Int -> a -> DoublingTable a -> (Int, a)
Documentation
Doubling | |
|
O(Mlog N)
newtype DoublingTable a Source #
DoublingTable (Vector (Doubling a)) |
buildDoublingTable :: (Semigroup a, Unbox a) => Doubling a -> DoublingTable a Source #
:: (Semigroup a, Unbox a) | |
=> Int | n |
-> Int | initial state |
-> a | initial value |
-> DoublingTable a | |
-> (Int, a) |
O(log N)