X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FTetrahedron.hs;h=eefbe118274993c166001733e42fc196187d90d7;hb=ecb77f944fcba8c8cfe60ca782bc5d9c8ab68cf9;hp=bcf9a0b599b9fe36098663b71966445ac602bbb6;hpb=cc10c04deda3bdf54867a9052b638f0bc4b09fbe;p=spline3.git diff --git a/src/Tetrahedron.hs b/src/Tetrahedron.hs index bcf9a0b..eefbe11 100644 --- a/src/Tetrahedron.hs +++ b/src/Tetrahedron.hs @@ -3,6 +3,7 @@ where import Numeric.LinearAlgebra hiding (i, scale) import Prelude hiding (LT) +import Test.QuickCheck (Arbitrary(..), Gen) import Cardinal import FunctionValues @@ -18,6 +19,17 @@ data Tetrahedron = Tetrahedron { fv :: FunctionValues, v3 :: Point } deriving (Eq) + +instance Arbitrary Tetrahedron where + arbitrary = do + rnd_v0 <- arbitrary :: Gen Point + rnd_v1 <- arbitrary :: Gen Point + rnd_v2 <- arbitrary :: Gen Point + rnd_v3 <- arbitrary :: Gen Point + rnd_fv <- arbitrary :: Gen FunctionValues + return (Tetrahedron rnd_fv rnd_v0 rnd_v1 rnd_v2 rnd_v3) + + instance Show Tetrahedron where show t = "Tetrahedron:\n" ++ " fv: " ++ (show (fv t)) ++ "\n" ++