Enum Class UPLO

All Implemented Interfaces:
Serializable, Comparable<UPLO>, Constable

public enum UPLO extends Enum<UPLO>
Which triangular part of a symmetric or triangular matrix is stored.

When a matrix is symmetric, Hermitian, or triangular, only one triangular half needs to be stored. BLAS and LAPACK use this flag to indicate which half is present in memory:

  • UPPER — only the upper triangular part (including the diagonal) is stored.
  • LOWER — only the lower triangular part (including the diagonal) is stored.

Use flip(UPLO) to convert between the two, which is required when switching between row-major and column-major layouts (the upper triangle of a row-major matrix corresponds to the lower triangle in column-major layout).

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Lower triangular part is stored (including diagonal).
    Upper triangular part is stored (including diagonal).
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the integer value for CBLAS.
    Returns a human-readable description of this storage flag.
    static UPLO
    flip(UPLO value)
    Flips between UPPER and LOWER, null-safe.
    static UPLO
    fromBlas(int value)
    Returns the UPLO constant corresponding to the given CBLAS integer value.
    static UPLO
    fromLapack(byte value)
    Returns the UPLO constant corresponding to the given LAPACK byte value.
    boolean
    Returns true if the lower triangle is stored.
    boolean
    Returns true if the upper triangle is stored.
    byte
    Returns the byte value for LAPACK.
    static UPLO
    Returns the enum constant of this class with the specified name.
    static UPLO[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • UPPER

      public static final UPLO UPPER
      Upper triangular part is stored (including diagonal). The lower triangle is inferred by symmetry and need not be present in memory.
    • LOWER

      public static final UPLO LOWER
      Lower triangular part is stored (including diagonal). The upper triangle is inferred by symmetry and need not be present in memory.
  • Method Details

    • values

      public static UPLO[] 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 UPLO 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.
    • isUpper

      public boolean isUpper()
      Returns true if the upper triangle is stored.
      Returns:
      true if upper.
    • isLower

      public boolean isLower()
      Returns true if the lower triangle is stored.
      Returns:
      true if lower.
    • description

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

      public static UPLO flip(UPLO value)
      Flips between UPPER and LOWER, null-safe.

      This is useful when switching between row-major and column-major representations: the upper triangle of a row-major matrix corresponds to the lower triangle when the same data is interpreted in column-major.

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

      public static UPLO fromBlas(int value)
      Returns the UPLO constant corresponding to the given CBLAS integer value.
      Parameters:
      value - the CBLAS integer value (121 for upper, 122 for lower).
      Returns:
      the matching UPLO constant.
      Throws:
      IllegalArgumentException - if the value does not match any constant.
    • fromLapack

      public static UPLO fromLapack(byte value)
      Returns the UPLO constant corresponding to the given LAPACK byte value.
      Parameters:
      value - the LAPACK byte value ('U' or 'L').
      Returns:
      the matching UPLO constant.
      Throws:
      IllegalArgumentException - if the value does not match any constant.