matrices-0.5.0: native matrix based on vector

Data.Matrix.Symmetric.Generic

Synopsis

# Documentation

data SymMatrix v a Source #

Symmetric square matrix

Constructors

 SymMatrix !Int !(v a)
Instances

dim :: Matrix m v a => m v a -> (Int, Int) Source #

rows :: Matrix m v a => m v a -> Int Source #

Derived methods

Return the number of rows

cols :: Matrix m v a => m v a -> Int Source #

Return the number of columns

unsafeIndex :: Matrix m v a => m v a -> (Int, Int) -> a Source #

(!) :: Matrix m v a => m v a -> (Int, Int) -> a Source #

Indexing

flatten :: Matrix m v a => m v a -> v a Source #

Default algorithm is O((m*n) * O(unsafeIndex)).

unsafeFromVector :: Matrix m v a => (Int, Int) -> v a -> m v a Source #

fromVector :: Matrix m v a => (Int, Int) -> v a -> m v a Source #

takeRow :: Matrix m v a => m v a -> Int -> v a Source #

Extract a row.

thaw :: (Matrix m v a, PrimMonad s) => m v a -> s (Mutable m (Mutable v) (PrimState s) a) Source #

unsafeThaw :: (Matrix m v a, PrimMonad s) => m v a -> s (Mutable m (Mutable v) (PrimState s) a) Source #

freeze :: (Matrix m v a, PrimMonad s) => Mutable m (Mutable v) (PrimState s) a -> s (m v a) Source #

unsafeFreeze :: (Matrix m v a, PrimMonad s) => Mutable m (Mutable v) (PrimState s) a -> s (m v a) Source #

create :: Matrix m v a => (forall s. ST s (Mutable m (Mutable v) s a)) -> m v a Source #

map :: (Vector v a, Vector v b) => (a -> b) -> SymMatrix v a -> SymMatrix v b Source #

imap :: (Vector v a, Vector v b) => ((Int, Int) -> a -> b) -> SymMatrix v a -> SymMatrix v b Source #

Upper triangular imap, i.e., i <= j

zip :: (Vector v a, Vector v b, Vector v (a, b)) => SymMatrix v a -> SymMatrix v b -> SymMatrix v (a, b) Source #

zipWith :: (Vector v a, Vector v b, Vector v c) => (a -> b -> c) -> SymMatrix v a -> SymMatrix v b -> SymMatrix v c Source #