-- Do not edit! Automatically created with doctest-extract from src/Numeric/BLAS/Subobject/View/Matrix.hs {-# LINE 24 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} {-# OPTIONS_GHC -XTypeOperators #-} module Test.Numeric.BLAS.Subobject.View.Matrix where import qualified Test.DocTest.Driver as DocTest {-# LINE 27 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} import qualified Numeric.BLAS.Subobject.View.Matrix as ViewMatrix import qualified Numeric.BLAS.Subobject.View as View import qualified Numeric.BLAS.Subobject.Layout as Layout import Test.Slice (shapeInt) import qualified Data.Array.Comfort.Boxed as Array import qualified Data.Array.Comfort.Shape as Shape import Data.Array.Comfort.Shape ((::+)((::+))) import Data.Array.Comfort.Boxed ((!)) import Control.Applicative (liftA3, pure) import qualified Test.QuickCheck as QC genView :: (height,width) -> QC.Gen (ViewMatrix.T (height,width)) genView sh = liftA3 View.Cons (QC.choose (0,100)) (fmap Layout.Submatrix $ QC.choose (1,100)) (pure sh) type ShapeInt = Shape.ZeroBased Int test :: DocTest.T () test = do DocTest.printPrefix "Numeric.BLAS.Subobject.View.Matrix:106: " {-# LINE 106 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} DocTest.property( {-# LINE 106 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} QC.forAll (QC.choose (1,100)) $ \numRows -> QC.forAll (QC.choose (0,100)) $ \numColumns -> QC.forAll (genView (shapeInt numRows, shapeInt numColumns)) $ \view -> QC.forAll (QC.elements $ Shape.indices $ shapeInt numRows) $ \ix -> ViewMatrix.row ix view == ViewMatrix.rowArray view ! ix ) DocTest.printPrefix "Numeric.BLAS.Subobject.View.Matrix:128: " {-# LINE 128 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} DocTest.property( {-# LINE 128 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} QC.forAll (QC.choose (0,100)) $ \numRows -> QC.forAll (QC.choose (1,100)) $ \numColumns -> QC.forAll (genView (shapeInt numRows, shapeInt numColumns)) $ \view -> QC.forAll (QC.elements $ Shape.indices $ shapeInt numColumns) $ \ix -> ViewMatrix.column ix view == ViewMatrix.columnArray view ! ix ) DocTest.printPrefix "Numeric.BLAS.Subobject.View.Matrix:153: " {-# LINE 153 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} DocTest.property( {-# LINE 153 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} QC.forAll (QC.choose (1,100)) $ \numTopRows -> QC.forAll (QC.choose (1,100)) $ \numBottomRows -> QC.forAll (QC.choose (0,100)) $ \numColumns -> QC.forAll (genView (shapeInt numTopRows ::+ shapeInt numBottomRows, shapeInt numColumns)) $ \view -> ViewMatrix.rowArray view == Array.append (ViewMatrix.rowArray (ViewMatrix.top view)) (ViewMatrix.rowArray (ViewMatrix.bottom view)) ) DocTest.printPrefix "Numeric.BLAS.Subobject.View.Matrix:181: " {-# LINE 181 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} DocTest.property( {-# LINE 181 "src/Numeric/BLAS/Subobject/View/Matrix.hs" #-} QC.forAll (QC.choose (1,100)) $ \numLeftColumns -> QC.forAll (QC.choose (1,100)) $ \numRightColumns -> QC.forAll (QC.choose (0,100)) $ \numRows -> QC.forAll (genView (shapeInt numRows, shapeInt numLeftColumns ::+ shapeInt numRightColumns)) $ \view -> ViewMatrix.columnArray view == Array.append (ViewMatrix.columnArray (ViewMatrix.left view)) (ViewMatrix.columnArray (ViewMatrix.right view)) )