packages feed

hmatrix-gsl-stats 0.1.2.2 → 0.1.2.3

raw patch · 4 files changed

+20/−19 lines, 4 files

Files

CHANGES view
@@ -29,4 +29,7 @@ 		removed warning causes in Distribution.Discrete/Continuous 		added fromVectors, modified fromMatrix in Histogram(2D)		 		added countInstance, probability to Histogram(2D)+		added probPair to Histogram2D +0.1.2.3:+		fixed imports to reflect changes in hmatrix
hmatrix-gsl-stats.cabal view
@@ -1,5 +1,5 @@ Name:               hmatrix-gsl-stats-Version:            0.1.2.2+Version:            0.1.2.3 License:            GPL License-file:       LICENSE Copyright:          (c) A.V.H. McPhail 2010@@ -14,7 +14,9 @@      Relieves the burden of alloc/free routines and is otherwise essentially 1:1      .      Documentation can be found at <http://www.gnu.org/software/gsl/manual/>-+     .+     When hmatrix is installed with -fvector, the vector type is Data.Vector.Storable+     from the vector package. Category:           Math, Statistics tested-with:        GHC ==6.12.1 
lib/Numeric/GSL/Histogram.hs view
@@ -50,8 +50,8 @@ --import Data.Packed.Matrix hiding(toLists) import Data.Packed.Development ---import Numeric.LinearAlgebra.Linear-import Numeric.LinearAlgebra.Algorithms hiding(add,multiply,divide,scale)+import Numeric.LinearAlgebra.Algorithms hiding (multiply)+import Numeric.LinearAlgebra.Linear hiding (add,divide,scale) import Numeric.LinearAlgebra.Interface()  --import Control.Monad
lib/Numeric/GSL/Histogram2D.hs view
@@ -51,7 +51,8 @@ import Data.Packed.Matrix import Data.Packed.Development -import Numeric.LinearAlgebra.Algorithms hiding(add,multiply,divide,scale)+import Numeric.LinearAlgebra.Algorithms hiding (multiply)+import Numeric.LinearAlgebra.Linear hiding (add,divide,scale) import Numeric.LinearAlgebra.Interface()  --import Control.Monad@@ -77,19 +78,16 @@  ----------------------------------------------------------------------------- --- This Storable instance for Complex is binary compatible with C99, C++ and--- Fortran complex data types. instance (Storable a) => Storable (a,a) where     sizeOf z        = 2 * sizeOf (fst z)     alignment z     = alignment (fst z)     peek p          = do let q = castPtr p-                         r <- peek q-                         i <- peekElemOff q 1-                         return (r,i)-    poke p (r,i) = do let q = (castPtr p)-                      poke q r-                      pokeElemOff q 1 i-+                         a <- peek q+                         b <- peekElemOff q 1+                         return (a,b)+    poke p (a,b) = do let q = (castPtr p)+                      poke q a+                      pokeElemOff q 1 b  ----------------------------------------------------------------------------- @@ -433,9 +431,7 @@  -- | find the joint probability of occuring for each element of the input vector pair probPaired :: Histogram2D -> (Vector (Double,Double)) -> Vector Double-probPaired h z = let l = unzip $ toList z-                     z' = (fromList $ fst l,fromList $ snd l)-                 in prob h z'+probPaired h z = (countPaired h z) / (scalar $ sum h)  ----------------------------------------------------------------------------- @@ -650,7 +646,7 @@ ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- ------------------------------------------------------------------------------+{- unzipPair :: Vector (Double,Double) -> (Vector Double,Vector Double) unzipPair v = unsafePerformIO $ do               a <- createVector $ dim v@@ -659,5 +655,5 @@               return (a,b)  foreign import ccall "histogram-aux.h unzip_double_pair" histogram2d_unzip_double_pair :: CInt -> Ptr (Double,Double) -> CInt -> Ptr Double -> CInt -> Ptr Double -> IO CInt-+-} -----------------------------------------------------------------------------