vector-space-0.7.6: Vector & affine spaces, linear maps, and derivatives (requires ghc 6.9 or better)Source codeContentsIndex
Data.Basis
Stabilityexperimental
Maintainerconal@conal.net
Description
Basis of a vector space, as an associated type This module requires ghc-6.10 or later
Synopsis
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
Associated Types
type Basis v :: *Source
Representation of the canonical basis for v
Methods
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.
show/hide Instances
HasBasis Double
HasBasis Float
(s ~ Scalar u, s ~ Scalar v, HasBasis u, HasBasis v) => HasBasis (u, v)
(s ~ Scalar u, s ~ Scalar v, s ~ Scalar w, HasBasis u, HasBasis v, HasBasis w) => HasBasis (u, v, w)
linearCombo :: VectorSpace v => [(v, Scalar v)] -> vSource
Linear combination
recompose :: HasBasis v => [(Basis v, Scalar v)] -> vSource
Produced by Haddock version 2.6.1