Copyright | (c) Justus Sagemüller 2016 |
---|---|
License | GPL v3 |
Maintainer | (@) sagemueller $ geo.uni-koeln.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
- newtype FinSuppSeq n = FinSuppSeq {
- getFiniteSeq :: Vector n
Documentation
newtype FinSuppSeq n Source
The space of finitely-supported sequences is an infinite-dimensional space. An vector of length l is here understood as an infinite sequence that begins with l nonzero values, and continues with infinite zeroes.
You may also consider this as the type that languages like Octave/Matlab (as well as Haskell's hmatrix library) approximate with their “vectors”, with one important difference: there is no such thing as a dimensional-mismatch error, since we consider all these vectors as elements of the same infinite-dimensional space. Adding two different-size vectors will simply zero-pad the shorter, and unlike in Matlab this behaviour extends consequently to matrix multiplication etc. (defined in linearmap-category)
Of course it can make sense to constrain the dimension, but for this the type system should be used, not runtime checks.
(This is the same behaviour that the linear library gives to the standard list and vector types, but the problem there is that it can't use unboxed arrays as these are not functors, but unboxing is crucial for performance.)
FinSuppSeq | |
|
Unbox n => IsList (FinSuppSeq n) Source | |
(Unbox n, Show n) => Show (FinSuppSeq n) Source | |
(Num n, Unbox n) => AffineSpace (FinSuppSeq n) Source | |
(Num n, Unbox n) => HasBasis (FinSuppSeq n) Source | |
(Num n, Unbox n) => VectorSpace (FinSuppSeq n) Source | |
(Num n, AdditiveGroup n, Unbox n) => InnerSpace (FinSuppSeq n) Source | |
(Num n, Unbox n) => AdditiveGroup (FinSuppSeq n) Source | |
type Item (FinSuppSeq n) = n Source | |
type Diff (FinSuppSeq n) = FinSuppSeq n Source | |
type Basis (FinSuppSeq n) = Int Source | |
type Scalar (FinSuppSeq n) = n Source |