hmatrix-gsl-0.19.0.1: Numerical computation

Copyright | (c) Alberto Ruiz 2007-14
License | GPL
Maintainer | Alberto Ruiz
Stability | provisional
Safe Haskell | None
Language | Haskell2010

Numeric.GSL.LinearAlgebra

Description

Synopsis

- data RandDist
  - = Uniform
  - | Gaussian
- randomVector :: Int -> RandDist -> Int -> Vector Double
- saveMatrix :: FilePath -> String -> Matrix Double -> IO ()
- fwriteVector :: FilePath -> Vector Double -> IO ()
- freadVector :: FilePath -> Int -> IO (Vector Double)
- fprintfVector :: FilePath -> String -> Vector Double -> IO ()
- fscanfVector :: FilePath -> Int -> IO (Vector Double)
- fileDimensions :: FilePath -> IO (Int, Int)
- loadMatrix :: FilePath -> IO (Matrix Double)
- fromFile :: FilePath -> (Int, Int) -> IO (Matrix Double)

# Documentation

data RandDist Source #

Constructors

Uniform | uniform distribution in [0,1)
Gaussian | normal distribution with mean zero and standard deviation one

#### Instances

Instances details

Enum RandDist Source # |

Instance details

Defined in Numeric.GSL.LinearAlgebra

Methods

succ :: RandDist -> RandDist Source #

pred :: RandDist -> RandDist Source #

toEnum :: Int -> RandDist Source #

fromEnum :: RandDist -> Int Source #

enumFrom :: RandDist -> [RandDist] Source #

enumFromThen :: RandDist -> RandDist -> [RandDist] Source #

enumFromTo :: RandDist -> RandDist -> [RandDist] Source #

enumFromThenTo :: RandDist -> RandDist -> RandDist -> [RandDist] Source #

randomVector Source #

Arguments

:: Int | seed
-> RandDist | distribution
-> Int | vector size
-> Vector Double |

Obtains a vector of pseudorandom elements from the the mt19937 generator in GSL, with a given seed. Use randomIO to get a random seed.

saveMatrix Source #

Arguments

:: FilePath |
-> String | format (%f, %g, %e)
-> Matrix Double |
-> IO () |

Saves a matrix as 2D ASCII table.

fwriteVector :: FilePath -> Vector Double -> IO () Source #

Saves the elements of a vector to a binary file.

freadVector :: FilePath -> Int -> IO (Vector Double) Source #

Loads a vector from a binary file (the number of elements must be known in advance).

fprintfVector :: FilePath -> String -> Vector Double -> IO () Source #

Saves the elements of a vector, with a given format (%f, %e, %g), to an ASCII file.

fscanfVector :: FilePath -> Int -> IO (Vector Double) Source #

Loads a vector from an ASCII file (the number of elements must be known in advance).

fileDimensions :: FilePath -> IO (Int, Int) Source #

obtains the number of rows and columns in an ASCII data file (provisionally using unix's wc).

loadMatrix :: FilePath -> IO (Matrix Double) Source #

Loads a matrix from an ASCII file formatted as a 2D table.

fromFile :: FilePath -> (Int, Int) -> IO (Matrix Double) Source #

Loads a matrix from an ASCII file (the number of rows and columns must be known in advance).