| Stability | experimental |
|---|---|
| Maintainer | Patrick Perry <patperry@stanford.edu> |
Data.Matrix.Dense.ST
Description
Mutable dense matrices in the ST monad.
- data STMatrix s np e
- runSTMatrix :: (forall s. ST s (STMatrix s n e)) -> Matrix n e
- module Data.Matrix.Dense.Class
The STMatrix data type
Dense matrix in the ST monad. The type arguments are as follows:
-
s: the state variable argument for theSTtype -
np: a phantom type for the shape of the matrix. Most functions will demand that this be specified as a pair. When writing a function signature, you should always preferSTMatrix s (n,p) etoSTMatrix s np e. -
e: the element type of the matrix. Only certain element types are supported.
Instances
| MatrixShaped (STMatrix s) | |
| HasVectorView (STMatrix s) | |
| Elem e => BaseMatrix (STMatrix s) e | |
| BLAS3 e => MSolve (Tri (STMatrix s)) e (ST s) | |
| BLAS3 e => MMatrix (Tri (STMatrix s)) e (ST s) | |
| BLAS3 e => MMatrix (Herm (STMatrix s)) e (ST s) | |
| BLAS3 e => MMatrix (STMatrix s) e (ST s) | |
| BLAS3 e => WriteMatrix (STMatrix s) e (ST s) | |
| BLAS3 e => ReadMatrix (STMatrix s) e (ST s) | |
| Shaped (STMatrix s) (Int, Int) | |
| BLAS1 e => WriteTensor (STMatrix s) (Int, Int) e (ST s) | |
| Elem e => ReadTensor (STMatrix s) (Int, Int) e (ST s) |
runSTMatrix :: (forall s. ST s (STMatrix s n e)) -> Matrix n eSource
A safe way to create and work with a mutable matrix before returning an immutable matrix for later perusal. This function avoids copying the matrix before returning it - it uses unsafeFreezeMatrix internally, but this wrapper is a safe interface to that function.
Overloaded mutable dense matrix interface
module Data.Matrix.Dense.Class