matrices-0.5.0: native matrix based on vector
Safe HaskellNone
LanguageHaskell2010

Data.Matrix.Symmetric.Generic

Synopsis

Documentation

data SymMatrix (v :: Type -> Type) a Source #

Symmetric square matrix

Constructors

SymMatrix !Int !(v a) 

Instances

Instances details
Vector v a => Matrix SymMatrix v a Source # 
Instance details

Defined in Data.Matrix.Symmetric.Generic

Methods

dim :: SymMatrix v a -> (Int, Int) Source #

unsafeIndex :: SymMatrix v a -> (Int, Int) -> a Source #

unsafeFromVector :: (Int, Int) -> v a -> SymMatrix v a Source #

flatten :: SymMatrix v a -> v a Source #

unsafeTakeRow :: SymMatrix v a -> Int -> v a Source #

unsafeTakeColumn :: SymMatrix v a -> Int -> v a Source #

takeDiag :: SymMatrix v a -> v a Source #

thaw :: PrimMonad s => SymMatrix v a -> s (Mutable SymMatrix (Mutable v) (PrimState s) a) Source #

unsafeThaw :: PrimMonad s => SymMatrix v a -> s (Mutable SymMatrix (Mutable v) (PrimState s) a) Source #

freeze :: PrimMonad s => Mutable SymMatrix (Mutable v) (PrimState s) a -> s (SymMatrix v a) Source #

unsafeFreeze :: PrimMonad s => Mutable SymMatrix (Mutable v) (PrimState s) a -> s (SymMatrix v a) Source #

Generic (SymMatrix v a) Source # 
Instance details

Defined in Data.Matrix.Symmetric.Generic

Associated Types

type Rep (SymMatrix v a) 
Instance details

Defined in Data.Matrix.Symmetric.Generic

type Rep (SymMatrix v a) = D1 ('MetaData "SymMatrix" "Data.Matrix.Symmetric.Generic" "matrices-0.5.0-3Rdisefan6p6NaeA03GhUd" 'False) (C1 ('MetaCons "SymMatrix" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (v a))))

Methods

from :: SymMatrix v a -> Rep (SymMatrix v a) x #

to :: Rep (SymMatrix v a) x -> SymMatrix v a #

Read (v a) => Read (SymMatrix v a) Source # 
Instance details

Defined in Data.Matrix.Symmetric.Generic

Show (v a) => Show (SymMatrix v a) Source # 
Instance details

Defined in Data.Matrix.Symmetric.Generic

Methods

showsPrec :: Int -> SymMatrix v a -> ShowS #

show :: SymMatrix v a -> String #

showList :: [SymMatrix v a] -> ShowS #

Eq (v a) => Eq (SymMatrix v a) Source # 
Instance details

Defined in Data.Matrix.Symmetric.Generic

Methods

(==) :: SymMatrix v a -> SymMatrix v a -> Bool #

(/=) :: SymMatrix v a -> SymMatrix v a -> Bool #

type Mutable SymMatrix Source # 
Instance details

Defined in Data.Matrix.Symmetric.Generic

type Rep (SymMatrix v a) Source # 
Instance details

Defined in Data.Matrix.Symmetric.Generic

type Rep (SymMatrix v a) = D1 ('MetaData "SymMatrix" "Data.Matrix.Symmetric.Generic" "matrices-0.5.0-3Rdisefan6p6NaeA03GhUd" 'False) (C1 ('MetaCons "SymMatrix" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (v a))))

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

rows :: forall m (v :: Type -> Type) a. Matrix m v a => m v a -> Int Source #

Derived methods

Return the number of rows

cols :: forall m (v :: Type -> Type) a. 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 #

(!) :: forall m (v :: Type -> Type) a. 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 :: forall m (v :: Type -> Type) a. Matrix m v a => (forall s. ST s (Mutable m (Mutable v) s a)) -> m v a Source #

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

imap :: forall (v :: Type -> Type) a b. (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 :: forall (v :: Type -> Type) a b. (Vector v a, Vector v b, Vector v (a, b)) => SymMatrix v a -> SymMatrix v b -> SymMatrix v (a, b) Source #

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