Copyright | (c) Andrey Mulik 2020 |
---|---|
License | BSD-style |
Maintainer | work.a.mulik@gmail.com |
Portability | non-portable (GHC extensions) |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Synopsis
- module SDP.Finite
- module SDP.Tuple
- module Data.Word
- module Data.Int
- class Shape i where
- type family GIndex i where ...
- toGBounds :: Shape i => (i, i) -> (GIndex i, GIndex i)
- fromGBounds :: Shape i => (GIndex i, GIndex i) -> (i, i)
- type RANK0 i = i ~~ E
- type RANK1 i = GIndex i ~~ (E :& i)
- type RANK2 i = GIndex i ~~ I2 i
- type RANK3 i = GIndex i ~~ I3 i
- type RANK4 i = GIndex i ~~ I4 i
- type RANK5 i = GIndex i ~~ I5 i
- type RANK6 i = GIndex i ~~ I6 i
- type RANK7 i = GIndex i ~~ I7 i
- type RANK8 i = GIndex i ~~ I8 i
- type RANK9 i = GIndex i ~~ I9 i
- type RANK10 i = GIndex i ~~ I10 i
- type RANK11 i = GIndex i ~~ I11 i
- type RANK12 i = GIndex i ~~ I12 i
- type RANK13 i = GIndex i ~~ I13 i
- type RANK14 i = GIndex i ~~ I14 i
- type RANK15 i = GIndex i ~~ I15 i
Exports
module SDP.Finite
module SDP.Tuple
module Data.Word
module Data.Int
Shapes
Shape
is service class that constraints Index
.
Rules:
rank i == rank (j `asTypeOf` i) rank i == length (sizes (i, i))
rank (lastDim E) = 0 rank (lastDim i) = 1 rank (initDim E) = 0 rank (lastDim i) = rank i - 1
fromGIndex . toGIndex = id toGIndex . fromGIndex = id
Nothing
fromGIndex :: GIndex i -> i Source #
Create index from generalized index.
default fromGIndex :: RANK1 i => GIndex i -> i Source #
toGIndex :: i -> GIndex i Source #
Create generalized index from index.
Count of dimensions in represented space (must be finite and constant).
consDim :: DimInit i -> DimLast i -> i Source #
Add new dimension.
initDim :: i -> DimInit i Source #
Instances
type family GIndex i where ... Source #
Type operator GIndex
returns generalized equivalent of index.
toGBounds :: Shape i => (i, i) -> (GIndex i, GIndex i) Source #
Convert any index type bounds to generalized index bounds.
fromGBounds :: Shape i => (GIndex i, GIndex i) -> (i, i) Source #
Convert generalized index bounds to any index type bounds.
Rank constraints
type RANK1 i = GIndex i ~~ (E :& i) Source #
The restriction corresponding to rank indices 1 (сhecks GIndex
).
type RANK2 i = GIndex i ~~ I2 i Source #
The restriction corresponding to rank indices 2 (сhecks GIndex
).
type RANK3 i = GIndex i ~~ I3 i Source #
The restriction corresponding to rank indices 3 (сhecks GIndex
).
type RANK4 i = GIndex i ~~ I4 i Source #
The restriction corresponding to rank indices 4 (сhecks GIndex
).
type RANK5 i = GIndex i ~~ I5 i Source #
The restriction corresponding to rank indices 5 (сhecks GIndex
).
type RANK6 i = GIndex i ~~ I6 i Source #
The restriction corresponding to rank indices 6 (сhecks GIndex
).
type RANK7 i = GIndex i ~~ I7 i Source #
The restriction corresponding to rank indices 7 (сhecks GIndex
).
type RANK8 i = GIndex i ~~ I8 i Source #
The restriction corresponding to rank indices 8 (сhecks GIndex
).
type RANK9 i = GIndex i ~~ I9 i Source #
The restriction corresponding to rank indices 9 (сhecks GIndex
).
type RANK10 i = GIndex i ~~ I10 i Source #
The restriction corresponding to rank indices 10 (сhecks GIndex
).
type RANK11 i = GIndex i ~~ I11 i Source #
The restriction corresponding to rank indices 11 (сhecks GIndex
).
type RANK12 i = GIndex i ~~ I12 i Source #
The restriction corresponding to rank indices 12 (сhecks GIndex
).
type RANK13 i = GIndex i ~~ I13 i Source #
The restriction corresponding to rank indices 13 (сhecks GIndex
).