diff options
author | Justin Bedo <cu@cua0.org> | 2025-03-05 18:26:04 +1100 |
---|---|---|
committer | Justin Bedo <cu@cua0.org> | 2025-03-06 09:58:26 +1100 |
commit | dab819d62c6bf139dbbb3e36fd6f835f7681b595 (patch) | |
tree | e934f5d61d2dd488e6c796d15ded47149586df03 /src/PPL/Sampling.hs | |
parent | 51c32c174a168db6f97a7f93dcc58bcb7c351a65 (diff) |
use hashed ids
Diffstat (limited to 'src/PPL/Sampling.hs')
-rw-r--r-- | src/PPL/Sampling.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/PPL/Sampling.hs b/src/PPL/Sampling.hs index 5ad346d..59126ba 100644 --- a/src/PPL/Sampling.hs +++ b/src/PPL/Sampling.hs @@ -27,7 +27,8 @@ import qualified System.Random as R import Data.IORef import Control.Monad import qualified Data.Vector.Hashtables as H -import qualified Data.Vector as V +import qualified Data.Vector.Unboxed as V +import Data.Word mh :: (MonadIO m) => StdGen -> Double -> Meas a -> Stream (Of (a, Log Double)) m () mh g p m = do @@ -50,7 +51,7 @@ mh g p m = do yield (x'', w'') step g2 omega'' x'' w'' - mutate :: MonadIO m => StdGen -> IORef (HashMap [Bool] Double, StdGen) -> m (IORef (HashMap [Bool] Double, StdGen)) + mutate :: MonadIO m => StdGen -> IORef (HashMap Word64 Double, StdGen) -> m (IORef (HashMap Word64 Double, StdGen)) mutate g omega = liftIO $ do (m, g0) <- readIORef omega m' <- H.clone m |