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

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 #

Minimal complete definition

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

 Source # Associated Typestype Basis Double :: * Source # Methods Source # Associated Typestype Basis Float :: * Source # Methods Source # Associated Typestype Basis CFloat :: * Source # Methods Source # Associated Typestype Basis CDouble :: * Source # Methods Integral a => HasBasis (Ratio a) Source # Associated Typestype Basis (Ratio a) :: * Source # MethodsbasisValue :: 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 u, (~) * s (Scalar u), HasBasis v, (~) * s (Scalar v)) => HasBasis (u, v) Source # Associated Typestype Basis (u, v) :: * Source # MethodsbasisValue :: 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 u, (~) * s (Scalar u), HasBasis v, (~) * s (Scalar v), HasBasis w, (~) * s (Scalar w)) => HasBasis (u, v, w) Source # Associated Typestype Basis (u, v, w) :: * Source # MethodsbasisValue :: 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 #

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

Linear combination of vectors

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