Class CooManipulations
java.lang.Object
org.flag4j.linalg.ops.sparse.coo.CooManipulations
Utility class containing methods for manipulating a sparse COO tensor, matrix, or vector.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidswapCols(Shape shape, Object[] entries, int[] rowIndices, int[] colIndices, int colIdx1, int colIdx2) Swaps two columns, in place, in a sparse COO matrix.static voidswapRows(Shape shape, Object[] entries, int[] rowIndices, int[] colIndices, int rowIdx1, int rowIdx2) Swaps two rows, in place, in a sparse COO matrix.
-
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.
-