diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Data/Packed/Internal/Matrix.hs | 2 | ||||
-rw-r--r-- | lib/Data/Packed/Internal/Vector.hs | 14 | ||||
-rw-r--r-- | lib/Data/Packed/Matrix.hs | 2 | ||||
-rw-r--r-- | lib/Data/Packed/Vector.hs | 4 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Algorithms.hs | 2 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Util.hs | 4 | ||||
-rw-r--r-- | lib/Numeric/LinearAlgebra/Util/Convolution.hs | 2 |
7 files changed, 15 insertions, 15 deletions
diff --git a/lib/Data/Packed/Internal/Matrix.hs b/lib/Data/Packed/Internal/Matrix.hs index 7504b39..5e6e649 100644 --- a/lib/Data/Packed/Internal/Matrix.hs +++ b/lib/Data/Packed/Internal/Matrix.hs | |||
@@ -154,7 +154,7 @@ toLists m = splitEvery (cols m) . toList . flatten $ m | |||
154 | fromRows :: Element t => [Vector t] -> Matrix t | 154 | fromRows :: Element t => [Vector t] -> Matrix t |
155 | fromRows vs = case compatdim (map dim vs) of | 155 | fromRows vs = case compatdim (map dim vs) of |
156 | Nothing -> error "fromRows applied to [] or to vectors with different sizes" | 156 | Nothing -> error "fromRows applied to [] or to vectors with different sizes" |
157 | Just c -> reshape c . Data.Packed.Internal.Vector.join . map (adapt c) $ vs | 157 | Just c -> reshape c . vjoin . map (adapt c) $ vs |
158 | where | 158 | where |
159 | adapt c v | dim v == c = v | 159 | adapt c v | dim v == c = v |
160 | | otherwise = constantD (v@>0) c | 160 | | otherwise = constantD (v@>0) c |
diff --git a/lib/Data/Packed/Internal/Vector.hs b/lib/Data/Packed/Internal/Vector.hs index c99f4f0..e5c3196 100644 --- a/lib/Data/Packed/Internal/Vector.hs +++ b/lib/Data/Packed/Internal/Vector.hs | |||
@@ -16,7 +16,7 @@ | |||
16 | module Data.Packed.Internal.Vector ( | 16 | module Data.Packed.Internal.Vector ( |
17 | Vector, dim, | 17 | Vector, dim, |
18 | fromList, toList, (|>), | 18 | fromList, toList, (|>), |
19 | Data.Packed.Internal.Vector.join, (@>), safe, at, at', subVector, takesV, | 19 | vjoin, (@>), safe, at, at', subVector, takesV, |
20 | mapVector, mapVectorWithIndex, zipVectorWith, unzipVectorWith, | 20 | mapVector, mapVectorWithIndex, zipVectorWith, unzipVectorWith, |
21 | mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_, | 21 | mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_, |
22 | foldVector, foldVectorG, foldLoop, foldVectorWithIndex, | 22 | foldVector, foldVectorG, foldLoop, foldVectorWithIndex, |
@@ -183,16 +183,16 @@ infixl 9 @> | |||
183 | (@>) = at | 183 | (@>) = at |
184 | 184 | ||
185 | 185 | ||
186 | {- | creates a new Vector by joining a list of Vectors | 186 | {- | concatenate a list of vectors |
187 | 187 | ||
188 | @> join [fromList [1..5], constant 1 3] | 188 | @> vjoin [fromList [1..5], constant 1 3] |
189 | 8 |> [1.0,2.0,3.0,4.0,5.0,1.0,1.0,1.0]@ | 189 | 8 |> [1.0,2.0,3.0,4.0,5.0,1.0,1.0,1.0]@ |
190 | 190 | ||
191 | -} | 191 | -} |
192 | join :: Storable t => [Vector t] -> Vector t | 192 | vjoin :: Storable t => [Vector t] -> Vector t |
193 | join [] = error "joining zero vectors" | 193 | vjoin [] = error "vjoin zero vectors" |
194 | join [v] = v | 194 | vjoin [v] = v |
195 | join as = unsafePerformIO $ do | 195 | vjoin as = unsafePerformIO $ do |
196 | let tot = sum (map dim as) | 196 | let tot = sum (map dim as) |
197 | r <- createVector tot | 197 | r <- createVector tot |
198 | unsafeWith r $ \ptr -> | 198 | unsafeWith r $ \ptr -> |
diff --git a/lib/Data/Packed/Matrix.hs b/lib/Data/Packed/Matrix.hs index 1b67820..ab02670 100644 --- a/lib/Data/Packed/Matrix.hs +++ b/lib/Data/Packed/Matrix.hs | |||
@@ -103,7 +103,7 @@ breakAt c l = (a++[c],tail b) where | |||
103 | joinVert :: Element t => [Matrix t] -> Matrix t | 103 | joinVert :: Element t => [Matrix t] -> Matrix t |
104 | joinVert ms = case common cols ms of | 104 | joinVert ms = case common cols ms of |
105 | Nothing -> error "(impossible) joinVert on matrices with different number of columns" | 105 | Nothing -> error "(impossible) joinVert on matrices with different number of columns" |
106 | Just c -> reshape c $ join (map flatten ms) | 106 | Just c -> reshape c $ vjoin (map flatten ms) |
107 | 107 | ||
108 | -- | creates a matrix from a horizontal list of matrices | 108 | -- | creates a matrix from a horizontal list of matrices |
109 | joinHoriz :: Element t => [Matrix t] -> Matrix t | 109 | joinHoriz :: Element t => [Matrix t] -> Matrix t |
diff --git a/lib/Data/Packed/Vector.hs b/lib/Data/Packed/Vector.hs index dad5d28..a705ce4 100644 --- a/lib/Data/Packed/Vector.hs +++ b/lib/Data/Packed/Vector.hs | |||
@@ -19,7 +19,7 @@ module Data.Packed.Vector ( | |||
19 | Vector, | 19 | Vector, |
20 | fromList, (|>), toList, buildVector, | 20 | fromList, (|>), toList, buildVector, |
21 | dim, (@>), | 21 | dim, (@>), |
22 | subVector, takesV, join, | 22 | subVector, takesV, vjoin, |
23 | mapVector, mapVectorWithIndex, zipVector, zipVectorWith, unzipVector, unzipVectorWith, | 23 | mapVector, mapVectorWithIndex, zipVector, zipVectorWith, unzipVector, unzipVectorWith, |
24 | mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_, | 24 | mapVectorM, mapVectorM_, mapVectorWithIndexM, mapVectorWithIndexM_, |
25 | foldLoop, foldVector, foldVectorG, foldVectorWithIndex | 25 | foldLoop, foldVector, foldVectorG, foldVectorWithIndex |
@@ -61,7 +61,7 @@ instance (Binary a, Storable a) => Binary (Vector a) where | |||
61 | get = do | 61 | get = do |
62 | d <- get | 62 | d <- get |
63 | vs <- mapM getVector $ chunks d | 63 | vs <- mapM getVector $ chunks d |
64 | return $! join vs | 64 | return $! vjoin vs |
65 | 65 | ||
66 | #endif | 66 | #endif |
67 | 67 | ||
diff --git a/lib/Numeric/LinearAlgebra/Algorithms.hs b/lib/Numeric/LinearAlgebra/Algorithms.hs index 4823cec..a3f541b 100644 --- a/lib/Numeric/LinearAlgebra/Algorithms.hs +++ b/lib/Numeric/LinearAlgebra/Algorithms.hs | |||
@@ -484,7 +484,7 @@ zh k v = fromList $ replicate (k-1) 0 ++ (1:drop k xs) | |||
484 | where xs = toList v | 484 | where xs = toList v |
485 | 485 | ||
486 | zt 0 v = v | 486 | zt 0 v = v |
487 | zt k v = join [subVector 0 (dim v - k) v, konst 0 k] | 487 | zt k v = vjoin [subVector 0 (dim v - k) v, konst 0 k] |
488 | 488 | ||
489 | 489 | ||
490 | unpackQR :: (Field t) => (Matrix t, Vector t) -> (Matrix t, Matrix t) | 490 | unpackQR :: (Field t) => (Matrix t, Vector t) -> (Matrix t, Matrix t) |
diff --git a/lib/Numeric/LinearAlgebra/Util.hs b/lib/Numeric/LinearAlgebra/Util.hs index 532556e..f7c40d7 100644 --- a/lib/Numeric/LinearAlgebra/Util.hs +++ b/lib/Numeric/LinearAlgebra/Util.hs | |||
@@ -97,7 +97,7 @@ ones r c = konst 1 (r,c) | |||
97 | -- | concatenation of real vectors | 97 | -- | concatenation of real vectors |
98 | infixl 3 & | 98 | infixl 3 & |
99 | (&) :: Vector Double -> Vector Double -> Vector Double | 99 | (&) :: Vector Double -> Vector Double -> Vector Double |
100 | a & b = Numeric.Container.join [a,b] | 100 | a & b = vjoin [a,b] |
101 | 101 | ||
102 | -- | horizontal concatenation of real matrices | 102 | -- | horizontal concatenation of real matrices |
103 | infixl 3 ! | 103 | infixl 3 ! |
@@ -206,7 +206,7 @@ vec = flatten . trans | |||
206 | 206 | ||
207 | vech :: Element t => Matrix t -> Vector t | 207 | vech :: Element t => Matrix t -> Vector t |
208 | -- ^ half-vectorization (of the lower triangular part) | 208 | -- ^ half-vectorization (of the lower triangular part) |
209 | vech m = Numeric.Container.join . zipWith f [0..] . toColumns $ m | 209 | vech m = vjoin . zipWith f [0..] . toColumns $ m |
210 | where | 210 | where |
211 | f k v = subVector k (dim v - k) v | 211 | f k v = subVector k (dim v - k) v |
212 | 212 | ||
diff --git a/lib/Numeric/LinearAlgebra/Util/Convolution.hs b/lib/Numeric/LinearAlgebra/Util/Convolution.hs index 32cb188..be9b1eb 100644 --- a/lib/Numeric/LinearAlgebra/Util/Convolution.hs +++ b/lib/Numeric/LinearAlgebra/Util/Convolution.hs | |||
@@ -46,7 +46,7 @@ fromList [-1.0,0.0,1.0] | |||
46 | conv ker v = corr ker' v' | 46 | conv ker v = corr ker' v' |
47 | where | 47 | where |
48 | ker' = (flatten.fliprl.asRow) ker | 48 | ker' = (flatten.fliprl.asRow) ker |
49 | v' | dim ker > 1 = join [z,v,z] | 49 | v' | dim ker > 1 = vjoin [z,v,z] |
50 | | otherwise = v | 50 | | otherwise = v |
51 | z = constant 0 (dim ker -1) | 51 | z = constant 0 (dim ker -1) |
52 | 52 | ||