From d7d3b731c037fca41bd9128c3da2a582189cb4d9 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Fri, 30 Nov 2007 19:55:34 +0000 Subject: hide internal modules --- lib/Numeric/LinearAlgebra/Instances.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/Numeric') 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 import Complex import Data.List(transpose,intersperse) import Foreign(Storable) +import Data.Monoid +import Data.Packed.Internal.Vector ------------------------------------------------------------------ @@ -159,3 +161,12 @@ instance (Linear Vector a, Floating (Vector a)) => Floating (Matrix a) where (**) = liftMatrix2' (**) sqrt = liftMatrix sqrt pi = (1><1) [pi] + +--------------------------------------------------------------- + +instance (Storable a) => Monoid (Vector a) where + mempty = V { dim = 0, fptr = undefined } + mappend a b = mconcat [a,b] + mconcat = j . filter ((>0).dim) + where j [] = mempty + j l = join l -- cgit v1.2.3