Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Eq sh => Shape sh where
- data Z = Z
- data tail :. head = !tail :. !head
- type DIM0 = Z
- type DIM1 = DIM0 :. Int
- type DIM2 = DIM1 :. Int
- type DIM3 = DIM2 :. Int
- type DIM4 = DIM3 :. Int
- type DIM5 = DIM4 :. Int
- type DIM6 = DIM5 :. Int
- type DIM7 = DIM6 :. Int
- type DIM8 = DIM7 :. Int
- type DIM9 = DIM8 :. Int
- 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
- ix6 :: Int -> Int -> Int -> Int -> Int -> Int -> DIM6
- ix7 :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> DIM7
- ix8 :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> DIM8
- ix9 :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> DIM9
Documentation
class Eq sh => Shape sh where Source #
Class of types that can be used as array shapes and indices.
shapeRank :: sh -> Int Source #
Gets the number of dimensions in a shape.
shapeLength :: sh -> Int Source #
Gets the total number of elements in an array of this shape.
Gives the first index of an array.
shapeSucc :: sh -> sh -> sh Source #
Gives the successor of an index, given the shape of the array.
toLinearIndex :: sh -> sh -> Int Source #
Convert an index into its equivalent flat, linear, row-major version.
fromLinearIndex :: sh -> Int -> sh Source #
Inverse of toLinearIndex
.
shapeList :: sh -> [sh] Source #
Return the ascending list of indexes for the given shape.
inShape :: sh -> sh -> Bool Source #
Check whether an index is within a given shape.
An index of dimension zero.
data tail :. head infixl 3 Source #
Our index type, used for both shapes and indices.
!tail :. !head infixl 3 |
(Unbox t, Unbox h) => Vector Vector ((:.) t h) Source # | |
(Unbox t, Unbox h) => MVector MVector ((:.) t h) Source # | |
(Eq head, Eq tail) => Eq ((:.) tail head) Source # | |
(Ord head, Ord tail) => Ord ((:.) tail head) Source # | |
(Read head, Read tail) => Read ((:.) tail head) Source # | |
(Show head, Show tail) => Show ((:.) tail head) Source # | |
Storable sh => Storable ((:.) sh Int) Source # | |
(Unbox t, Unbox h) => Unbox ((:.) t h) Source # | |
Shape sh => Shape ((:.) sh Int) Source # | |
HistogramShape sh => HistogramShape ((:.) sh Int) Source # | |
data MVector s ((:.) t h) Source # | |
data Vector ((:.) t h) Source # | |
Common dimensions.
Helpers
Helper for index construction.
Use this instead of explicit constructors like (Z :. (x :: Int))
The this is sometimes needed to ensure that x
is constrained to
be in Int
.