X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FExamples.hs;h=0e805a49d7a33c8128cb53f0f774deb27d24323f;hb=715be016934300f596a11e4fc5b8ca2ec42d6c34;hp=6300ce82460b2dde4e823f05f3400c9004cab09e;hpb=f0f481c02b007a086bd09b05dacb6d603dff6c12;p=spline3.git diff --git a/src/Examples.hs b/src/Examples.hs index 6300ce8..0e805a4 100644 --- a/src/Examples.hs +++ b/src/Examples.hs @@ -33,7 +33,7 @@ n_cube :: Int -> Repa.DIM3 n_cube n = (Repa.Z Repa.:. n Repa.:. n Repa.:. n) trilinear :: Values3D -trilinear = Repa.fromList (n_cube 3) $ +trilinear = Repa.fromListUnboxed (n_cube 3) $ flatten $ transpose_xz trilinear_list @@ -46,7 +46,7 @@ trilinear_zoom_2_list :: [[[Double]]] trilinear_zoom_2_list = [[[1, 3/2, 2, 5/2, 3], [1, 7/4, 5/2, 13/4, 4], [1, 2, 3, 4, 5], [1, 9/4, 7/2, 19/4, 6], [1, 5/2, 4, 11/2, 7]], [[1, 3/2, 2, 5/2, 3], [1, 15/8, 11/4, 29/8, 9/2], [1, 9/4, 7/2, 19/4, 6], [1, 21/8, 17/4, 47/8, 15/2], [1, 3, 5, 7, 9]], [[1, 3/2, 2, 5/2, 3], [1, 2, 3, 4, 5], [1, 5/2, 4, 11/2, 7], [1, 3, 5, 7, 9], [1, 7/2, 6, 17/2, 11]], [[1, 3/2, 2, 5/2, 3], [1, 17/8, 13/4, 35/8, 11/2], [1, 11/4, 9/2, 25/4, 8], [1, 27/8, 23/4, 65/8, 21/2], [1, 4, 7, 10, 13]], [[1, 3/2, 2, 5/2, 3], [1, 9/4, 7/2, 19/4, 6], [1, 3, 5, 7, 9], [1, 15/4, 13/2, 37/4, 12], [1, 9/2, 8, 23/2, 15]]] trilinear_zoom_2 :: Values3D -trilinear_zoom_2 = Repa.fromList (n_cube 6) $ +trilinear_zoom_2 = Repa.fromListUnboxed (n_cube 6) $ flatten $ transpose_xz trilinear_zoom_2_list @@ -60,7 +60,7 @@ trilinear9x9x9_list = [[[1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5], [1, 1.75, 2.5, 3.25 trilinear9x9x9 :: Values3D -trilinear9x9x9 = Repa.fromList (n_cube 9) $ +trilinear9x9x9 = Repa.fromListUnboxed (n_cube 9) $ flatten $ transpose_xz trilinear9x9x9_list @@ -83,7 +83,7 @@ zeros_list = [ [ [ 0, 0, 0 ], -- No need to transpose_xz this one. zeros :: Values3D -zeros = Repa.fromList (n_cube 3) $ flatten zeros_list +zeros = Repa.fromListUnboxed (n_cube 3) $ flatten zeros_list -- | A 3x3x3 array of numbers, starting at (0,0,0) == 0 and counting @@ -102,7 +102,7 @@ naturals_list = [ [ [ 0, 1, 2 ], [ 24, 25, 26 ]]] naturals :: Values3D -naturals = Repa.fromList (n_cube 3) $ +naturals = Repa.fromListUnboxed (n_cube 3) $ flatten $ transpose_xz naturals_list @@ -119,4 +119,4 @@ twenty_vector = (Repa.Z Repa.:. 1 Repa.:. 20 Repa.:. 1) -- | Used in at least one test where we need a 1x20x1 array. naturals_1d :: Values3D -naturals_1d = Repa.fromList twenty_vector (flatten naturals_1d_list) +naturals_1d = Repa.fromListUnboxed twenty_vector (flatten naturals_1d_list)