Portability | portable |
---|---|
Stability | stable |
Maintainer | lennart...schmitt@<nospam>gmail.com |
This module implements the simple functionality of multidimensional linear function calculation.
- type LinFunction a = [a]
- type Values a = [a]
- calcLinFunction :: Num a => LinFunction a -> Values a -> a
Data Types
type LinFunction a = [a]Source
The function-type represents a function by its constants, e.g.
[b0,b1,...,bn]
represents the function f = b0 + b1 * X1 + ... + bn * Xn
Similare to the function-type, but die value-type represents the values of the variables in a function, e.g.
[X1,...,Xn]
Functions
calcLinFunction :: Num a => LinFunction a -> Values a -> aSource
Calculates the result of a given function with given values, e.g.
calcLinFunction [1,1,1] [1,2] == 1 + 1 * 1 + 1 * 2 == 4
calcLinFunction [1,2,3] [1,1] == 1 + 2 * 1 + 3 * 1 == 6
calcLinFunction [1,2,3] [1..] == 1 + 2 * 1 + 3 * 2 == 9