Enum Class Order

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

public enum Order extends Enum<Order>
Matrix memory layout (storage order).

BLAS and LAPACK support two storage orders:

  • ROW_MAJOR — elements of the same row are contiguous in memory (C / C++ convention, CBLAS value 101).
  • COL_MAJOR — elements of the same column are contiguous in memory (Fortran convention, CBLAS value 102).

SMILE's DenseMatrix64 and DenseMatrix32 use column-major order by default (matching Fortran LAPACK conventions).

  • Enum Constant Details

    • ROW_MAJOR

      public static final Order ROW_MAJOR
      Row-major layout (C order): rows are contiguous.
    • COL_MAJOR

      public static final Order COL_MAJOR
      Column-major layout (Fortran order): columns are contiguous.
  • Method Details

    • values

      public static Order[] 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 Order 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 int lapack()
      Returns the integer value for LAPACK (same encoding as CBLAS).
      Returns:
      the LAPACK integer value.
    • isRowMajor

      public boolean isRowMajor()
      Returns true if this layout is row-major.
      Returns:
      true if row-major.
    • isColMajor

      public boolean isColMajor()
      Returns true if this layout is column-major.
      Returns:
      true if column-major.
    • description

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

      public static Order fromValue(int value)
      Returns the Order constant corresponding to the given CBLAS/LAPACK integer value.
      Parameters:
      value - the integer value (101 for row-major, 102 for column-major).
      Returns:
      the matching Order constant.
      Throws:
      IllegalArgumentException - if the value does not match any constant.