packages feed

flat-mcmc 1.4.0 → 1.4.1

raw patch · 5 files changed

+11/−8 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

flat-mcmc.cabal view
@@ -1,5 +1,5 @@ name:                flat-mcmc-version:             1.4.0+version:             1.4.1 synopsis:            Painless general-purpose sampling. homepage:            https://github.com/jtobin/flat-mcmc license:             MIT
lib/Numeric/MCMC/Flat.hs view
@@ -141,7 +141,7 @@   zcs <- replicateM n uniform   js  <- U.replicateM n (uniformR (1, n)) -  let granularity = truncate (fromIntegral n / 2)+  let granularity = n `div` 2        w0 k    = e0 `V.unsafeIndex` pred k       w1 k ks = e1 `V.unsafeIndex` pred (ks `U.unsafeIndex` pred k)
src/Main.hs view
@@ -3,11 +3,12 @@ module Main where  import Numeric.MCMC.Flat-import qualified Data.Vector.Unboxed as U (toList)+import qualified Data.Vector.Unboxed as U (unsafeIndex)  bnn :: Particle -> Double bnn xs = -0.5 * (x0 ^ 2 * x1 ^ 2 + x0 ^ 2 + x1 ^ 2 - 8 * x0 - 8 * x1) where-  [x0, x1] = U.toList xs+  x0 = U.unsafeIndex xs 0+  x1 = U.unsafeIndex xs 1  origin :: Ensemble origin = ensemble [
test/BNN.hs view
@@ -3,11 +3,12 @@ module Main where  import Numeric.MCMC.Flat-import qualified Data.Vector.Unboxed as U (toList)+import qualified Data.Vector.Unboxed as U (unsafeIndex)  bnn :: Particle -> Double bnn xs = -0.5 * (x0 ^ 2 * x1 ^ 2 + x0 ^ 2 + x1 ^ 2 - 8 * x0 - 8 * x1) where-  [x0, x1] = U.toList xs+  x0 = U.unsafeIndex xs 0+  x1 = U.unsafeIndex xs 1  origin :: Ensemble origin = ensemble [
test/Rosenbrock.hs view
@@ -3,11 +3,12 @@ module Main where  import Numeric.MCMC.Flat-import qualified Data.Vector.Unboxed as U (toList)+import qualified Data.Vector.Unboxed as U (unsafeIndex)  rosenbrock :: Particle -> Double rosenbrock xs = negate (5  *(x1 - x0 ^ 2) ^ 2 + 0.05 * (1 - x0) ^ 2) where-  [x0, x1] = U.toList xs+  x0 = U.unsafeIndex xs 0+  x1 = U.unsafeIndex xs 1  origin :: Ensemble origin = ensemble [