From 7659d9c67f75e1f665d6b02663ee8767e97762b4 Mon Sep 17 00:00:00 2001 From: Vivian McPhail Date: Mon, 12 Jul 2010 22:23:14 +0000 Subject: refactored Data.Packed.Vector to remove any numerics --- lib/Graphics/Plot.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/Graphics') diff --git a/lib/Graphics/Plot.hs b/lib/Graphics/Plot.hs index 02b0c4c..b2acc15 100644 --- a/lib/Graphics/Plot.hs +++ b/lib/Graphics/Plot.hs @@ -30,7 +30,7 @@ module Graphics.Plot( import Data.Packed import Numeric.LinearAlgebra(outer) -import Numeric.LinearAlgebra.Linear(Vectors(..)) +import Numeric.LinearAlgebra.Linear import Data.List(intersperse) import System.Process (system) @@ -153,10 +153,10 @@ matrixToPGM m = header ++ unlines (map unwords ll) where maxgray = 255.0 maxval = vectorMax $ flatten $ m minval = vectorMin $ flatten $ m - scale = if (maxval == minval) + scale' = if (maxval == minval) then 0.0 else maxgray / (maxval - minval) - f x = show ( round ( scale *(x - minval) ) :: Int ) + f x = show ( round ( scale' *(x - minval) ) :: Int ) ll = map (map f) (toLists m) -- | imshow shows a representation of a matrix as a gray level image using ImageMagick's display. -- cgit v1.2.3