Class AbstractCooRingTensor<T extends AbstractCooRingTensor<T,U,V>,U extends AbstractDenseRingTensor<U,V>,V extends Ring<V>>

java.lang.Object
org.flag4j.arrays.backend.AbstractTensor<T,V[],V>
org.flag4j.arrays.backend.semiring_arrays.AbstractCooSemiringTensor<T,U,V>
org.flag4j.arrays.backend.ring_arrays.AbstractCooRingTensor<T,U,V>
Type Parameters:
T - Type of this sparse COO tensor.
U - Type of dense tensor equivalent to T. This type parameter is required because some ops (e.g.
invalid reference
#tensorDot(AbstractCooRingTensor, int[], int[])
) between two sparse tensors results in a dense tensor.
V - Type of the Ring which the data of this tensor belong to.
All Implemented Interfaces:
Serializable, RingTensorMixin<T,T,V>, TensorOverRing<T,T,V[],V>, SemiringTensorMixin<T,T,V>, TensorOverSemiring<T,T,V[],V>
Direct Known Subclasses:
AbstractCooFieldTensor, CooRingTensor

public abstract class AbstractCooRingTensor<T extends AbstractCooRingTensor<T,U,V>,U extends AbstractDenseRingTensor<U,V>,V extends Ring<V>> extends AbstractCooSemiringTensor<T,U,V> implements RingTensorMixin<T,T,V>

Base class for all sparse Ring tensors stored in coordinate list (COO) format. The data of this COO tensor are elements of a Ring.

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

Sparse tensors allow for the efficient storage of and ops on tensors that contain many zero values.

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

A sparse COO tensor is stored as:

See Also:
  • Constructor Details

    • AbstractCooRingTensor

      protected AbstractCooRingTensor(Shape shape, V[] data, int[][] indices)
      Creates a tensor with the specified data and shape.
      Parameters:
      shape - Shape of this tensor.
      data - Entries of this tensor. If this tensor is dense, this specifies all data within the tensor. If this tensor is sparse, this specifies only the non-zero data of the tensor.
  • Method Details