Module flag4j

Class AbstractCooSemiringVector<T extends AbstractCooSemiringVector<T,U,V,W,Y>,U extends AbstractDenseSemiringVector<U,W,Y>,V extends AbstractCooSemiringMatrix<V,W,T,Y>,W extends AbstractDenseSemiringMatrix<W,U,Y>,Y extends Semiring<Y>>

java.lang.Object
org.flag4j.arrays.backend.AbstractTensor<T,Semiring<Y>[],Y>
org.flag4j.arrays.backend.semiring.AbstractCooSemiringVector<T,U,V,W,Y>
Type Parameters:
T - Type of this vector.
U - Type of equivalent dense vector.
V - Type of matrix equivalent to T.
Y - Type of dense matrix equivalent to U.
Y - Type of the semiring element in this vector.
All Implemented Interfaces:
Serializable, SemiringTensorMixin<T,U,Y>, TensorOverSemiRing<T,U,Semiring<Y>[],Y>, VectorMixin<T,V,W,Y>, TensorBinaryOpsMixin<T,T>, TensorMixin<T,Semiring<Y>[],Y>

public abstract class AbstractCooSemiringVector<T extends AbstractCooSemiringVector<T,U,V,W,Y>,U extends AbstractDenseSemiringVector<U,W,Y>,V extends AbstractCooSemiringMatrix<V,W,T,Y>,W extends AbstractDenseSemiringMatrix<W,U,Y>,Y extends Semiring<Y>> extends AbstractTensor<T,Semiring<Y>[],Y> implements SemiringTensorMixin<T,U,Y>, VectorMixin<T,V,W,Y>

A sparse vector stored in coordinate list (COO) format. The AbstractTensor.entries of this COO vector are elements of a Semiring.

The non-zero entries and non-zero indices of a COO vector are mutable but the AbstractTensor.shape and total number of non-zero entries is fixed.

Sparse vectors allow for the efficient storage of and operations on large vectors that contain many zero values.

COO vectors are optimized for large hyper-sparse vectors (i.e. vectors which contain almost all zeros relative to the size of the vector).

A sparse COO vector is stored as:

Note: many operations assume that the entries of the COO vector are sorted lexicographically. However, this is not explicitly verified. Every operation implemented in this class will preserve the lexicographical sorting.

If indices need to be sorted for any reason, call sortIndices().

See Also: