Interface SparseNdArray<T, U extends NdArray<T>>

Type Parameters:
T - the type that the array contains
U - the type of dense NdArray
All Superinterfaces:
NdArray<T>, Shaped
All Known Implementing Classes:
AbstractSparseNdArray, BooleanSparseNdArray, BooleanSparseSlice, ByteSparseNdArray, ByteSparseSlice, DoubleSparseNdArray, DoubleSparseSlice, FloatSparseNdArray, FloatSparseSlice, IntSparseNdArray, IntSparseSlice, LongSparseNdArray, LongSparseSlice, ObjectSparseSlice, ShortSparseNdArray, ShortSparseSlice, SparseNdArray, SparseSlice

public interface SparseNdArray<T, U extends NdArray<T>> extends NdArray<T>
Interface for Sparse Arrays
  • Method Details

    • getIndices

      LongNdArray getIndices()
      Gets the Indices

      Indices are a A 2-D long array of shape [N, ndims], that specifies the indices of the elements in the sparse array that contain nonzero values (elements are zero-indexed).

      For example, indices=[[1,3], [2,4]] specifies that the elements with indexes of coordinates [1,3] and [2,4] have nonzero values.

      Returns:
      the Indices
    • getValues

      U getValues()
      Gets the values.

      Values are a 1-D array of any type and shape [N], that supplies the values for each element in indices.

      For example, given indices=[[1,3], [2,4]], and values=[18, 3.6] specifies that element [1,3] of the sparse array has a value of 18, and element [2,4] of the sparse array has a value of 3.6.

      Returns:
      the values