12.07.2015 Views

Algorithmes de la morphologie mathématique pour - Pastel - HAL

Algorithmes de la morphologie mathématique pour - Pastel - HAL

Algorithmes de la morphologie mathématique pour - Pastel - HAL

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Jaromír BRAMBORtestSIMD :: PVec I α → (α → α → Bool) → PVec I α → PVec I BooltestSIMD pv 1 cnd pv 2 = listArray (bounds $ pv 1 ) (map2 cnd (elems$pv 1 ) (elems$pv 2 ) )La fonction <strong>de</strong> dép<strong>la</strong>cement conditionnel cndmoveSIMD va utiliser un masque msk <strong>pour</strong> constituer unvecteur paqueté à partir <strong>de</strong> <strong>de</strong>ux vecteurs paquetés d’entrée pv 1 et pv 2 . Selon les valeurs du masque Trueou False, les éléments du pv 1 ou pv 2 , respectivement, sont copiés dans le vecteur résultant.cndmoveSIMD :: PVec I Bool → PVec I α → PVec I α → PVec I αcndmoveSIMD msk pv 1 pv 2 = listArray (bounds $ pv 1 ) (map2 ( λ msk x y → if msk then x else y)(elems$pv 1 )(elems$pv 2 ))Fonction mapping travail<strong>la</strong>nt avec plusieurs valeurs d’entréeLa fonction map2 effectue le mapping d’une fonction prenant <strong>de</strong>ux arguments. Son fonctionnementest i<strong>de</strong>ntique à celui <strong>de</strong> <strong>la</strong> fonction zipWith du Haskell :map2 = zipWith203

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!