Class CooRingHermTranspose

java.lang.Object
org.flag4j.linalg.ops.sparse.coo.ring_ops.CooRingHermTranspose

public final class CooRingHermTranspose extends Object
Utility class for computing the Hermitian transpose of a COO ring matrix or tensor.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends Ring<T>>
    void
    tensorHermTranspose(Shape shape, T[] srcEntries, int[][] srcIndices, int[] axes, T[] destEntries, int[][] destIndices)
    Computes the Hermitian transpose of a sparse COO tensor.
    static <T extends Ring<T>>
    void
    tensorHermTranspose(Shape shape, T[] srcEntries, int[][] srcIndices, int axis1, int axis2, T[] destEntries, int[][] destIndices)
    Computes the Hermitian transpose of a sparse COO tensor by exchanging axis1 and axis2.

    Methods inherited from class java.lang.Object

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

    • tensorHermTranspose

      public static <T extends Ring<T>> void tensorHermTranspose(Shape shape, T[] srcEntries, int[][] srcIndices, int axis1, int axis2, T[] destEntries, int[][] destIndices)

      Computes the Hermitian transpose of a sparse COO tensor by exchanging axis1 and axis2.

      Parameters:
      shape - Shape of the tensor to transpose.
      srcEntries - The non-zero data of the tensor to transpose.
      srcIndices - The non-zero indices of the tensor to transpose. Must have shape [srcEntries.length][shape.getRank()].
      axis1 - First axis to exchange. Must be in the range [0, shape.getRank()).
      axis2 - Second axis to exchange. Must be in the range [0, shape.getRank()).
      destEntries - Array to store the non-zero data of the transpose. Must have the same length as srcEntries.
      destIndices - Array to store the non-zero indices of the transpose. Must have shape [srcEntries.length][shape.getRank()]
      srcIndices -
      Throws:
      IndexOutOfBoundsException - If either axis1 or axis2 are out of bounds for the rank of this tensor.
      See Also:
    • tensorHermTranspose

      public static <T extends Ring<T>> void tensorHermTranspose(Shape shape, T[] srcEntries, int[][] srcIndices, int[] axes, T[] destEntries, int[][] destIndices)
      Computes the Hermitian transpose of a sparse COO tensor. That is, permutes the axes of the tensor so that it matches the permutation specified by axes.
      Parameters:
      shape - Shape of the tensor to transpose.
      srcEntries - The non-zero data of the tensor to transpose.
      srcIndices - The non-zero indices of the tensor to transpose. Must have shape [srcEntries.length][shape.getRank()].
      axes - Permutation of tensor axis. If the tensor has rank N, then this must be an array of length N which is a permutation of {0, 1, 2, ..., N-1}.
      destEntries - Array to store the non-zero data of the transpose. Must have the same length as srcEntries.
      destIndices - Array to store the non-zero indices of the transpose. Must have shape [srcEntries.length][shape.getRank()]
      Throws:
      IllegalArgumentException - If srcEntries, srcIndices, destEntries, and destIndices do not all have the same length.
      IndexOutOfBoundsException - If any element of axes is out of bounds for the rank of this tensor.
      IllegalArgumentException - If axes is not a permutation of {1, 2, 3, ... N-1}.