hmatrix-0.15.2.1: Linear algebra and numerical computation

Copyright(c) Alberto Ruiz 2008
LicenseGPL-style
MaintainerAlberto Ruiz <aruiz@um.es>
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Data.Packed.ST

Contents

Description

In-place manipulation inside the ST monad. See examples/inplace.hs in the distribution.

Synopsis

Mutable Vectors

data STVector s t Source

newVector :: Storable t => t -> Int -> ST s (STVector s t) Source

freezeVector :: Storable t => STVector s1 t -> ST s2 (Vector t) Source

runSTVector :: Storable t => (forall s. ST s (STVector s t)) -> Vector t Source

readVector :: Storable t => STVector s t -> Int -> ST s t Source

writeVector :: Storable t => STVector s t -> Int -> t -> ST s () Source

modifyVector :: Storable t => STVector s t -> Int -> (t -> t) -> ST s () Source

liftSTVector :: Storable t => (Vector t -> a) -> STVector s1 t -> ST s2 a Source

Mutable Matrices

data STMatrix s t Source

newMatrix :: Storable t => t -> Int -> Int -> ST s (STMatrix s t) Source

freezeMatrix :: Storable t => STMatrix s1 t -> ST s2 (Matrix t) Source

runSTMatrix :: Storable t => (forall s. ST s (STMatrix s t)) -> Matrix t Source

readMatrix :: Storable t => STMatrix s t -> Int -> Int -> ST s t Source

writeMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s () Source

modifyMatrix :: Storable t => STMatrix s t -> Int -> Int -> (t -> t) -> ST s () Source

liftSTMatrix :: Storable t => (Matrix t -> a) -> STMatrix s1 t -> ST s2 a Source

Unsafe functions

unsafeWriteVector :: Storable t => STVector s t -> Int -> t -> ST s () Source

unsafeReadMatrix :: Storable t => STMatrix s t -> Int -> Int -> ST s t Source

unsafeWriteMatrix :: Storable t => STMatrix s t -> Int -> Int -> t -> ST s () Source