Safe Haskell | None |
---|---|
Language | Haskell2010 |
Applicative interface to define recursive structures and derive Boltzmann samplers.
Given the recursive structure of the types, and how to combine generators, the library takes care of computing the oracles and setting the right distributions.
- class Embed f m where
- class (Alternative f, Num (Scalar f)) => Module f where
- type Endo a = a -> a
- data System f a c = System {}
- sys :: System f a c -> f () -> Vector (f a) -> Vector (f a)
- newtype ConstModule r a = ConstModule {
- unConstModule :: r
- solve :: forall b c. (forall a. Num a => System (ConstModule a) b c) -> Double -> Maybe (Vector Double)
- sizedGenerator :: forall b c m. MonadRandomLike m => (forall f. (Module f, Embed f m) => System (Pointiful f) b c) -> Int -> Int -> Maybe Double -> m b
- solveSized :: forall b c. (forall a. Num a => System (Pointiful (ConstModule a)) b c) -> Int -> Int -> Maybe Double -> (Double, Vector Double)
- newtype Weighted m a = Weighted [(Double, m a)]
- weighted :: Double -> m a -> Weighted m a
- runWeighted :: MonadRandomLike m => Weighted m a -> (Double, m a)
- sfix :: MonadRandomLike m => System (Weighted m) b c -> Double -> Vector Double -> (Vector (m b), c)
- data Pointiful f a
- unPointiful :: Alternative f => Pointiful f a -> [f a]
- point :: Module f => Int -> System (Pointiful f) b c -> System f b c
Documentation
class (Alternative f, Num (Scalar f)) => Module f where Source #
Applicative
defines a product, Alternative
defines an addition,
with scalar multiplication we get a module.
This typeclass allows to directly tweak weights in the oracle by chosen factors.
newtype ConstModule r a Source #
ConstModule | |
|
Functor (ConstModule r) Source # | |
Num r => Applicative (ConstModule r) Source # | |
Num r => Alternative (ConstModule r) Source # | |
Num r => Module (ConstModule r) Source # | |
Num r => Embed (ConstModule r) m Source # | |
type Scalar (ConstModule r) Source # | |
solve :: forall b c. (forall a. Num a => System (ConstModule a) b c) -> Double -> Maybe (Vector Double) Source #
Functor m => Functor (Weighted m) Source # | |
MonadRandomLike m => Applicative (Weighted m) Source # | |
MonadRandomLike m => Alternative (Weighted m) Source # | |
MonadRandomLike m => Module (Weighted m) Source # | |
MonadRandomLike m => Embed (Weighted m) m Source # | |
type Scalar (Weighted m) Source # | |
runWeighted :: MonadRandomLike m => Weighted m a -> (Double, m a) Source #
sfix :: MonadRandomLike m => System (Weighted m) b c -> Double -> Vector Double -> (Vector (m b), c) Source #
unPointiful :: Alternative f => Pointiful f a -> [f a] Source #