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:
-
ClassesClassDescriptionA 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 specifiedField
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 specifiedField
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 specifiedRing
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 specifiedRing
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 specifiedRing
type.CooSemiringMatrix<T extends Semiring<T>>Represents a sparse matrix whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specifiedSemiring
type.CooSemiringTensor<T extends Semiring<T>>Represents a sparse tensor whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specifiedSemiring
type.CooSemiringVector<T extends Semiring<T>>Represents a sparse vector whose non-zero elements are stored in Coordinate List (COO) format, with all data elements belonging to a specifiedSemiring
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 specifiedField
type.Instances of this class represent a real sparse matrix using the compressed sparse row (CSR) format.CsrRingMatrix<T extends Ring<T>>CsrSemiringMatrix<T extends Semiring<T>>Instances of this class represent a sparse matrix using the compressed sparse row (CSR) format where all data elements belonging to a specifiedSemiring
type.Represents a square permutation matrix with rows and columns equal toPermutationMatrix.size
, where each row and column contains exactly one entry of1
, and all other entries are0
.A real symmetric tri-diagonal matrix.