dph-examples: pluecker. add matrix/vector mult for rotation
[packages/dph.git] / dph-examples / examples / spectral / Pluecker / Solver.hs
1 module Solver
2 (Solver,solvers)
3 where
4
5 import Common
6 import qualified Vector as SV
7 import qualified Vectorised as SPA
8 import qualified Data.Vector as V
9 import qualified Data.Vector.Unboxed as VU
10 import qualified Data.Array.Parallel as P
11 import qualified Data.Array.Parallel.PArray as P
12
13
14 type Solver = VU.Vector Vec3 -> VU.Vector (Int,Int,Int) -> VU.Vector Vec3 -> Double -> VU.Vector (Vec3, Double)
15
16 solvers :: [(String,Solver)]
17 solvers =
18 [("vectorised", solverPA)
19 ,("vector", SV.solveV)]
20
21 solverPA verts tris rays time
22 = let fv a = P.fromVector (VU.convert a)
23 in VU.convert (P.toVector (SPA.solvePA (fv verts) (fv tris) (fv rays) time))