]> gitweb.michael.orlitzky.com - spline3.git/blob - src/Values.hs
Add the Values module, wrapping the Repa stuff.
[spline3.git] / src / Values.hs
1 module Values
2 where
3
4 import Data.Array.Repa (
5 Array,
6 DIM1,
7 DIM3,
8 reshape,
9 )
10
11 import Data.Array.Repa.IO.Vector (readVectorFromTextFile)
12 import System.FilePath ()
13
14
15 type Values1D = Array DIM1 Double
16 type Values3D = Array DIM3 Double
17
18 read_values_1d :: FilePath -> IO Values1D
19 read_values_1d path = readVectorFromTextFile path
20
21 read_values_3d :: DIM3 -> FilePath -> IO Values3D
22 read_values_3d sh path = do
23 one_d <- read_values_1d path
24 return $ reshape sh one_d