From 026f20453ff3c8981ef6cab2d5d865837977b78d Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Thu, 15 Oct 2009 09:51:44 +0000 Subject: default transdata and constantD --- lib/Data/Packed/Internal/Matrix.hs | 13 +++++++------ lib/Data/Packed/Internal/Vector.hs | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 68547bd..9dc90af 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs @@ -223,18 +223,19 @@ class (Storable a, Floating a) => Element a where subMatrixD :: (Int,Int) -- ^ (r0,c0) starting position -> (Int,Int) -- ^ (rt,ct) dimensions of submatrix -> Matrix a -> Matrix a + subMatrixD = subMatrix' transdata :: Int -> Vector a -> Int -> Vector a + transdata = transdata' constantD :: a -> Int -> Vector a + constantD = constant' instance Element Double where - subMatrixD = subMatrix' - transdata = transdataAux ctransR -- transdata' - constantD = constantAux cconstantR -- constant' + transdata = transdataAux ctransR + constantD = constantAux cconstantR instance Element (Complex Double) where - subMatrixD = subMatrix' - transdata = transdataAux ctransC -- transdata' - constantD = constantAux cconstantC -- constant' + transdata = transdataAux ctransC + constantD = constantAux cconstantC ------------------------------------------------------------------- diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index 5784861..ac0f176 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs @@ -171,6 +171,7 @@ infixl 9 @> -} join :: Storable t => [Vector t] -> Vector t join [] = error "joining zero vectors" +join [v] = v join as = unsafePerformIO $ do let tot = sum (map dim as) r@V {fptr = p} <- createVector tot -- cgit v1.2.3