From 0b48e6b34a1a4ec590f2d17833f713f42f5e0955 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sun, 29 Aug 2010 12:53:57 +0000 Subject: removed unnecesary export of interface/instances --- lib/Data/Packed.hs | 2 +- lib/Data/Packed/Random.hs | 11 +++++------ lib/Numeric/LinearAlgebra.hs | 4 +--- lib/Numeric/LinearAlgebra/Interface.hs | 1 - 4 files changed, 7 insertions(+), 11 deletions(-) (limited to 'lib') diff --git a/lib/Data/Packed.hs b/lib/Data/Packed.hs index 87695ee..50a5eb6 100644 --- a/lib/Data/Packed.hs +++ b/lib/Data/Packed.hs @@ -24,4 +24,4 @@ import Data.Packed.Vector import Data.Packed.Matrix import Data.Packed.Random import Data.Complex - +import Numeric.LinearAlgebra.Instances() diff --git a/lib/Data/Packed/Random.hs b/lib/Data/Packed/Random.hs index 3b02225..33a11d7 100644 --- a/lib/Data/Packed/Random.hs +++ b/lib/Data/Packed/Random.hs @@ -23,7 +23,6 @@ import Numeric.GSL.Vector import Data.Packed.Matrix import Data.Packed.Vector import Numeric.LinearAlgebra.Algorithms -import Numeric.LinearAlgebra.Interface import Numeric.LinearAlgebra.Linear -- | Obtains a matrix whose rows are pseudorandom samples from a multivariate @@ -37,7 +36,7 @@ gaussianSample seed n med cov = m where c = dim med meds = constant 1 n `outer` med rs = reshape c $ randomVector seed Gaussian (c * n) - m = rs <> cholSH cov + meds + m = rs `mXm` cholSH cov `add` meds -- | Obtains a matrix whose rows are pseudorandom samples from a multivariate -- uniform distribution. @@ -52,7 +51,7 @@ uniformSample seed n rgs = m where d = dim a dat = toRows $ reshape n $ randomVector seed Uniform (n*d) am = constant 1 n `outer` a - m = fromColumns (zipWith scale cs dat) + am + m = fromColumns (zipWith scale cs dat) `add` am ------------ utilities ------------------------------- @@ -61,7 +60,7 @@ meanCov :: Matrix Double -> (Vector Double, Matrix Double) meanCov x = (med,cov) where r = rows x k = 1 / fromIntegral r - med = constant k r <> x + med = constant k r `vXm` x meds = constant 1 r `outer` med - xc = x - meds - cov = (trans xc <> xc) / fromIntegral (r-1) + xc = x `sub` meds + cov = flip scale (trans xc `mXm` xc) (recip (fromIntegral (r-1))) diff --git a/lib/Numeric/LinearAlgebra.hs b/lib/Numeric/LinearAlgebra.hs index f3a4104..e8a14d6 100644 --- a/lib/Numeric/LinearAlgebra.hs +++ b/lib/Numeric/LinearAlgebra.hs @@ -16,12 +16,10 @@ module Numeric.LinearAlgebra ( module Data.Packed, module Numeric.LinearAlgebra.Algorithms, module Numeric.LinearAlgebra.Interface, - module Numeric.LinearAlgebra.Linear, - module Numeric.LinearAlgebra.Instances + module Numeric.LinearAlgebra.Linear ) where import Data.Packed import Numeric.LinearAlgebra.Algorithms import Numeric.LinearAlgebra.Interface import Numeric.LinearAlgebra.Linear -import Numeric.LinearAlgebra.Instances diff --git a/lib/Numeric/LinearAlgebra/Interface.hs b/lib/Numeric/LinearAlgebra/Interface.hs index 6df782f..542d76e 100644 --- a/lib/Numeric/LinearAlgebra/Interface.hs +++ b/lib/Numeric/LinearAlgebra/Interface.hs @@ -24,7 +24,6 @@ module Numeric.LinearAlgebra.Interface( (<|>),(<->), ) where -import Numeric.LinearAlgebra.Instances() import Data.Packed.Vector import Data.Packed.Matrix import Numeric.LinearAlgebra.Algorithms -- cgit v1.2.3