summaryrefslogtreecommitdiff
path: root/lib/Data/Packed/Random.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Data/Packed/Random.hs')
-rw-r--r--lib/Data/Packed/Random.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Data/Packed/Random.hs b/lib/Data/Packed/Random.hs
index a6145be..fea3cdd 100644
--- a/lib/Data/Packed/Random.hs
+++ b/lib/Data/Packed/Random.hs
@@ -21,6 +21,7 @@ module Data.Packed.Random (
21 21
22import Numeric.GSL.Vector 22import Numeric.GSL.Vector
23import Data.Packed 23import Data.Packed
24import Numeric.LinearAlgebra.Linear
24import Numeric.LinearAlgebra.Algorithms 25import Numeric.LinearAlgebra.Algorithms
25import Numeric.LinearAlgebra.Instances() 26import Numeric.LinearAlgebra.Instances()
26import Numeric.LinearAlgebra.Interface 27import Numeric.LinearAlgebra.Interface
@@ -54,7 +55,7 @@ uniformSample seed n rgs = m where
54 d = dim a 55 d = dim a
55 dat = toRows $ reshape n $ randomVector seed Uniform (n*d) 56 dat = toRows $ reshape n $ randomVector seed Uniform (n*d)
56 am = constant 1 n `outer` a 57 am = constant 1 n `outer` a
57 m = fromColumns (zipWith (.*) cs dat) + am 58 m = fromColumns (zipWith scale cs dat) + am
58 59
59------------ utilities ------------------------------- 60------------ utilities -------------------------------
60 61