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

Copyright(c) Conal Elliott 2008
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Safe HaskellSafe
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

basisValue :: (Generic v, HasBasis (VRep v), Basis (VRep v) ~ Basis v) => Basis v -> v Source #

Interpret basis rep as a vector

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

Extract coordinates

decompose :: (Generic v, HasBasis (VRep v), Scalar (VRep v) ~ Scalar v, Basis (VRep v) ~ Basis v) => 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.

decompose' :: (Generic v, HasBasis (VRep v), Scalar (VRep v) ~ Scalar v, Basis (VRep v) ~ Basis v) => v -> Basis v -> Scalar v Source #

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

Instances

HasBasis Double Source # 
HasBasis Float Source # 
HasBasis CFloat Source # 
HasBasis CDouble Source # 
Integral a => HasBasis (Ratio a) Source # 

Associated Types

type Basis (Ratio a) :: * Source #

Methods

basisValue :: Basis (Ratio a) -> Ratio a Source #

decompose :: Ratio a -> [(Basis (Ratio a), Scalar (Ratio a))] Source #

decompose' :: Ratio a -> Basis (Ratio a) -> Scalar (Ratio a) Source #

HasBasis a => HasBasis (Rec0 a s) Source # 

Associated Types

type Basis (Rec0 a s) :: * Source #

Methods

basisValue :: Basis (Rec0 a s) -> Rec0 a s Source #

decompose :: Rec0 a s -> [(Basis (Rec0 a s), Scalar (Rec0 a s))] Source #

decompose' :: Rec0 a s -> Basis (Rec0 a s) -> Scalar (Rec0 a s) Source #

(HasBasis u, (~) * s (Scalar u), HasBasis v, (~) * s (Scalar v)) => HasBasis (u, v) Source # 

Associated Types

type Basis (u, v) :: * Source #

Methods

basisValue :: Basis (u, v) -> (u, v) Source #

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

decompose' :: (u, v) -> Basis (u, v) -> Scalar (u, v) Source #

(HasBasis (f p), HasBasis (g p), (~) * (Scalar (f p)) (Scalar (g p))) => HasBasis ((:*:) f g p) Source # 

Associated Types

type Basis ((:*:) f g p) :: * Source #

Methods

basisValue :: Basis ((f :*: g) p) -> (f :*: g) p Source #

decompose :: (f :*: g) p -> [(Basis ((f :*: g) p), Scalar ((f :*: g) p))] Source #

decompose' :: (f :*: g) p -> Basis ((f :*: g) p) -> Scalar ((f :*: g) p) Source #

(HasBasis u, (~) * s (Scalar u), HasBasis v, (~) * s (Scalar v), HasBasis w, (~) * s (Scalar w)) => HasBasis (u, v, w) Source # 

Associated Types

type Basis (u, v, w) :: * Source #

Methods

basisValue :: Basis (u, v, w) -> (u, v, w) Source #

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

decompose' :: (u, v, w) -> Basis (u, v, w) -> Scalar (u, v, w) Source #

HasBasis (f p) => HasBasis (M1 i c f p) Source # 

Associated Types

type Basis (M1 i c f p) :: * Source #

Methods

basisValue :: Basis (M1 i c f p) -> M1 i c f p Source #

decompose :: M1 i c f p -> [(Basis (M1 i c f p), Scalar (M1 i c f p))] Source #

decompose' :: M1 i c f p -> Basis (M1 i c f p) -> Scalar (M1 i c f p) Source #

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

Linear combination of vectors

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