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

Safe HaskellNone
LanguageHaskell2010

Numeric.LinearAlgebra.Repa.Conversion

Contents

Synopsis

Documentation

class (Complexable c, Fractional e, Element e) => Container c e

Basic element-by-element functions for numeric containers

Minimal complete definition

size', scalar', conj', scale', scaleRecip, addConstant, add, sub, mul, divide, equal, arctan2', cmap', konst', build', atIndex', minIndex', maxIndex', minElement', maxElement', sumElements', prodElements', step', cond', find', assoc', accum'

class Storable a => Element a

Supported matrix elements.

This class provides optimized internal operations for selected element types. It provides unoptimised defaults for any Storable type, so you can create instances simply as:

instance Element Foo

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) => 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.