accelerate-arithmetic 1.0.0.1 → 1.0.0.2
raw patch · 3 files changed
+32/−11 lines, 3 filesdep ~acceleratedep ~accelerate-utilityPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: accelerate, accelerate-utility
API changes (from Hackage documentation)
- Data.Array.Accelerate.LinearAlgebra: type Matrix ix a = Acc (Array ((ix :. Int) :. Int) a)
+ Data.Array.Accelerate.LinearAlgebra: type Matrix ix a = Acc (Array (ix :. Int :. Int) a)
- Data.Array.Accelerate.LinearAlgebra: withMatrixIndex :: (Shape ix, Slice ix, Lift Exp a) => ((Exp ix :. Exp Int) :. Exp Int -> a) -> (Exp ((ix :. Int) :. Int) -> Exp (Plain a))
+ Data.Array.Accelerate.LinearAlgebra: withMatrixIndex :: (Shape ix, Slice ix, Lift Exp a) => (((Exp ix :. Exp Int) :. Exp Int) -> a) -> Exp ((ix :. Int) :. Int) -> Exp (Plain a)
- Data.Array.Accelerate.LinearAlgebra: withVectorIndex :: (Shape ix, Slice ix, Lift Exp a) => (Exp ix :. Exp Int -> a) -> (Exp (ix :. Int) -> Exp (Plain a))
+ Data.Array.Accelerate.LinearAlgebra: withVectorIndex :: (Shape ix, Slice ix, Lift Exp a) => ((Exp ix :. Exp Int) -> a) -> Exp (ix :. Int) -> Exp (Plain a)
- Data.Array.Accelerate.LinearAlgebra.Matrix.Banded: Symmetric :: (Matrix ix a) -> Symmetric ix a
+ Data.Array.Accelerate.LinearAlgebra.Matrix.Banded: Symmetric :: Matrix ix a -> Symmetric ix a
Files
- accelerate-arithmetic.cabal +7/−7
- private/Data/Array/Accelerate/LinearAlgebra/Private.hs +21/−1
- src/Data/Array/Accelerate/LinearAlgebra/Matrix/Sparse.hs +4/−3
accelerate-arithmetic.cabal view
@@ -1,10 +1,10 @@ Name: accelerate-arithmetic-Version: 1.0.0.1+Version: 1.0.0.2 License: BSD3 License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de> Maintainer: Henning Thielemann <haskell@henning-thielemann.de>-Homepage: http://hub.darcs.net/thielema/accelerate-arithmetic/+Homepage: https://hub.darcs.net/thielema/accelerate-arithmetic/ Category: Math Synopsis: Linear algebra and interpolation using the Accelerate framework Description:@@ -17,18 +17,18 @@ Build-Type: Simple Source-Repository this- Tag: 1.0.0.1+ Tag: 1.0.0.2 Type: darcs- Location: http://hub.darcs.net/thielema/accelerate-arithmetic/+ Location: https://hub.darcs.net/thielema/accelerate-arithmetic/ Source-Repository head Type: darcs- Location: http://hub.darcs.net/thielema/accelerate-arithmetic/+ Location: https://hub.darcs.net/thielema/accelerate-arithmetic/ Library Build-Depends:- accelerate-utility >=1.0 && <1.1,- accelerate >=1.0 && <1.2,+ accelerate-utility >=1.1 && <1.2,+ accelerate >=1.3 && <1.5, utility-ht >=0.0.8 && <0.1, QuickCheck >=2.4 && <3, base >=4.5 && <5
private/Data/Array/Accelerate/LinearAlgebra/Private.hs view
@@ -6,6 +6,7 @@ import qualified Data.Array.Accelerate.Utility.Lift.Exp as Exp import qualified Data.Array.Accelerate.Utility.Arrange as Arrange import qualified Data.Array.Accelerate as A+import Data.Array.Accelerate.Utility.Lift.Exp (expr) import Data.Array.Accelerate (Acc, Array, Exp, Any(Any), All(All), Z(Z), (:.)((:.))) @@ -82,7 +83,7 @@ A.zipWith (*) m (A.replicate (A.lift $ Any :. rows :. All) v) -multiplyMatrixMatrix ::+multiplyMatrixMatrix, _multiplyMatrixMatrix, _multiplyMatrixMatrix2 :: (A.Shape ix, A.Slice ix, A.Num a) => Matrix ix a -> Matrix ix a ->@@ -94,6 +95,25 @@ A.zipWith (*) (A.replicate (A.lift $ Any :. All :. All :. cols) x) (A.replicate (A.lift $ Any :. rows :. All :. All) y)++_multiplyMatrixMatrix x y =+ case (matrixShape x, matrixShape y) of+ (_ :. rows :. _cols, _ :. _rows :. cols) ->+ A.fold1 (+) $+ A.zipWith (*)+ (A.replicate (A.lift $ Any :. All :. cols :. All) x)+ (A.replicate (A.lift $ Any :. rows :. All :. All) $ transpose y)++_multiplyMatrixMatrix2 x y =+ case (matrixShape x, matrixShape y) of+ (_ :. rowsX :. _colsX, shapeY :. rowsY :. colsY) ->+ A.fold1 (+) $+ A.zipWith (*)+ (A.replicate (A.lift $ Any :. All :. colsY :. All) x)+ (A.backpermute (A.lift $ shapeY :. rowsX :. colsY :. rowsY)+ (Exp.modify (expr:.expr:.expr:.expr) $+ \(ix:._:.j:.k) -> ix:.k:.j)+ y) newtonInverseStep :: (A.Shape ix, A.Slice ix, A.Num a) =>
src/Data/Array/Accelerate/LinearAlgebra/Matrix/Sparse.hs view
@@ -45,7 +45,7 @@ Vector ix a multiplyColumnsVector (Columns rows m) v = Arrange.scatter (+)- (realIndex m)+ (A.map A.Just_ $ realIndex m) (case matrixShape m of sh :. _rows :. _cols -> A.fill (A.lift $ sh :. rows) 0) $ A.zipWith (*)@@ -94,7 +94,7 @@ in Arrange.scatter (+) (Arrange.mapWithIndex (Exp.modify2 expr (expr,expr) $ \mix (k,j) ->- global mix :. k :. j) $+ Just (global mix :. k :. j)) $ ixs) (A.fill (A.lift $ global (A.shape prods) :. rows :. cols) 0) prods@@ -118,7 +118,8 @@ Arrange.scatter (+) (Arrange.mapWithIndex (Exp.modify2 expr (expr,expr) $ \mix (k,j) ->- k A.> j ? (A.ignore, A.lift $ global mix :. k :. j-k)) $+ k A.> j ?+ (A.Nothing_, A.lift $ Just (global mix :. k :. j-k))) $ ixs) (A.fill (A.lift $ global (A.shape prods) :. cols :. width) 0) prods