Enum MathType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MathType>

    public enum MathType
    extends java.lang.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 Detail

      • 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 Detail

      • myComponents

        private final int myComponents
      • myJavaType

        private final JavaType myJavaType
      • myNumberSet

        private final NumberSet myNumberSet
    • Constructor Detail

      • MathType

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

      • values

        public static MathType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MathType c : MathType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MathType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isPrimitive

        public static boolean isPrimitive​(MathType type1,
                                          MathType type2)
      • getComponents

        public int getComponents()
      • getJavaClass

        public java.lang.Class<?> getJavaClass()
      • getJavaType

        public JavaType getJavaType()
      • getNumberSet

        public NumberSet getNumberSet()
      • getTotalMemory

        public long getTotalMemory()
      • isPrimitive

        public boolean isPrimitive()