Safe Haskell | None |
---|---|
Language | Haskell98 |
- data RW sh = RowWise {
- rowWiseShape :: !sh
- rowWise :: sh -> Array (RW sh) sh
- type DIM1 = RW SH1
- type DIM2 = RW SH2
- type DIM3 = RW SH3
- type DIM4 = RW SH4
- type DIM5 = RW SH5
- ix1 :: Int -> DIM1
- ix2 :: Int -> Int -> DIM2
- ix3 :: Int -> Int -> Int -> DIM3
- ix4 :: Int -> Int -> Int -> Int -> DIM4
- ix5 :: Int -> Int -> Int -> Int -> Int -> DIM5
Documentation
A row-wise layout that maps higher rank indices to linear ones in a row-major order.
Indices are ordered so the inner-most coordinate varies most frequently:
> Prelude.map (fromIndex (RowWise (ish2 2 3))) [0..5] [(Z :. 0) :. 0, (Z :. 0) :. 1, (Z :. 0) :. 2, (Z :. 1) :. 0, (Z :. 1) :. 1, (Z :. 1) :. 2]
- Indexing is not bounds checked. Indexing outside the extent yields the corresponding index.
RowWise | |
|
Eq (Name (RW sh)) => Eq (Name (RW ((:.) sh Int))) Source # | |
Eq (Name (RW Z)) Source # | |
Eq sh => Eq (RW sh) Source # | |
Show (Name (RW sh)) => Show (Name (RW ((:.) sh Int))) Source # | |
Show (Name (RW Z)) Source # | |
Show sh => Show (RW sh) Source # | |
Shape sh => Shape (RW sh) Source # | |
(Layout (RW sh), (~) * (Index (RW sh)) sh) => Layout (RW ((:.) sh Int)) Source # | |
Layout (RW Z) Source # | |
(Layout (RW sh), (~) * (Index (RW sh)) sh) => Bulk (RW sh) sh Source # | Row-wise arrays. |
data Name (RW ((:.) sh Int)) Source # | |
data Name (RW Z) Source # | |
type Index (RW ((:.) sh Int)) Source # | |
type Index (RW Z) Source # | |
data Array (RW sh) sh Source # | |
rowWise :: sh -> Array (RW sh) sh Source #
Construct a rowWise array that produces the corresponding index for every element.
> toList $ rowWise (ish2 3 2) [(Z :. 0) :. 0, (Z :. 0) :. 1, (Z :. 1) :. 0, (Z :. 1) :. 1, (Z :. 2) :. 0, (Z :. 2) :. 1]
Synonyms for common layouts.
Helpers that contrain the coordinates to be Ints
.