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