summaryrefslogtreecommitdiff
path: root/lib/Data
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data')
-rw-r--r--lib/Data/Packed/Random.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Data/Packed/Random.hs b/lib/Data/Packed/Random.hs
index dabb17d..e8b0268 100644
--- a/lib/Data/Packed/Random.hs
+++ b/lib/Data/Packed/Random.hs
@@ -36,7 +36,7 @@ gaussianSample :: Seed
36 -> Matrix Double -- ^ result 36 -> Matrix Double -- ^ result
37gaussianSample seed n med cov = m where 37gaussianSample seed n med cov = m where
38 c = dim med 38 c = dim med
39 meds = konst 1 n `outer` med 39 meds = konst' 1 n `outer` med
40 rs = reshape c $ randomVector seed Gaussian (c * n) 40 rs = reshape c $ randomVector seed Gaussian (c * n)
41 m = rs `mXm` cholSH cov `add` meds 41 m = rs `mXm` cholSH cov `add` meds
42 42
@@ -52,6 +52,6 @@ uniformSample seed n rgs = m where
52 cs = zipWith subtract as bs 52 cs = zipWith subtract as bs
53 d = dim a 53 d = dim a
54 dat = toRows $ reshape n $ randomVector seed Uniform (n*d) 54 dat = toRows $ reshape n $ randomVector seed Uniform (n*d)
55 am = konst 1 n `outer` a 55 am = konst' 1 n `outer` a
56 m = fromColumns (zipWith scale cs dat) `add` am 56 m = fromColumns (zipWith scale cs dat) `add` am
57 57