Stability | experimental |
---|---|
Maintainer | Patrick Perry <patperry@stanford.edu> |
Test generators for BLAS types.
- class (BLAS3 e, Arbitrary e) => TestElem e where
- isTestElemElem :: e -> Bool
- elements :: TestElem e => Int -> Gen [e]
- realElements :: TestElem e => Int -> Gen [e]
- dim :: Gen Int
- vector :: TestElem e => Int -> Gen (Vector n e)
- shape :: Gen (Int, Int)
- matrix :: TestElem e => (Int, Int) -> Gen (Matrix (m, n) e)
- bandwidths :: (Int, Int) -> Gen (Int, Int)
- banded :: TestElem e => (Int, Int) -> (Int, Int) -> Gen (Banded (m, n) e)
Testable element types
class (BLAS3 e, Arbitrary e) => TestElem e whereSource
Element types that can be tested with QuickCheck properties.
isTestElemElem :: e -> BoolSource
Inicates whether or not the value should be used in tests. For
Double
s, isTestElemElem e
is defined as
not (isNaN e || isInfinite e || isDenormalized e)
.
Generating random objects
Elements
elements :: TestElem e => Int -> Gen [e]Source
Generate a list of elements suitable for testing with.
realElements :: TestElem e => Int -> Gen [e]Source
Generate a list of elements for testing that have no imaginary part.
Vectors
Dense matrices
matrix :: TestElem e => (Int, Int) -> Gen (Matrix (m, n) e)Source
Generate a random matrix of the given shape.