Copyright | (c) Artur M. Brodzki 2018 |
---|---|
License | BSD3 |
Maintainer | artur@brodzki.org |
Stability | experimental |
Portability | Windows/POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Generic tensor index which may be finitely- or infinitely-dimensional.
Synopsis
- class Index i where
- indexName :: i -> String
- isCovariant :: i -> Bool
- isContravariant :: i -> Bool
- isIndifferent :: i -> Bool
- equivI :: i -> i -> Bool
- (!=!) :: i -> i -> Bool
- toTIndex :: i -> TIndex
- data TIndex
- = Covariant {
- indexSize :: Maybe Int
- tIndexName :: String
- | Contravariant {
- indexSize :: Maybe Int
- tIndexName :: String
- | Indifferent {
- indexSize :: Maybe Int
- tIndexName :: String
- = Covariant {
Documentation
Tensor index class which may be lower (covariant), upper (contravariant) or indifferent.
indexName :: i -> String Source #
Index name
isCovariant :: i -> Bool Source #
Returns True if index is lower (covariant), False otherwise.
isContravariant :: i -> Bool Source #
Returns True if index is upper (contravariant), False otherwise.
isIndifferent :: i -> Bool Source #
Returns True if index if indifferent, False otherwise.
equivI :: i -> i -> Bool Source #
Returns True if two indices are equivalent, thus differs only by name, but share same size and type.
(!=!) :: i -> i -> Bool infixl 2 Source #
Infix equivalent for equiv
. Has low priority equal to 2.
toTIndex :: i -> TIndex Source #
Convert to generic index type
Instances
Index TIndex Source # | Finite index is a Multilinear.Index instance |
Defined in Multilinear.Index | |
Index Index Source # | Finite index is a Multilinear.Index instance |
Defined in Multilinear.Index.Finite | |
Index Index Source # | Infinite index is a Multilinear.Index instance |
Defined in Multilinear.Index.Infinite |
Generic index type finitely- or infinitely-dimensional
Covariant | |
| |
Contravariant | |
| |
Indifferent | |
|