module Grid (
cube_at,
grid_tests,
- make_grid,
slow_tests,
zoom
)
arbitrary = do
(Positive h') <- arbitrary :: Gen (Positive Double)
fvs <- arbitrary :: Gen Values3D
- return (make_grid h' fvs)
-
-
--- | The constructor that we want people to use.
--- Ignore non-positive grid sizes for performance.
-make_grid :: Double -> Values3D -> Grid
-make_grid grid_size values =
- Grid grid_size values
+ return $ Grid h' fvs
zoom_result v3d (sfx, sfy, sfz) (R.Z R.:. m R.:. n R.:. o) =
f p
where
- g = make_grid 1 v3d
+ g = Grid 1 v3d
offset = (h g)/2
m' = (fromIntegral m) / (fromIntegral sfx) - offset
n' = (fromIntegral n) / (fromIntegral sfy) - offset
testCase "v3 is correct" test_trilinear_f0_t0_v3]
]
where
- g = make_grid 1 trilinear
+ g = Grid 1 trilinear
cube = cube_at g 1 1 1
t = tetrahedron cube 0
let j' = fromIntegral j,
let k' = fromIntegral k]
where
- g = make_grid 1 trilinear
+ g = Grid 1 trilinear
cs = [ cube_at g ci cj ck | ci <- [0..2], cj <- [0..2], ck <- [0..2] ]
t0 <- tetrahedra c0,
let p = polynomial t0 ]
where
- g = make_grid 1 zeros
+ g = Grid 1 zeros
cs = [ cube_at g ci cj ck | ci <- [0..2], cj <- [0..2], ck <- [0..2] ]
let j' = (fromIntegral j) * 0.5,
let k' = (fromIntegral k) * 0.5]
where
- g = make_grid 1 trilinear
+ g = Grid 1 trilinear
c0 = cube_at g 1 1 1