From 1abb0c11efd2ba650c0a20de8047efbde2cc6adf Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 11 Mar 2025 00:22:26 +0100 Subject: test: Split adTestGen into one function per test case This improves (compactifies) hedgehog output --- src/ForwardAD.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ForwardAD.hs') diff --git a/src/ForwardAD.hs b/src/ForwardAD.hs index e867d66..af35f91 100644 --- a/src/ForwardAD.hs +++ b/src/ForwardAD.hs @@ -85,6 +85,10 @@ tanScalars (STScal STF64) x = [x] tanScalars (STScal STBool) _ = [] tanScalars STAccum{} _ = error "Accumulators not allowed in input program" +tanEScalars :: SList STy env -> SList Value (TanE env) -> [Double] +tanEScalars SNil SNil = [] +tanEScalars (t `SCons` ts) (Value x `SCons` xs) = tanScalars t x ++ tanEScalars ts xs + unzipDN :: STy t -> Rep (DN t) -> (Rep t, Rep (Tan t)) unzipDN STNil _ = ((), ()) unzipDN (STPair a b) (d1, d2) = -- cgit v1.2.3-70-g09d2