diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-06-03 19:56:05 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-06-03 19:56:05 +0200 |
commit | a25d4061e219cec153f066fddbf710abd63b5e48 (patch) | |
tree | e569635cffe75025ffc32faec38f8c3813c941d6 /test | |
parent | 91e43dd2e403ca892e235087970f52bb952b469f (diff) |
Move sh*Tail to main ox-arrays
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/C.hs | 5 | ||||
-rw-r--r-- | test/Util.hs | 5 |
2 files changed, 3 insertions, 7 deletions
diff --git a/test/Tests/C.hs b/test/Tests/C.hs index b98c23f..2a3949f 100644 --- a/test/Tests/C.hs +++ b/test/Tests/C.hs @@ -20,6 +20,7 @@ import Data.Array.Mixed.XArray qualified as X import Data.Array.Mixed.Lemmas import Data.Array.Nested import Data.Array.Nested.Internal.Mixed +import Data.Array.Nested.Internal.Shape import Hedgehog import Hedgehog.Internal.Property (forAllT) @@ -42,7 +43,7 @@ tests = testGroup "C" let inrank = SNat @(n + 1) sh <- forAll $ genShR inrank -- traceM ("sh: " ++ show sh ++ " -> " ++ show (product sh)) - guard (all (> 0) (toList (rshTail sh))) -- only constrain the tail + guard (all (> 0) (toList (shrTail sh))) -- only constrain the tail arr <- forAllT $ OR.fromVector @Double @(n + 1) (toList sh) <$> genStorables (Range.singleton (product sh)) (\w -> fromIntegral w / fromIntegral (maxBound :: Word64)) @@ -64,7 +65,7 @@ tests = testGroup "C" sht <- shuffleShR (0 :$: shtt) -- n n <- Gen.int (Range.linear 0 20) return (n :$: sht) -- n + 1 - guard (any (== 0) (toList (rshTail sh))) + guard (any (== 0) (toList (shrTail sh))) -- traceM ("sh: " ++ show sh ++ " -> " ++ show (product sh)) let arr = OR.fromList @Double @(n + 1) (toList sh) [] let rarr = rfromOrthotope inrank arr diff --git a/test/Util.hs b/test/Util.hs index a358d30..f377e5b 100644 --- a/test/Util.hs +++ b/test/Util.hs @@ -13,7 +13,6 @@ import Data.Array.RankedS qualified as OR import GHC.TypeLits import Data.Array.Mixed.Types (fromSNat') -import Data.Array.Nested -- Returns highest value that satisfies the predicate, or `lo` if none does @@ -33,7 +32,3 @@ orSumOuter1 :: (OR.Unbox a, Num a) => SNat n -> OR.Array (n + 1) a -> OR.Array n orSumOuter1 (sn@SNat :: SNat n) = let n = fromSNat' sn in OR.rerank @n @1 @0 (OR.scalar . OR.sumA) . OR.transpose ([1 .. n] ++ [0]) - -rshTail :: ShR (n + 1) i -> ShR n i -rshTail (_ :$: sh) = sh -rshTail ZSR = error "unreachable" |