comfort-blas 0.0.3 → 0.0.3.1
raw patch · 3 files changed
+49/−19 lines, 3 filesdep ~containersdep ~deepseqPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: containers, deepseq
API changes (from Hackage documentation)
Files
- comfort-blas.cabal +3/−3
- src/Numeric/BLAS/Slice.hs +15/−1
- test/Test/Numeric/BLAS/Slice.hs +31/−15
comfort-blas.cabal view
@@ -1,6 +1,6 @@ Cabal-Version: 2.2 Name: comfort-blas-Version: 0.0.3+Version: 0.0.3.1 License: BSD-3-Clause License-File: LICENSE Author: Henning Thielemann <haskell@henning-thielemann.de>@@ -17,7 +17,7 @@ Makefile Source-Repository this- Tag: 0.0.3+ Tag: 0.0.3.1 Type: darcs Location: https://hub.darcs.net/thielema/comfort-blas/ @@ -35,7 +35,7 @@ non-empty >=0.3.1 && <0.4, containers >=0.4 && <0.8, semigroups >=0.19 && <0.21,- deepseq >=1.3 && <1.6,+ deepseq >=1.3 && <1.7, transformers >=0.4 && <0.7, utility-ht >=0.0.13 && <0.1, base >=4.5 && <5
src/Numeric/BLAS/Slice.hs view
@@ -101,6 +101,20 @@ List.take (Shape.size sh1) $ iterate (k+) s +{- |+prop> :{+ QC.forAll (QC.choose (1,100)) $ \numTopRows ->+ QC.forAll (QC.choose (1,100)) $ \numBottomRows ->+ QC.forAll (QC.choose (0,100)) $ \numColumns ->+ QC.forAll (genSlice (shapeInt numTopRows ::+ shapeInt numBottomRows,+ shapeInt numColumns)) $ \slice ->+ Slice.rowArray slice+ ==+ Array.append+ (Slice.rowArray (Slice.topSubmatrix slice))+ (Slice.rowArray (Slice.bottomSubmatrix slice))+:}+-} topSubmatrix :: (Shape.C sh, Shape.C sh0, Shape.C sh1) => T (sh0::+sh1, sh) -> T (sh0,sh)@@ -111,7 +125,7 @@ (Shape.C sh, Shape.C sh0, Shape.C sh1) => T (sh0::+sh1, sh) -> T (sh1,sh) bottomSubmatrix (Cons s k (sh0::+sh1, sh)) =- Cons (s + k * Shape.size sh0) k (sh1,sh)+ Cons (s + k * Shape.size (sh0,sh)) k (sh1,sh) diagonal :: (Shape.C sh) => T (Shape.Square sh) -> T sh
test/Test/Numeric/BLAS/Slice.hs view
@@ -62,33 +62,49 @@ {-# LINE 92 "src/Numeric/BLAS/Slice.hs" #-} QC.forAll (QC.choose (0,100)) $ \numRows -> QC.forAll (QC.choose (1,100)) $ \numColumns -> QC.forAll (genSlice (shapeInt numRows, shapeInt numColumns)) $ \slice -> QC.forAll (QC.elements $ Shape.indices $ shapeInt numColumns) $ \ix -> Slice.column ix slice == Slice.columnArray slice ! ix )- DocTest.printPrefix "Numeric.BLAS.Slice:173: "-{-# LINE 173 "src/Numeric/BLAS/Slice.hs" #-}+ DocTest.printPrefix "Numeric.BLAS.Slice:105: "+{-# LINE 105 "src/Numeric/BLAS/Slice.hs" #-} DocTest.property(-{-# LINE 173 "src/Numeric/BLAS/Slice.hs" #-}+{-# LINE 105 "src/Numeric/BLAS/Slice.hs" #-}+ + QC.forAll (QC.choose (1,100)) $ \numTopRows ->+ QC.forAll (QC.choose (1,100)) $ \numBottomRows ->+ QC.forAll (QC.choose (0,100)) $ \numColumns ->+ QC.forAll (genSlice (shapeInt numTopRows ::+ shapeInt numBottomRows,+ shapeInt numColumns)) $ \slice ->+ Slice.rowArray slice+ ==+ Array.append+ (Slice.rowArray (Slice.topSubmatrix slice))+ (Slice.rowArray (Slice.bottomSubmatrix slice))+ )+ DocTest.printPrefix "Numeric.BLAS.Slice:187: "+{-# LINE 187 "src/Numeric/BLAS/Slice.hs" #-}+ DocTest.property(+{-# LINE 187 "src/Numeric/BLAS/Slice.hs" #-} QC.forAll (genSlice =<< genAppend) $ \slice -> Slice.take (case Slice.shape slice of (sh::+_) -> Shape.size sh) (toShapeInt slice) == toShapeInt (Slice.left slice) )- DocTest.printPrefix "Numeric.BLAS.Slice:182: "-{-# LINE 182 "src/Numeric/BLAS/Slice.hs" #-}+ DocTest.printPrefix "Numeric.BLAS.Slice:196: "+{-# LINE 196 "src/Numeric/BLAS/Slice.hs" #-} DocTest.property(-{-# LINE 182 "src/Numeric/BLAS/Slice.hs" #-}+{-# LINE 196 "src/Numeric/BLAS/Slice.hs" #-} QC.forAll (genSlice =<< genAppend) $ \slice -> Slice.drop (case Slice.shape slice of (sh::+_) -> Shape.size sh) (toShapeInt slice) == toShapeInt (Slice.right slice) )- DocTest.printPrefix "Numeric.BLAS.Slice:193: "-{-# LINE 193 "src/Numeric/BLAS/Slice.hs" #-}+ DocTest.printPrefix "Numeric.BLAS.Slice:207: "+{-# LINE 207 "src/Numeric/BLAS/Slice.hs" #-} DocTest.property(-{-# LINE 193 "src/Numeric/BLAS/Slice.hs" #-}+{-# LINE 207 "src/Numeric/BLAS/Slice.hs" #-} \(QC.NonNegative n) -> QC.forAll (genSlice $ shapeInt n) $ \slice (QC.NonNegative start) (QC.NonNegative size) -> Slice.sub start size slice == Slice.take size (Slice.drop start slice) )- DocTest.printPrefix "Numeric.BLAS.Slice:203: "-{-# LINE 203 "src/Numeric/BLAS/Slice.hs" #-}+ DocTest.printPrefix "Numeric.BLAS.Slice:217: "+{-# LINE 217 "src/Numeric/BLAS/Slice.hs" #-} DocTest.property(-{-# LINE 203 "src/Numeric/BLAS/Slice.hs" #-}+{-# LINE 217 "src/Numeric/BLAS/Slice.hs" #-} QC.forAll (fmap shapeInt $ QC.choose (0,100)) $ \shapeA -> QC.forAll (fmap shapeInt $ QC.choose (0,100)) $ \shapeB -> QC.forAll (fmap shapeInt $ QC.choose (0,100)) $ \shapeC -> QC.forAll (genSlice2 (Map.fromList $ ('a', shapeA) : ('b', shapeB) : ('c', shapeC) : []) (shapeA ::+ shapeB ::+ shapeC)) $ \(sliceMap, sliceParted) -> Slice.map sliceMap Map.! 'b' == Slice.left (Slice.right sliceParted) )- DocTest.printPrefix "Numeric.BLAS.Slice:205: "-{-# LINE 205 "src/Numeric/BLAS/Slice.hs" #-}+ DocTest.printPrefix "Numeric.BLAS.Slice:219: "+{-# LINE 219 "src/Numeric/BLAS/Slice.hs" #-} DocTest.property(-{-# LINE 205 "src/Numeric/BLAS/Slice.hs" #-}+{-# LINE 219 "src/Numeric/BLAS/Slice.hs" #-} QC.forAll (QC.choose (0,100)) $ \numRows -> QC.forAll (QC.choose (0,100)) $ \numColumns -> let rowShape = shapeInt numRows; columnShape = shapeInt numColumns; mapShape_ = Map.fromList $ map (\k -> (k, columnShape)) (Shape.indices rowShape) in QC.forAll (genSlice2 mapShape_ (rowShape, columnShape)) $ \(sliceMap, sliceMatrix) -> Map.toAscList (Slice.map sliceMap) == Array.toAssociations (Slice.rowArray sliceMatrix) )