summaryrefslogtreecommitdiff
path: root/lib/Data
diff options
context:
space:
mode:
authorVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-07-05 09:21:57 +0000
committerVivian McPhail <haskell.vivian.mcphail@gmail.com>2010-07-05 09:21:57 +0000
commit21ccf5342555bd41a61ed132b09eacebf3c71feb (patch)
treebad2e548a20ea0d1dbe3813199e40b315634ac7d /lib/Data
parentdd054da0524abdb14d013c9f9f43272515b77b6e (diff)
added Vectors typeclass and refactored
Diffstat (limited to 'lib/Data')
-rw-r--r--lib/Data/Packed/Internal/Signatures.hs4
-rw-r--r--lib/Data/Packed/Vector.hs7
2 files changed, 9 insertions, 2 deletions
diff --git a/lib/Data/Packed/Internal/Signatures.hs b/lib/Data/Packed/Internal/Signatures.hs
index 4d984e3..1370dbc 100644
--- a/lib/Data/Packed/Internal/Signatures.hs
+++ b/lib/Data/Packed/Internal/Signatures.hs
@@ -20,6 +20,7 @@ import Foreign.C.Types
20 20
21type PF = Ptr Float -- 21type PF = Ptr Float --
22type PD = Ptr Double -- 22type PD = Ptr Double --
23type PQ = Ptr (Complex Float) --
23type PC = Ptr (Complex Double) -- 24type PC = Ptr (Complex Double) --
24type TF = CInt -> PF -> IO CInt -- 25type TF = CInt -> PF -> IO CInt --
25type TFF = CInt -> PF -> TF -- 26type TFF = CInt -> PF -> TF --
@@ -53,6 +54,9 @@ type TCMCMCM = CInt -> CInt -> PC -> TCMCM --
53type TCV = CInt -> PC -> IO CInt -- 54type TCV = CInt -> PC -> IO CInt --
54type TCVCV = CInt -> PC -> TCV -- 55type TCVCV = CInt -> PC -> TCV --
55type TCVCVCV = CInt -> PC -> TCVCV -- 56type TCVCVCV = CInt -> PC -> TCVCV --
57type TQV = CInt -> PQ -> IO CInt --
58type TQVQV = CInt -> PQ -> TQV --
59type TQVQVQV = CInt -> PQ -> TQVQV --
56type TCMCV = CInt -> CInt -> PC -> TCV -- 60type TCMCV = CInt -> CInt -> PC -> TCV --
57type TVCV = CInt -> PD -> TCV -- 61type TVCV = CInt -> PD -> TCV --
58type TCVM = CInt -> PC -> TM -- 62type TCVM = CInt -> PC -> TM --
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs
index 4f25b6f..62fc8af 100644
--- a/lib/Data/Packed/Vector.hs
+++ b/lib/Data/Packed/Vector.hs
@@ -19,8 +19,9 @@ module Data.Packed.Vector (
19 subVector, takesV, join, 19 subVector, takesV, join,
20 constant, linspace, 20 constant, linspace,
21 vecdisp, 21 vecdisp,
22 vectorFMax, vectorFMin, vectorFMaxIndex, vectorFMinIndex, 22-- moved to Numeric.LinearAlgebra.Interface typeclass
23 vectorMax, vectorMin, vectorMaxIndex, vectorMinIndex, 23-- vectorFMax, vectorFMin, vectorFMaxIndex, vectorFMinIndex,
24-- vectorMax, vectorMin, vectorMaxIndex, vectorMinIndex,
24 mapVector, zipVector, 25 mapVector, zipVector,
25 fscanfVector, fprintfVector, freadVector, fwriteVector, 26 fscanfVector, fprintfVector, freadVector, fwriteVector,
26 foldLoop, foldVector, foldVectorG 27 foldLoop, foldVector, foldVectorG
@@ -82,6 +83,7 @@ linspace n (a,b) = add a $ scale s $ fromList [0 .. fromIntegral n-1]
82 add = vectorMapValR AddConstant 83 add = vectorMapValR AddConstant
83 s = (b-a)/fromIntegral (n-1) 84 s = (b-a)/fromIntegral (n-1)
84 85
86{-
85vectorFMax :: Vector Float -> Float 87vectorFMax :: Vector Float -> Float
86vectorFMax = toScalarF Max 88vectorFMax = toScalarF Max
87 89
@@ -105,6 +107,7 @@ vectorMaxIndex = round . toScalarR MaxIdx
105 107
106vectorMinIndex :: Vector Double -> Int 108vectorMinIndex :: Vector Double -> Int
107vectorMinIndex = round . toScalarR MinIdx 109vectorMinIndex = round . toScalarR MinIdx
110-}
108 111
109{- | creates a vector with a given number of equal components: 112{- | creates a vector with a given number of equal components:
110 113