Stability | experimental |
---|---|
Maintainer | conal@conal.net |
Safe Haskell | None |
Basis of a vector space, as an associated type This module requires ghc-6.10 or later
- class VectorSpace v => HasBasis v where
- type Basis v :: *
- basisValue :: Basis v -> v
- decompose :: v -> [(Basis v, Scalar v)]
- decompose' :: v -> Basis v -> Scalar v
- linearCombo :: VectorSpace v => [(v, Scalar v)] -> v
- recompose :: HasBasis v => [(Basis v, Scalar v)] -> v
Documentation
class VectorSpace v => HasBasis v whereSource
basisValue :: Basis v -> vSource
Interpret basis rep as a vector
decompose :: v -> [(Basis v, Scalar v)]Source
Extract coordinates
decompose' :: v -> Basis v -> Scalar vSource
Experimental version. More elegant definitions, and friendly to infinite-dimensional vector spaces.
HasBasis Double | |
HasBasis Float | |
HasBasis CFloat | |
HasBasis CDouble | |
(VectorSpace (Ratio a), Integral a) => HasBasis (Ratio a) | |
(VectorSpace (u, v), HasBasis u, ~ * s (Scalar u), HasBasis v, ~ * s (Scalar v)) => HasBasis (u, v) | |
(VectorSpace (u, v, w), HasBasis u, ~ * s (Scalar u), HasBasis v, ~ * s (Scalar v), HasBasis w, ~ * s (Scalar w)) => HasBasis (u, v, w) |
linearCombo :: VectorSpace v => [(v, Scalar v)] -> vSource
Linear combination