API Reference

This page contains the complete API documentation for GenericSparseArrays.jl.

Types

GenericSparseArrays.AbstractGenericSparseArrayType
AbstractGenericSparseArray{Tv,Ti,N} <: AbstractSparseArray{Tv,Ti,N}

Supertype for sparse arrays that can have their underlying storage on various devices (CPU, GPU, accelerators). This package keeps the hierarchy backend-agnostic; dispatch is expected to leverage the concrete types of internal buffers (e.g. Vector, CuArray, etc.) rather than an explicit backend flag.

source
GenericSparseArrays.GenericSparseVectorType
GenericSparseVector{Tv,Ti,IndT<:AbstractVector{Ti},ValT<:AbstractVector{Tv}} <: AbstractGenericSparseVector{Tv,Ti}

Sparse vector with generic index and value storage containers which may reside on different devices. The logical length is stored along with index/value buffers.

Fields

  • n::Ti - logical length of the vector
  • nzind::IndT - indices of stored (typically nonzero) entries (1-based)
  • nzval::ValT - stored values

Constructors validate that the index and value vectors have matching length.

source
GenericSparseArrays.GenericSparseMatrixCSCType
GenericSparseMatrixCSC{Tv,Ti,ColPtrT,RowValT,NzValT} <: AbstractGenericSparseMatrix{Tv,Ti}

Compressed Sparse Column (CSC) matrix with generic storage vectors for column pointer, row indices, and nonzero values. Buffer types (e.g. Vector, GPU array types) enable dispatch on device characteristics.

Fields

  • m::Int - number of rows
  • n::Int - number of columns
  • colptr::ColPtrT - column pointer array (length n+1)
  • rowval::RowValT - row indices of stored entries
  • nzval::NzValT - stored values
source
GenericSparseArrays.GenericSparseMatrixCSRType
GenericSparseMatrixCSR{Tv,Ti,RowPtrT,ColValT,NzValT} <: AbstractGenericSparseMatrix{Tv,Ti}

Compressed Sparse Row (CSR) matrix with generic storage vectors for row pointer, column indices, and nonzero values. Buffer types (e.g. Vector, GPU array types) enable dispatch on device characteristics.

Fields

  • m::Int - number of rows
  • n::Int - number of columns
  • rowptr::RowPtrT - row pointer array (length m+1)
  • colval::ColValT - column indices of stored entries
  • nzval::NzValT - stored values
source
GenericSparseArrays.GenericSparseMatrixCOOType
GenericSparseMatrixCOO{Tv,Ti,RowIndT<:AbstractVector{Ti},ColIndT<:AbstractVector{Ti},NzValT<:AbstractVector{Tv}} <: AbstractGenericSparseMatrix{Tv,Ti}

Coordinate (COO) sparse matrix with generic storage vectors for row indices, column indices, and nonzero values. Buffer types (e.g. Vector, GPU array types) enable dispatch on device characteristics.

Fields

  • m::Int - number of rows
  • n::Int - number of columns
  • rowind::RowIndT - row indices of stored entries
  • colind::ColIndT - column indices of stored entries
  • nzval::NzValT - stored values
source

Functions