From 5c2ac2ca74f2657ff8af381d3bcda72a37b39fb7 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 24 Oct 2011 23:57:22 -0400 Subject: [PATCH] Add bang patterns to the Tetrahedron module (Ben Lippmeier). --- src/Tetrahedron.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Tetrahedron.hs b/src/Tetrahedron.hs index e71151a..670a6e0 100644 --- a/src/Tetrahedron.hs +++ b/src/Tetrahedron.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE BangPatterns #-} module Tetrahedron ( Tetrahedron(..), b0, -- Cube test @@ -33,11 +34,11 @@ import ThreeDimensional (ThreeDimensional(..)) data Tetrahedron = Tetrahedron { function_values :: FunctionValues, - v0 :: Point, - v1 :: Point, - v2 :: Point, - v3 :: Point, - precomputed_volume :: Double + v0 :: !Point, + v1 :: !Point, + v2 :: !Point, + v3 :: !Point, + precomputed_volume :: !Double } deriving (Eq) @@ -142,7 +143,7 @@ beta t i j k l -- Zeilfelder, pp. 84-86. If incorrect indices are supplied, the -- function will simply error. c :: Tetrahedron -> Int -> Int -> Int -> Int -> Double -c t i j k l = +c !t !i !j !k !l = coefficient i j k l where fvs = function_values t -- 2.43.2