Copyright | (c) Henning Thielemann 2004-2005 |
---|---|
Maintainer | numericprelude@henning-thielemann.de |
Stability | provisional |
Portability | portable |
Safe Haskell | None |
Language | Haskell98 |
Abstraction of vectors
Synopsis
- class C v where
- class Eq v where
- functorScale :: (Functor v, C a) => a -> v a -> v a
- linearComb :: (C a, C v) => [a] -> [v a] -> v a
- propCascade :: (C v, Eq v, C a, Eq a) => a -> a -> v a -> Bool
- propRightDistributive :: (C v, Eq v, C a, Eq a) => a -> v a -> v a -> Bool
- propLeftDistributive :: (C v, Eq v, C a, Eq a) => a -> a -> v a -> Bool
Documentation
A Module over a ring satisfies:
a *> (b + c) === a *> b + a *> c (a * b) *> c === a *> (b *> c) (a + b) *> c === a *> c + b *> c
zero element of the vector space
(<+>) :: C a => v a -> v a -> v a infixl 6 Source #
add and subtract elements
(*>) :: C a => a -> v a -> v a infixr 7 Source #
scale a vector by a scalar
We need a Haskell 98 type class which provides equality test for Vector type constructors.
Instances for standard type constructors
functorScale :: (Functor v, C a) => a -> v a -> v a Source #
Related functions
linearComb :: (C a, C v) => [a] -> [v a] -> v a Source #
Compute the linear combination of a list of vectors.