vector-space-0.9: Vector & affine spaces, linear maps, and derivatives

Copyright(c) Conal Elliott 2008
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Data.Basis

Description

Basis of a vector space, as an associated type This module requires ghc-6.10 or later

Synopsis

Documentation

class VectorSpace v => HasBasis v where Source

Associated Types

type Basis v :: * Source

Representation of the canonical basis for v

Methods

basisValue :: Basis v -> v Source

Interpret basis rep as a vector

decompose :: v -> [(Basis v, Scalar v)] Source

Extract coordinates

decompose' :: v -> Basis v -> Scalar v Source

Experimental version. More elegant definitions, and friendly to infinite-dimensional vector spaces.

Instances

HasBasis Double 
HasBasis Float 
HasBasis CFloat 
HasBasis CDouble 
Integral a => HasBasis (Ratio a) 
(HasBasis u, (~) * s (Scalar u), HasBasis v, (~) * s (Scalar v)) => HasBasis (u, v) 
(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)] -> v Source

Linear combination of vectors

recompose :: HasBasis v => [(Basis v, Scalar v)] -> v Source