Module flag4j

Class CooDataSorter<T>

java.lang.Object
org.flag4j.linalg.ops.sparse.coo.CooDataSorter<T>

public final class CooDataSorter<T> extends Object

A class which can be used to sort the indices, along with data values, in lexicographical order.

This class is not thread safe.

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}