Package org.flag4j.arrays.sparse


package org.flag4j.arrays.sparse

Contains implementations for sparse tensors, matrices, and vectors.

A sparse tensor, matrix, or vector is an array where most elements are zero. However, there is no strict definition for the proportion of zero-values elements within the array for it to be considered sparse but generally there should be many times more than non-zero values.

Sparse arrays can offer advantages such as reduced memory usage and, in many cases, improved computational performance. These benefits depend on the degree of sparsity and the algorithms used.

It should be noted that certain ops on sparse arrays can result in catastrophic loss of sparsity significantly increasing the number of non-zero elements, resulting in higher memory consumption and degraded performance. These effects can be particularly problematic for algorithms optimized for sparse data. Such ops will be documented and should be used with care.

This package includes implementations for arrays with real and complex values, as well as generalized support for semirings, rings, and fields. Additionally, some specialized sparse matrix types are provided with limited support for ops: permutation matrix and the symmetric tri-diagonal matrix.

See Also:
  • Classes
    Class
    Description
    A complex sparse matrix stored in coordinate list (COO) format.
    Sparse complex tensor stored in coordinate list (COO) format.
    A complex sparse vector stored in coordinate list (COO) format.
    CooFieldMatrix<T extends Field<T>>
    Instances of this class represent a sparse matrix whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Field type.
    CooFieldTensor<T extends Field<T>>
    Represents a sparse tensor whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Field type.
    CooFieldVector<T extends Field<T>>
    Represents a sparse vector whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Field type.
    A real sparse matrix stored in coordinate list (COO) format.
    CooRingMatrix<T extends Ring<T>>
    Represents a sparse matrix whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Ring type.
    CooRingTensor<T extends Ring<T>>
    Represents a sparse tensor whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Ring type.
    CooRingVector<T extends Ring<T>>
    Represents a sparse vector whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Ring type.
    Represents a sparse matrix whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Semiring type.
    Represents a sparse tensor whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Semiring type.
    Represents a sparse vector whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specified Semiring type.
    A real sparse tensor stored in coordinate list (COO) format.
    A real sparse vector stored in coordinate list (COO) format.
    A complex sparse matrix stored in compressed sparse row (CSR) format.
    CsrFieldMatrix<T extends Field<T>>
    Instances of this class represent a sparse matrix using the compressed sparse row (CSR) format where all data elements belonging to a specified Field type.
    Instances of this class represent a real sparse matrix using the compressed sparse row (CSR) format.
    CsrRingMatrix<T extends Ring<T>>
     
    Instances of this class represent a sparse matrix using the compressed sparse row (CSR) format where all data elements belonging to a specified Semiring type.
    Represents a square permutation matrix with rows and columns equal to PermutationMatrix.size, where each row and column contains exactly one entry of 1, and all other entries are 0.
    A real symmetric tri-diagonal matrix.