Remove some unused functions.
import Control.Monad (liftM, liftM2)
import Prelude hiding (LT)
-import Test.HUnit
+import Test.HUnit (Assertion, assertEqual)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.Framework.Providers.QuickCheck2 (testProperty)
-- | Functions for comparing 'Double' values.
-module Comparisons
+module Comparisons (
+ (~=),
+ (~~=),
+ almost_equals,
+ kinda_equals,
+ nearly_equals,
+ nearly_ge,
+ non_very_positive_entries,
+ very_positive,
+ )
where
-- | epsilon is the value that will be used in all tests that require
import qualified Data.Array.Repa as Repa
-import Misc
-import Values
+import Misc (flatten, transpose_xz)
+import Values (Values3D)
-- | Values of the function f(x,y,z) = 1 + x + xy + xyz taken at nine
-- | The Face module just contains the definition of the 'Face' data
-- type and its two typeclass instances.
module Face
+ ( Face(..) )
where
import Point
where
import Prelude hiding (LT)
-import Test.HUnit
+import Test.HUnit (Assertion)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.Framework.Providers.QuickCheck2 (testProperty)
where
import qualified Data.Array.Repa as R
-import Test.HUnit
+import Test.HUnit (Assertion, assertEqual)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.Framework.Providers.QuickCheck2 (testProperty)
Positive(..),
Property,
choose)
-import Assertions
-import Comparisons
+import Assertions (assertAlmostEqual, assertClose, assertTrue)
+import Comparisons ((~=))
import Cube (Cube(Cube),
find_containing_tetrahedron,
tetrahedra,
tetrahedron)
-import Examples
-import FunctionValues
+import Examples (trilinear, trilinear9x9x9, zeros, naturals_1d)
+import FunctionValues (make_values, value_at)
import Point (Point)
-import ScaleFactor
+import ScaleFactor (ScaleFactor)
import Tetrahedron (Tetrahedron, c, polynomial, v0, v1, v2, v3)
-import ThreeDimensional
+import ThreeDimensional (ThreeDimensional(..))
import Values (Values3D, dims, empty3d, zoom_shape)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.Framework.Providers.QuickCheck2 (testProperty)
-import Test.HUnit
+import Test.HUnit (Assertion, assertEqual)
import Test.QuickCheck
{-# LANGUAGE FlexibleInstances #-}
-module Point
+module Point (
+ Point,
+ distance,
+ dot,
+ is_close,
+ scale
+ )
where
-import Comparisons
+import Comparisons ((~=))
type Point = (Double, Double, Double)
{-# LANGUAGE FlexibleInstances #-}
-module RealFunction
+module RealFunction (
+ RealFunction,
+ cmult,
+ fexp
+ )
where
module ScaleFactor
+ (ScaleFactor)
where
type ScaleFactor = (Int, Int, Int)
-
---instance Integral ScaleFactor where
sum
)
-import Prelude hiding (LT)
import Test.Framework (Test, testGroup)
import Test.Framework.Providers.HUnit (testCase)
import Test.Framework.Providers.QuickCheck2 (testProperty)
-import Test.HUnit
+import Test.HUnit (Assertion, assertEqual)
import Test.QuickCheck (Arbitrary(..), Gen, Property, (==>))
import Comparisons ((~=), nearly_ge)
import FunctionValues (FunctionValues(..), empty_values)
import Misc (factorial)
-import Point
-import RealFunction
-import ThreeDimensional
+import Point (Point, scale)
+import RealFunction (RealFunction, cmult, fexp)
+import ThreeDimensional (ThreeDimensional(..))
data Tetrahedron =
Tetrahedron { function_values :: FunctionValues,
module ThreeDimensional
+ ( ThreeDimensional(..) )
where
import Point(Point)
{-# LANGUAGE FlexibleInstances #-}
-module Values
+module Values (
+ Values,
+ Values2D,
+ Values3D,
+ dims,
+ empty3d,
+ idx,
+ read_values_3d,
+ zoom_shape
+ )
where
import Data.Array.Repa (
extent,
fromList,
unsafeIndex,
- reshape,
- size
+ reshape
)
-import Data.Array.Repa.IO.Vector (readVectorFromTextFile,
- writeVectorToTextFile)
+import Data.Array.Repa.IO.Vector (readVectorFromTextFile)
import System.FilePath ()
import Test.QuickCheck (Arbitrary(..), Gen, choose, vectorOf)
-import ScaleFactor
+import ScaleFactor (ScaleFactor)
type Values sh = Array sh Double
one_d <- read_values_1d path
return $ reshape sh one_d
-write_values_1d :: Values3D -> FilePath -> IO ()
-write_values_1d v3d path = do
- let size3d = size $ extent v3d
- let shape1d = (Z :. size3d)
- let v1d = reshape shape1d v3d
- writeVectorToTextFile v1d path
-
empty3d :: Values3D
empty3d = Data.Array.Repa.fromList (Z :. 0 :. 0 :. 0) []
z' = z * sfz
in
(Z :. x' :. y' :. z')
-
-
-drop_z :: DIM3 -> DIM2
-drop_z (Z :. 1 :. y :. x) = (Z :. y :. x)
-drop_z _ = error "can't drop the z-dimension unless its size is 1"