Class SparseDataWrapper<T>

java.lang.Object
org.flag4j.operations.sparse.coo.SparseDataWrapper<T>
Type Parameters:
T - Type of the individual entry within the sparse tensor.

public final class SparseDataWrapper<T> extends Object

A wrapper to wrap the entries and indices from a sparse tensor, vector, or matrix. This wrapper can then be used to sort the indices, along with data values, in lexicographical order.

Specifically, if a sparse tensor has shape (10, 15, 5, 2) and the following indices and non-zero values,

      - Indices: {{4, 1, 2, 0}, {4, 0, 1, 2},
                  {1, 2, 3, 0}, {2, 3, 5, 1},
                  {9, 10, 4, 1}, {1, 2, 1, 1}}
      - Values: {1.1, 2.2, 3.3, 4.4, 5.5, 6.6}
 
then the sorted indices and non-zero values will be,
      - Indices: {{1, 2, 1, 1}, {1, 2, 3, 0},
                  {2, 3, 5, 1}, {4, 0, 1, 2},
                  {4, 1, 2, 0}, {9, 10, 4, 1}}
      - Values: {6.6, 3.3, 4.4, 2.2, 1.1, 5.5}