Class CooManipulations

java.lang.Object
org.flag4j.linalg.ops.sparse.coo.CooManipulations

public final class CooManipulations extends Object
Utility class containing methods for manipulating a sparse COO tensor, matrix, or vector.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    swapCols(Shape shape, Object[] entries, int[] rowIndices, int[] colIndices, int colIdx1, int colIdx2)
    Swaps two columns, in place, in a sparse COO matrix.
    static void
    swapRows(Shape shape, Object[] entries, int[] rowIndices, int[] colIndices, int rowIdx1, int rowIdx2)
    Swaps two rows, in place, in a sparse COO matrix.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • swapRows

      public static void swapRows(Shape shape, Object[] entries, int[] rowIndices, int[] colIndices, int rowIdx1, int rowIdx2)
      Swaps two rows, in place, in a sparse COO matrix.
      Parameters:
      shape - Shape of the matrix to make swap in.
      entries - Non-zero data of the COO matrix.
      rowIndices - Row indices of the COO matrix.
      colIndices - Column indices of the COO matrix.
      rowIdx1 - Index of the first row in the swap.
      rowIdx2 - Index of the second row in the swap.
    • swapCols

      public static void swapCols(Shape shape, Object[] entries, int[] rowIndices, int[] colIndices, int colIdx1, int colIdx2)
      Swaps two columns, in place, in a sparse COO matrix.
      Parameters:
      shape - Shape of the matrix to make swap in.
      entries - Non-zero data of the COO matrix.
      rowIndices - Row indices of the COO matrix.
      colIndices - Column indices of the COO matrix.
      colIdx1 - Index of the first column in the swap.
      colIdx2 - Index of the second column in the swap.