repa-array-4.0.0.2: Bulk array representations and operators.

Safe HaskellNone
LanguageHaskell98

Data.Repa.Array.Dense

Contents

Synopsis

Documentation

data E r l Source

The Dense layout maps a higher-ranked index space to some underlying linear index space.

For example, we can create a dense 2D row-wise array where the elements are stored in a flat unboxed vector:

> import Data.Repa.Array.Material
> let Just arr  = fromListInto (matrix U 10 10) [1000..1099 :: Float]

> :type arr
arr :: Array (E U (RW DIM2) Float

> arr ! (Z :. 5 :. 4)
> 1054.0

Constructors

Dense r l 

Instances

(Eq (Name r), Eq (Name l)) => Eq (Name (E r l)) 
(Show (Name r), Show (Name l)) => Show (Name (E r l)) 
(Eq r, Eq l) => Eq (E r l) 
(Show r, Show l) => Show (E r l) 
((~) * (Index r) Int, Layout r, Layout l) => Layout (E r l)

Dense arrays.

((~) * (Index r) Int, Layout l, Bulk r a) => Bulk (E r l) a

Dense arrays.

(Layout l, (~) * (Index r) Int, Target r a) => Target (E r l) a

Dense buffers.

Unpack (Buffer s r a) tBuf => Unpack (Buffer s (E r l) a) (l, tBuf) 
data Buffer s (E r l) a = EBuffer !l !(Buffer s r a) 
data Name (E r l) = E (Name r) (Name l) 
type Index (E r l) = Index l 
data Array (E r l) = Array l (Array r a) 

Common layouts

vector :: LayoutI l => Name l -> Int -> E l DIM1 Source

Yield a layout for a dense vector of the given length.

The first argument is the name of the underlying linear layout which stores the elements.

matrix :: LayoutI l => Name l -> Int -> Int -> E l DIM2 Source

Yield a layout for a matrix with the given number of rows and columns.

cube :: LayoutI l => Name l -> Int -> Int -> Int -> E l DIM3 Source

Yield a layout for a cube with the given number of planes, rows, and columns.