Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] web/email now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as Haskell by joaopizani ( 14 years ago )
{-# LANGUAGE PArr, ParallelListComp #-}

module DPHVecMul (dotp,
      dotp_pure) where


import qualified Prelude
import Data.Array.Parallel.Prelude
import Data.Array.Parallel.Prelude.Double


dotp_pure :: [:Double:] -> [:Double:] -> Double
dotp_pure xs ys = sumP [: x * y | x <- xs | y <- ys :]


dotp :: PArray Double -> PArray Double -> Double
{-# NOINLINE dotp #-}
dotp v w = dotp_pure (fromPArrayP v) (fromPArrayP w)

 

Revise this Paste

Your Name: Code Language: