]> gitweb.michael.orlitzky.com - spline3.git/blob - PolynomialArray.hs
2cf96dde6235347e0b2ec7d81e0b7e9a57bd3001
[spline3.git] / PolynomialArray.hs
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
7 -- as the keys.
8 module PolynomialArray (
9 PolynomialArray,
10 make_polynomial_array
11 )
12 where
13
14 import RealFunction(RealFunction)
15 import Point (Point)
16
17 import Data.Array (Array, array)
18
19 type PolynomialArray =
20 Array (Int,Int,Int,Int) (RealFunction Point)
21
22 make_polynomial_array :: (Int, Int, Int, Int) ->
23 [( (Int,Int,Int,Int), (RealFunction Point) )] ->
24 PolynomialArray
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) )