From 1e9b6bb90273cdf192bdcf0ccf73af59241c1d95 Mon Sep 17 00:00:00 2001 From: Alberto Ruiz Date: Sat, 15 Nov 2008 11:50:24 +0000 Subject: zipVector --- lib/Graphics/Plot.hs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'lib/Graphics/Plot.hs') diff --git a/lib/Graphics/Plot.hs b/lib/Graphics/Plot.hs index bcb1fb3..9b64a1d 100644 --- a/lib/Graphics/Plot.hs +++ b/lib/Graphics/Plot.hs @@ -1,7 +1,7 @@ ----------------------------------------------------------------------------- -- | -- Module : Graphics.Plot --- Copyright : (c) Alberto Ruiz 2005 +-- Copyright : (c) Alberto Ruiz 2005-8 -- License : GPL-style -- -- Maintainer : Alberto Ruiz (aruiz at um dot es) @@ -28,14 +28,10 @@ module Graphics.Plot( ) where -import Data.Packed.Vector -import Data.Packed.Matrix +import Data.Packed import Numeric.LinearAlgebra(outer) -import Numeric.GSL.Vector(FunCodeS(Max,Min),toScalarR) import Data.List(intersperse) import System -import Foreign hiding (rotate) - size = dim @@ -154,8 +150,8 @@ matrixToPGM m = header ++ unlines (map unwords ll) where r = rows m header = "P2 "++show c++" "++show r++" "++show (round maxgray :: Int)++"\n" maxgray = 255.0 - maxval = toScalarR Max $ flatten $ m - minval = toScalarR Min $ flatten $ m + maxval = vectorMax $ flatten $ m + minval = vectorMin $ flatten $ m scale = if (maxval == minval) then 0.0 else maxgray / (maxval - minval) -- cgit v1.2.3