Safe Haskell | None |
---|---|

Language | Haskell98 |

- data MMatrix a b s = MMatrix {}
- type MMatrixXf = MMatrix Float CFloat
- type MMatrixXd = MMatrix Double CDouble
- type MMatrixXcf = MMatrix (Complex Float) (CComplex CFloat)
- type MMatrixXcd = MMatrix (Complex Double) (CComplex CDouble)
- type IOMatrix a b = MMatrix a b RealWorld
- type STMatrix a b s = MMatrix a b s
- new :: (PrimMonad m, Elem a b) => Int -> Int -> m (MMatrix a b (PrimState m))
- replicate :: (PrimMonad m, Elem a b) => Int -> Int -> a -> m (MMatrix a b (PrimState m))
- valid :: Elem a b => MMatrix a b s -> Bool
- read :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> m a
- write :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> a -> m ()
- unsafeRead :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> m a
- unsafeWrite :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> a -> m ()
- set :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> a -> m ()
- copy :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> MMatrix a b (PrimState m) -> m ()
- unsafeCopy :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> MMatrix a b (PrimState m) -> m ()
- unsafeWith :: Elem a b => IOMatrix a b -> (Ptr b -> CInt -> CInt -> IO c) -> IO c

# Documentation

Mutable matrix. You can modify elements

type MMatrixXcf = MMatrix (Complex Float) (CComplex CFloat) Source #

Alias for single previsiom mutable matrix of complex numbers

type MMatrixXcd = MMatrix (Complex Double) (CComplex CDouble) Source #

Alias for double prevision mutable matrix of complex numbers

# Construction

new :: (PrimMonad m, Elem a b) => Int -> Int -> m (MMatrix a b (PrimState m)) Source #

Create a mutable matrix of the given size and fill it with 0 as an initial value.

replicate :: (PrimMonad m, Elem a b) => Int -> Int -> a -> m (MMatrix a b (PrimState m)) Source #

Create a mutable matrix of the given size and fill it with as an initial value.

# Consistency check

# Accessing individual elements

read :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> m a Source #

Yield the element at the given position.

write :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> a -> m () Source #

Replace the element at the given position.

unsafeRead :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> m a Source #

Yield the element at the given position. No bounds checks are performed.

unsafeWrite :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> Int -> Int -> a -> m () Source #

Replace the element at the given position. No bounds checks are performed.

# Modifying matrices

set :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> a -> m () Source #

Set all elements of the matrix to the given value

copy :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> MMatrix a b (PrimState m) -> m () Source #

Copy a matrix. The two matrices must have the same size and may not overlap.

unsafeCopy :: (PrimMonad m, Elem a b) => MMatrix a b (PrimState m) -> MMatrix a b (PrimState m) -> m () Source #

Copy a matrix. The two matrices must have the same size and may not overlap however no bounds check performaned to it may SEGFAULT for incorrect input.