-- | The PolynomialArray module contains one type, 'PolynomialArray', -- and a smart constructor for it. The array is essentially a hash; -- the unique keys can be thought of as a cube/tetrahedron pair, and -- the associated value is the polynomial function over that -- tetrahedron. Rather than define 'Ord' instances and a proper map, -- we just use the indices i,j,k along with the tetrahedron number -- as the keys. module PolynomialArray ( PolynomialArray, make_polynomial_array ) where import RealFunction(RealFunction) import Point (Point) import Data.Array (Array, array) type PolynomialArray = Array (Int,Int,Int,Int) (RealFunction Point) make_polynomial_array :: (Int, Int, Int, Int) -> [( (Int,Int,Int,Int), (RealFunction Point) )] -> PolynomialArray make_polynomial_array (max_i, max_j, max_k, max_tetrahedron_number) = array ( (0,0,0,0), (max_i,max_j,max_k, max_tetrahedron_number) )