Stability | experimental |
---|---|
Maintainer | conal@conal.net |
Basis of a vector space, as an associated type.
This version works with Data.VectorSpace
, thus avoiding a bug in
ghc-6.9..
- class VectorSpace v s => HasBasis v s where
- type Basis v :: *
- basisValue :: Basis v -> v
- decompose :: v -> [(Basis v, s)]
- decompose' :: v -> Basis v -> s
- linearCombo :: VectorSpace v s => [(v, s)] -> v
- recompose :: HasBasis v s => [(Basis v, s)] -> v
Documentation
class VectorSpace v s => HasBasis v s whereSource
basisValue :: Basis v -> vSource
Interpret basis rep as a vector
decompose :: v -> [(Basis v, s)]Source
Extract coordinates
decompose' :: v -> Basis v -> sSource
Experimental version. More elegant definitions, and friendly to infinite-dimensional vector spaces.
linearCombo :: VectorSpace v s => [(v, s)] -> vSource
Linear combination