Enum Class MathType

java.lang.Object
java.lang.Enum<MathType>
org.ojalgo.type.math.MathType
All Implemented Interfaces:
Serializable, Comparable<MathType>, Constable

public enum MathType extends Enum<MathType>
The number sets supported by ojAlgo, paired with a declaration of how they are implemented/approximated. The naming scheme is the NumberSet symbol combined with the total number of bits used to represent the components.

For instance: C128 refers to C = ComplexNumber which is implemented as two double:s each of 64 bits. If there would be a float based complex number implementation it would be named C064.

R032 is a Real number implemented/approximated using a single 32 bit float.

  • Enum Constant Details

    • C128

      public static final MathType C128
      Complex Number: 2 * double
    • H256

      public static final MathType H256
      Quaternion: 4 * double
    • Q128

      public static final MathType Q128
      Rational Number: 2 * long
    • R032

      public static final MathType R032
      Real Number: float
    • R064

      public static final MathType R064
      Real Number: double
    • R128

      public static final MathType R128
      Real Number: 2 * double

      Quadruple precision emulated using a pair of double precision numbers

    • R256

      public static final MathType R256
      Real Number: BigDecimal

      Refer to it as "256" since (the way it's used in ojAlgo) it roughly corresponds to binary 256 octuple precision.

    • Z008

      public static final MathType Z008
      Integer: byte
    • Z016

      public static final MathType Z016
      Integer: short
    • Z032

      public static final MathType Z032
      Integer: int
    • Z064

      public static final MathType Z064
      Integer: long
  • Field Details

    • myComponents

      private final int myComponents
    • myJavaType

      private final JavaType myJavaType
    • myNumberSet

      private final NumberSet myNumberSet
  • Constructor Details

    • MathType

      private MathType(NumberSet numberSet, int components, JavaType javaType)
  • Method Details

    • values

      public static MathType[] 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 MathType 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
    • isPrimitive

      public static boolean isPrimitive(MathType type1, MathType type2)
    • common

      public MathType common(MathType other)
    • getComponents

      public int getComponents()
    • getJavaClass

      public Class<?> getJavaClass()
    • getJavaType

      public JavaType getJavaType()
    • getNumberSet

      public NumberSet getNumberSet()
    • getTotalMemory

      public long getTotalMemory()
    • isPrimitive

      public boolean isPrimitive()