HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulematrices-0.5.0Haskell2010

Data.Matrix.Sparse.Generic

  • 2 types
  • 1 class
  • 15 values
  • Packagematrices-0.5.0
  • Exports23
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceGeneric.hs
classclass Eq a => Zero a where
#

Methods

Instances3Zero
  • Zero DoubleDefined in matrices-0.5.0 · Data.Matrix.Sparse.Generic
  • Zero IntDefined in matrices-0.5.0 · Data.Matrix.Sparse.Generic
  • Eq a => Zero [a]Defined in matrices-0.5.0 · Data.Matrix.Sparse.Generic
datadata CSR (v :: Type -> Type) a
#

Compressed Sparse Row (CSR) matrix

Constructors

Instances7Matrix, Eq, Read, Show, Generic, Rep, …

Accessors

0 declarations

length information

valuerows :: Matrix m v a => m v a -> Int
#

Derived methods

Return the number of rows

valuecols :: Matrix m v a => m v a -> Int
#

Return the number of columns

Indexing

methodtakeDiag :: m v a -> v a
#

Extract the diagonal. Default algorithm is O(min(m,n) * O(unsafeIndex)).

Construction

7 declarations
valuefromAscAL :: Vector v a => (Int, Int) -> Int -> AssocList a -> CSR v a
#

Construct CSR from ascending association list. Items must be sorted first by row index, and then by column index.

valuematrix
  1. :: Matrix m v a
  2. => Int

    number of columns

  3. -> [a]

    row list

  4. -> m v a
#

O(m*n) Matrix construction

valuefromLists :: Matrix m v a => [[a]] -> m v a
#

O(m*n) Create matrix from list of lists, it doesn't check if the list of list is a valid matrix

valuefromRows :: Matrix m v a => [v a] -> m v a
#

O(m*n) Create matrix from rows

Conversions

5 declarations
methodflatten :: m v a -> v a
#

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

valuetoRows :: Matrix m v a => m v a -> [v a]
#

O(m) Return the rows

valuetoList :: Matrix m v a => m v a -> [a]
#

O(m*n) Create a list by concatenating rows

valuetoLists :: Matrix m v a => m v a -> [[a]]
#

O(m*n) List of lists