dph-examples: some doc cleanups
[packages/dph.git] / dph-examples / examples / spectral / Rotation / Solver.hs
1
2 -- | Wrappers for the various solvers.
3 module Solver
4 ( Solver
5 , solvers)
6 where
7 import qualified Vector as SV
8 import qualified Vectorised as SPA
9
10 import qualified Data.Vector as V
11 import qualified Data.Vector.Unboxed as VU
12
13 import qualified Data.Array.Parallel as P
14 import qualified Data.Array.Parallel.PArray as P
15
16 type Solver = Int -> Double -> VU.Vector (Double,Double)
17
18 solvers :: [(String, Solver)]
19 solvers
20 = [ ("vectorised", solver_spa)
21 , ("vector", SV.solveV)
22 ]
23
24 -- | Nested Data Parallelism + Barnes-Hut algorithm.
25 solver_spa :: Solver
26 solver_spa depth time
27 = let
28 pts' = SPA.solvePA depth time
29 in VU.fromList $ P.toList pts'
30