From 9412ef25f2a9d6f6ca233ef123a01c3f4145ffa4 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Tue, 20 May 2014 19:32:19 +0200 Subject: random numbers in base --- packages/base/src/Data/Packed/IO.hs | 2 ++ packages/base/src/Data/Packed/Numeric.hs | 8 ++------ 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'packages/base/src/Data/Packed') diff --git a/packages/base/src/Data/Packed/IO.hs b/packages/base/src/Data/Packed/IO.hs index db03d5f..94fb30a 100644 --- a/packages/base/src/Data/Packed/IO.hs +++ b/packages/base/src/Data/Packed/IO.hs @@ -149,6 +149,8 @@ apparentCols s = f . dropWhile null . map words . lines <$> readFile s f [] = 0 f (x:_) = length x + +-- | load a matrix from an ASCII file formatted as a 2D table. loadMatrix :: FilePath -> IO (Matrix Double) loadMatrix f = do v <- vectorScan f diff --git a/packages/base/src/Data/Packed/Numeric.hs b/packages/base/src/Data/Packed/Numeric.hs index 6036e8c..d130ecd 100644 --- a/packages/base/src/Data/Packed/Numeric.hs +++ b/packages/base/src/Data/Packed/Numeric.hs @@ -84,7 +84,7 @@ linspace n (a,b) = addConstant a $ scale s $ fromList $ map fromIntegral [0 .. n class Contraction a b c | a b -> c where infixl 7 <.> - {- | Matrix product, matrix vector product, and dot product + {- | Matrix product, matrix - vector product, and dot product Examples: @@ -223,11 +223,7 @@ instance Container Matrix e => Build (Int,Int) (e -> e -> e) Matrix e -------------------------------------------------------------------------------- -{- | alternative operator for '(\<.\>)' - -x25c7, white diamond - --} +-- | alternative unicode symbol (25c7) for the contraction operator '(\<.\>)' (◇) :: Contraction a b c => a -> b -> c infixl 7 ◇ (◇) = (<.>) -- cgit v1.2.3