numeric-prelude-0.3.0.2: An experimental alternative hierarchy of numeric type classes

Portability portable provisional numericprelude@henning-thielemann.de Safe-Infered

Algebra.Vector

Description

Abstraction of vectors

Synopsis

# Documentation

class C v whereSource

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
```

Methods

zero :: C a => v aSource

zero element of the vector space

(<+>) :: C a => v a -> v a -> v aSource

add and subtract elements

(*>) :: C a => a -> v a -> v aSource

scale a vector by a scalar

Instances

 C [] C T C T C T C T C T C T C T C ((->) b) Ord i => C (Map i) Ord a => C (T a) Ord i => C (T i) C (T a)

class Eq v whereSource

We need a Haskell 98 type class which provides equality test for Vector type constructors.

Methods

eq :: Eq a => v a -> v a -> BoolSource

Instances

 Eq []

# Instances for standard type constructors

functorScale :: (Functor v, C a) => a -> v a -> v aSource

# Related functions

linearComb :: (C a, C v) => [a] -> [v a] -> v aSource

Compute the linear combination of a list of vectors.

# Properties

propCascade :: (C v, Eq v, C a, Eq a) => a -> a -> v a -> BoolSource

propRightDistributive :: (C v, Eq v, C a, Eq a) => a -> v a -> v a -> BoolSource

propLeftDistributive :: (C v, Eq v, C a, Eq a) => a -> a -> v a -> BoolSource