Copyright | (c) Conal Elliott 2008 |
---|---|

License | BSD3 |

Maintainer | conal@conal.net |

Stability | experimental |

Safe Haskell | Safe |

Language | Haskell98 |

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

- class VectorSpace v => HasBasis v where
- linearCombo :: VectorSpace v => [(v, Scalar v)] -> v
- recompose :: HasBasis v => [(Basis v, Scalar v)] -> v

# Documentation

class VectorSpace v => HasBasis v where #

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.

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 #

Linear combination of vectors