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

Copyright (c) Conal Elliott 2008 BSD3 conal@conal.net experimental Safe Haskell98

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 #

Minimal complete definition

Associated Types

type Basis v :: * #

Representation of the canonical basis for v

Methods

basisValue :: Basis v -> v #

Interpret basis rep as a vector

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

Extract coordinates

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

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

Instances

 # Associated Typestype Basis Double :: * # Methodsdecompose :: Double -> [(Basis Double, Scalar Double)] # # Associated Typestype Basis Float :: * # Methodsdecompose :: Float -> [(Basis Float, Scalar Float)] # # Associated Typestype Basis CFloat :: * # Methodsdecompose :: CFloat -> [(Basis CFloat, Scalar CFloat)] # # Associated Typestype Basis CDouble :: * # Methods Integral a => HasBasis (Ratio a) # Associated Typestype Basis (Ratio a) :: * # MethodsbasisValue :: Basis (Ratio a) -> Ratio a #decompose :: Ratio a -> [(Basis (Ratio a), Scalar (Ratio a))] #decompose' :: Ratio a -> Basis (Ratio a) -> Scalar (Ratio a) # (HasBasis u, (~) * s (Scalar u), HasBasis v, (~) * s (Scalar v)) => HasBasis (u, v) # Associated Typestype Basis (u, v) :: * # MethodsbasisValue :: Basis (u, v) -> (u, v) #decompose :: (u, v) -> [(Basis (u, v), Scalar (u, v))] #decompose' :: (u, v) -> Basis (u, v) -> Scalar (u, v) # (HasBasis u, (~) * s (Scalar u), HasBasis v, (~) * s (Scalar v), HasBasis w, (~) * s (Scalar w)) => HasBasis (u, v, w) # Associated Typestype Basis (u, v, w) :: * # MethodsbasisValue :: Basis (u, v, w) -> (u, v, w) #decompose :: (u, v, w) -> [(Basis (u, v, w), Scalar (u, v, w))] #decompose' :: (u, v, w) -> Basis (u, v, w) -> Scalar (u, v, w) #

linearCombo :: VectorSpace v => [(v, Scalar v)] -> v #

Linear combination of vectors

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