linda-0.1.2: LINear Discriminant Analysis

Portability portable experimental lennart...schmitt@gmail.com

Numeric.MatrixList

Contents

Description

This module implements a list of matrixes and a few functions to handle them.

Synopsis

# Data Types

type MatrixList a = [Matrix a]Source

A list of matrixes

type RawMatrixList a = [[[a]]]Source

A list of matrixes represented as a list of lists of lists

# Functions

toLists :: Element a => MatrixList a -> RawMatrixList aSource

Transforms a Matrixlist to a RawMatrixList.

Counts the number of matrixes in a list of matrixes

Counts the number of cols (based on the guess that all matrixes have the similare structure)

Calculate every cols averages

```   averages [[[1,2],[2,1]],[[2,3],[3,4]]] == [[1.5,1.5],[2.5,3.5]]
```

Calculates the cross-product of every matrix-cols

``` crossProduct  [[[1,2],[2,1]],[[2,3],[3,4]]] == [[2.0,2.0],[6.0,12.0]]
```

mapVectors :: ([a] -> [b]) -> RawMatrixList a -> RawMatrixList bSource

maps a function over every vector of a list of matrixes

``` mapVectors (map (1+)) [[[1,2],[2,1]],[[2,3],[3,4]]] == [[[2.0,3.0],[3.0,2.0]],[[3.0,4.0],[4.0,5.0]]]
```

foldVectors :: ([a] -> b) -> RawMatrixList a -> RawMatrix bSource

folds every vector of a list of matrixes

``` foldVectors sum [[[1,2],[2,1]],[[2,3],[3,4]]] == [[[2.0,3.0],[3.0,2.0]],[[3.0,4.0],[4.0,5.0]]]
```

mapElements :: (a -> b) -> RawMatrixList a -> RawMatrixList bSource

maps a function over every element of a list of matrixes

``` mapElements (1+) [[[1,2],[2,1]],[[2,3],[3,4]]] == [[[2.0,3.0],[3.0,2.0]],[[3.0,4.0],[4.0,5.0]]]
```

Transposes every matrix in a lit of matrixes

Counts the rows of every matrix in the list

``` countRows [[[1,2],[2,1]],[[2,3],[3,4],[1,1]]] == [2.0,3.0]
```

Counts the sum of all matrixes-rows

``` countAllRows [[[1,2],[2,1]],[[2,3],[3,4],[1,1]]] == 5.0
```