Safe Haskell | None |
---|---|
Language | Haskell98 |
Documentation
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
Dense r l |
(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 r a) tBuf => Unpack (Buffer (E r l) a) (l, tBuf) | |
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) | |
data Buffer (E r l) = EBuffer !l !(Buffer 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.