Enum Class Transpose

java.lang.Object
java.lang.Enum<Transpose>
smile.linalg.Transpose
All Implemented Interfaces:
Serializable, Comparable<Transpose>, Constable

public enum Transpose extends Enum<Transpose>
Matrix transpose operation passed to BLAS/LAPACK routines.

Use flip(Transpose) to toggle between NO_TRANSPOSE and TRANSPOSE, which is needed when converting between row-major and column-major representations.

  • Enum Constant Details

    • NO_TRANSPOSE

      public static final Transpose NO_TRANSPOSE
      Normal (identity) operation on the matrix.
    • TRANSPOSE

      public static final Transpose TRANSPOSE
      Transpose the matrix: A becomes AT.
    • CONJUGATE_TRANSPOSE

      public static final Transpose CONJUGATE_TRANSPOSE
      Conjugate-transpose the matrix: A becomes AH.
  • Method Details

    • values

      public static Transpose[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Transpose valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • blas

      public int blas()
      Returns the integer value for CBLAS.
      Returns:
      the CBLAS integer value.
    • lapack

      public byte lapack()
      Returns the byte value for LAPACK.
      Returns:
      the LAPACK byte value.
    • description

      public String description()
      Returns a human-readable description of this transpose option.
      Returns:
      a human-readable description.
    • flip

      public static Transpose flip(Transpose value)
      Toggles between NO_TRANSPOSE and TRANSPOSE, null-safe. CONJUGATE_TRANSPOSE is treated the same as TRANSPOSE for the purpose of flipping (returns NO_TRANSPOSE).

      This is useful when switching between row-major and column-major matrix representations: a row-major A passed to a column-major BLAS call requires flipping the transpose flag.

      Parameters:
      value - a Transpose value, may be null.
      Returns:
      the flipped value, or null if the input is null.
    • fromBlas

      public static Transpose fromBlas(int value)
      Returns the Transpose constant corresponding to the given CBLAS integer value.
      Parameters:
      value - the CBLAS integer value (111, 112, or 113).
      Returns:
      the matching Transpose constant.
      Throws:
      IllegalArgumentException - if the value does not match any constant.
    • fromLapack

      public static Transpose fromLapack(byte value)
      Returns the Transpose constant corresponding to the given LAPACK byte value.
      Parameters:
      value - the LAPACK byte value ('N', 'T', or 'C').
      Returns:
      the matching Transpose constant.
      Throws:
      IllegalArgumentException - if the value does not match any constant.