Copyright | (c) Artur M. Brodzki 2018 |
---|---|
License | BSD3 |
Maintainer | artur@brodzki.org |
Stability | experimental |
Portability | Windows/POSIX |
Safe Haskell | None |
Language | Haskell2010 |
- This module provides convenient constructors that generates a matrix (finitely- or infinite-dimensional)
- Finitely-dimensional matrices provide much greater performance than infinitely-dimensional
Synopsis
- fromIndices :: Num a => String -> Int -> Int -> (Int -> Int -> a) -> Tensor a
- const :: Num a => String -> Int -> Int -> a -> Tensor a
- randomDouble :: ContGen d => String -> Int -> Int -> d -> IO (Tensor Double)
- randomDoubleSeed :: (ContGen d, PrimMonad m) => String -> Int -> Int -> d -> Int -> m (Tensor Double)
- randomInt :: DiscreteGen d => String -> Int -> Int -> d -> IO (Tensor Int)
- randomIntSeed :: (DiscreteGen d, PrimMonad m) => String -> Int -> Int -> d -> Int -> m (Tensor Int)
Generators
:: Num a | |
=> String | Indices names (one character per index, first character: rows index, second character: columns index) |
-> Int | Number of matrix rows |
-> Int | Number of matrix columns |
-> (Int -> Int -> a) | Generator function - returns a matrix component at |
-> Tensor a | Generated matrix |
Generate matrix as function of its indices
:: Num a | |
=> String | Indices names (one character per index, first character: rows index, second character: columns index) |
-> Int | Number of matrix rows |
-> Int | Number of matrix columns |
-> a | Value of matrix components |
-> Tensor a | Generated matrix |
Generate matrix with all components equal to v
:: ContGen d | |
=> String | Indices names (one character per index, first character: rows index, second character: columns index) |
-> Int | Number of matrix rows |
-> Int | Number of matrix columns |
-> d | Continuous probability distribution (as from Statistics.Distribution) |
-> IO (Tensor Double) | Generated matrix |
Generate matrix with random real components with given probability distribution. The matrix is wrapped in the IO monad.
Available probability distributions:
- Beta : Statistics.Distribution.BetaDistribution
- Cauchy : Statistics.Distribution.CauchyLorentz
- Chi-squared : Statistics.Distribution.ChiSquared
- Exponential : Statistics.Distribution.Exponential
- Gamma : Statistics.Distribution.Gamma
- Normal : Statistics.Distribution.Normal
- StudentT : Statistics.Distribution.StudentT
- Uniform : Statistics.Distribution.Uniform
- F : Statistics.Distribution.FDistribution
- Laplace : Statistics.Distribution.Laplace
:: (ContGen d, PrimMonad m) | |
=> String | Indices names (one character per index, first character: rows index, second character: columns index) |
-> Int | Number of matrix rows |
-> Int | Number of matrix columns |
-> d | Continuous probability distribution (as from Statistics.Distribution) |
-> Int | Randomness seed |
-> m (Tensor Double) | Generated matrix |
Generate matrix with random real components with given probability distribution and given seed. The matrix is wrapped in the a monad.
Available probability distributions:
- Beta : Statistics.Distribution.BetaDistribution
- Cauchy : Statistics.Distribution.CauchyLorentz
- Chi-squared : Statistics.Distribution.ChiSquared
- Exponential : Statistics.Distribution.Exponential
- Gamma : Statistics.Distribution.Gamma
- Normal : Statistics.Distribution.Normal
- StudentT : Statistics.Distribution.StudentT
- Uniform : Statistics.Distribution.Uniform
- F : Statistics.Distribution.FDistribution
- Laplace : Statistics.Distribution.Laplace
:: DiscreteGen d | |
=> String | Indices names (one character per index, first character: rows index, second character: columns index) |
-> Int | Number of matrix rows |
-> Int | Number of matrix columns |
-> d | Discrete probability distribution (as from Statistics.Distribution) |
-> IO (Tensor Int) | Generated matrix |
Generate matrix with random integer components with given probability distribution. The matrix is wrapped in the IO monad.
Available probability distributions:
- Binomial : Statistics.Distribution.Binomial
- Poisson : Statistics.Distribution.Poisson
- Geometric : Statistics.Distribution.Geometric
- Hypergeometric: Statistics.Distribution.Hypergeometric
:: (DiscreteGen d, PrimMonad m) | |
=> String | Indices names (one character per index, first character: rows index, second character: columns index) |
-> Int | Number of matrix rows |
-> Int | Number of matrix columns |
-> d | Discrete probability distribution (as from Statistics.Distribution) |
-> Int | Randomness seed |
-> m (Tensor Int) | Generated matrix |
Generate matrix with random integer components with given probability distribution. and given seed. The matrix is wrapped in a monad.
Available probability distributions:
- Binomial : Statistics.Distribution.Binomial
- Poisson : Statistics.Distribution.Poisson
- Geometric : Statistics.Distribution.Geometric
- Hypergeometric: Statistics.Distribution.Hypergeometric