summaryrefslogtreecommitdiff
path: root/lib/Numeric
diff options
context:
space:
mode:
authorAlberto Ruiz <aruiz@um.es>2007-11-30 19:55:34 +0000
committerAlberto Ruiz <aruiz@um.es>2007-11-30 19:55:34 +0000
commitd7d3b731c037fca41bd9128c3da2a582189cb4d9 (patch)
treef1bf8f1fa538033ff184d6cc556e808bfaaa71a9 /lib/Numeric
parent975d3730a923387f9d1a0be4f7d11b01b27a09df (diff)
hide internal modules
Diffstat (limited to 'lib/Numeric')
-rw-r--r--lib/Numeric/LinearAlgebra/Instances.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Numeric/LinearAlgebra/Instances.hs b/lib/Numeric/LinearAlgebra/Instances.hs
index 3f295bf..c8bf126 100644
--- a/lib/Numeric/LinearAlgebra/Instances.hs
+++ b/lib/Numeric/LinearAlgebra/Instances.hs
@@ -26,6 +26,8 @@ import Data.Packed.Vector
26import Complex 26import Complex
27import Data.List(transpose,intersperse) 27import Data.List(transpose,intersperse)
28import Foreign(Storable) 28import Foreign(Storable)
29import Data.Monoid
30import Data.Packed.Internal.Vector
29 31
30------------------------------------------------------------------ 32------------------------------------------------------------------
31 33
@@ -159,3 +161,12 @@ instance (Linear Vector a, Floating (Vector a)) => Floating (Matrix a) where
159 (**) = liftMatrix2' (**) 161 (**) = liftMatrix2' (**)
160 sqrt = liftMatrix sqrt 162 sqrt = liftMatrix sqrt
161 pi = (1><1) [pi] 163 pi = (1><1) [pi]
164
165---------------------------------------------------------------
166
167instance (Storable a) => Monoid (Vector a) where
168 mempty = V { dim = 0, fptr = undefined }
169 mappend a b = mconcat [a,b]
170 mconcat = j . filter ((>0).dim)
171 where j [] = mempty
172 j l = join l