| Portability | portable |
|---|---|
| Stability | experimental |
| Maintainer | lennart...schmitt@<nospam>gmail.com |
Numeric.Vector
Contents
Description
This module implements a few extensions for the vector-module.
Data Types
data Vector a
Storable-based vectors
Instances
| Typeable1 Vector | |
| Joinable Matrix Vector | |
| Joinable Vector Matrix | |
| Normed Vector Double | |
| Normed Vector Float | |
| Container Vector Double | |
| Container Vector Float | |
| Storable a => Vector Vector a | |
| Normed Vector (Complex Double) | |
| Normed Vector (Complex Float) | |
| Container Vector (Complex Double) | |
| Container Vector (Complex Float) | |
| (Storable a, Eq a) => Eq (Vector a) | |
| (Data a, Storable a) => Data (Vector a) | |
| (Storable a, Ord a) => Ord (Vector a) | |
| (Read a, Storable a) => Read (Vector a) | |
| (Show a, Storable a) => Show (Vector a) | |
| Storable a => Monoid (Vector a) | |
| (Binary a, Storable a) => Binary (Vector a) |
Functions
average :: Floating a => RawVector a -> aSource
Calculates the lists elements average
average [1,3,2] == 2.0
fromList :: Storable a => [a] -> Vector a
creates a Vector from a list:
> fromList [2,3,5,7] 4 |> [2.0,3.0,5.0,7.0]
Convertes the representation from a simple list to a vector
maximumBy :: (a -> a -> Ordering) -> [a] -> a
The maximumBy function takes a comparison function and a list
and returns the greatest element of the list by the comparison function.
The list must be finite and non-empty.
Calculates a lists maximum depending on a given ordering-function
maxPos :: RawVector Double -> IntSource
Calculates the position of a lists maximum
maxPos [1,10,8,3] == 1
toList :: Storable a => Vector a -> [a]
extracts the Vector elements to a list
> toList (linspace 5 (1,10)) [1.0,3.25,5.5,7.75,10.0]
Convertes the representation from a vector to a simple list
transpose :: [[a]] -> [[a]]
The transpose function transposes the rows and columns of its argument.
For example,
transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]
Transposes a Vector