repa-linear-algebra-0.3.0.0: HMatrix operations for Repa.

LicenseBSD3
Maintainermarcin.jan.mrotek@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Numeric.LinearAlgebra.Repa.Conversion

Contents

Description

Repa - HMatrix conversion functions.

  • Unqualified functions use raw F arrays.
  • "-S" functions precompute D arrays sequentially.
  • "-SIO" functions precompute D arrays sequentially in the IO monad.
  • "-P" functions precompute D arrays in parralel in any monad.
  • "-PIO" functions precompute D arrays in parralel in the IO monad.

Synopsis

Documentation

class Element e => Container c e

Basic element-by-element functions for numeric containers

Minimal complete definition

conj', size', scalar', scale', addConstant, add', sub, mul, equal, cmap', konst', build', atIndex', minIndex', maxIndex', minElement', maxElement', sumElements', prodElements', step', ccompare', cselect', find', assoc', accum', scaleRecip, divide, arctan2', cmod', fromInt', toInt', fromZ', toZ'

class Storable a => Element a

Supported matrix elements.

Minimal complete definition

constantD, extractR, setRect, sortI, sortV, compareV, selectV, remapM, rowOp, gemm

class HShape sh where Source

Shape-polymorphic conversion.

Associated Types

type HType sh :: * -> * Source

Methods

toRepa :: Numeric t => HType sh t -> Array F sh t Source

fromRepa :: Numeric t => Array F sh t -> HType sh t Source

fromRepaS :: Numeric t => Array D sh t -> HType sh t Source

fromRepaSIO :: Numeric t => Array D sh t -> IO (HType sh t) Source

fromRepaP :: (Numeric t, Monad m) => Array D sh t -> m (HType sh t) Source

fromRepaPIO :: Numeric t => Array D sh t -> IO (HType sh t) Source

Vector conversion utilities

hv2repa :: Storable t => Vector t -> Array F DIM1 t Source

O(1). Convert a HMatrix Vector to a Repa Array.

repa2hv :: Storable t => Array F DIM1 t -> Vector t Source

O(1). Convert a Repa Array to a HMatrix Vector.

repa2hvS :: Storable t => Array D DIM1 t -> Vector t Source

Convert a delayed Repa Array to a HMatrix Vector, evaluating it sequentially.

repa2hvSIO :: Storable t => Array D DIM1 t -> IO (Vector t) Source

O(1). Convert a Repa Array to a HMatrix Vector sequentially inside the IO monad.

repa2hvP :: (Storable t, Monad m) => Array D DIM1 t -> m (Vector t) Source

Convert a delayed Repa Array to a HMatrix Vector, evaluating it in parallel.

repa2hvPIO :: Storable t => Array D DIM1 t -> IO (Vector t) Source

O(1). Convert a Repa Array to a HMatrix Vector in parallel inside the IO monad.

Matrix conversion utilities

hm2repa :: (Storable t, Container Vector t, Element t, Num t) => Matrix t -> Array F DIM2 t Source

O(1). Convert a HMatrix Matrix to a Repa Array.

repa2hm :: Storable t => Array F DIM2 t -> Matrix t Source

O(1). Convert a Repa Array to a HMatrix Matrix.

repa2hmS :: Storable t => Array D DIM2 t -> Matrix t Source

Convert a delayed Repa Array to a HMatrix Matrix, evaluating it sequentially.

repa2hmSIO :: Storable t => Array D DIM2 t -> IO (Matrix t) Source

O(1). Convert a Repa Array to a HMatrix Matrix sequentially inside the IO monad.

repa2hmP :: (Storable t, Monad m) => Array D DIM2 t -> m (Matrix t) Source

Convert a delayed Repa Array to a HMatrix Matrix, evaluating it in parallel.

repa2hmPIO :: Storable t => Array D DIM2 t -> IO (Matrix t) Source

O(1). Convert a Repa Array to a HMatrix Matrix in parallel inside the IO monad.