flat-mcmc

Painless, efficient, general-purpose sampling from continuous distributions.
git clone git://git.jtobin.io/flat-mcmc.git
Log | Files | Refs | README | LICENSE

Extended.hs (749B)


      1 -- |
      2 -- Module: Data.Vector.Extended
      3 -- Copyright: (c) 2016 Jared Tobin
      4 -- License: MIT
      5 --
      6 -- Maintainer: Jared Tobin <jared@jtobin.ca>
      7 -- Stability: unstable
      8 -- Portability: ghc
      9 
     10 module Data.Vector.Extended (
     11     ensemble
     12   , particle
     13   ) where
     14 
     15 import qualified Data.Vector as V (fromList, Vector)
     16 import qualified Data.Vector.Unboxed as U (fromList, Vector)
     17 
     18 -- | A type-specialized alias for Data.Vector.fromList.
     19 --
     20 --   Use this to create ensembles from lists of particles.
     21 ensemble :: [U.Vector Double] -> V.Vector (U.Vector Double)
     22 ensemble = V.fromList
     23 
     24 -- | A type-specialized alias for Data.Vector.Unboxed.fromList
     25 --
     26 --   Use this to create particles from lists of doubles.
     27 particle :: [Double] -> U.Vector Double
     28 particle = U.fromList
     29