packages feed

hmatrix-gsl-stats 0.1.1.1 → 0.1.1.2

raw patch · 3 files changed

+7/−4 lines, 3 files

Files

CHANGES view
@@ -4,3 +4,6 @@ 0.1.1.1: 		added prob to Histogram, Histogram2D 		changed return of getBins to curried form++0.1.1.2:+		fixed bug - not dividing by sum - prob for Histogram2D
hmatrix-gsl-stats.cabal view
@@ -1,5 +1,5 @@ Name:               hmatrix-gsl-stats-Version:            0.1.1.1+Version:            0.1.1.2 License:            GPL License-file:       LICENSE Copyright:          (c) A.V.H. McPhail 2010
lib/Numeric/GSL/Histogram2D.hs view
@@ -40,7 +40,7 @@ import Data.Packed.Matrix import Data.Packed.Development ---import Numeric.LinearAlgebra.Linear+import Numeric.LinearAlgebra.Interface()  --import Control.Monad --import Control.Monad(when)@@ -322,10 +322,10 @@  -- | find the probability of occuring for each element of the input vector prob :: Histogram2D -> (Vector Double,Vector Double) -> Vector Double-prob (H _ _ h) (x,y) = unsafePerformIO $ do+prob hi@(H _ _ h) (x,y) = unsafePerformIO $ do                r <- createVector $ dim x                app3 (\xs' x' ys' y' rs' r' -> withForeignPtr h $ \h' -> histogram2d_prob h' xs' x' ys' y' rs' r') vec x vec y vec r "histogram2d_prob"-               return r+               return $ r/(constant (sum hi) (dim x))  foreign import ccall "histogram-aux.h hist2d_prob" histogram2d_prob :: Hist2DHandle -> CInt -> Ptr Double -> CInt -> Ptr Double -> CInt -> Ptr Double -> IO CInt