Package org.ojalgo.type.math
Enum MathType
- java.lang.Object
-
- java.lang.Enum<MathType>
-
- org.ojalgo.type.math.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 theNumberSet
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 Summary
Enum Constants Enum Constant Description C128
Complex Number: 2 * doubleH256
Quaternion: 4 * doubleQ128
Rational Number: 2 * longR032
Real Number: floatR064
Real Number: doubleR128
Real Number: 2 * doubleR256
Real Number:BigDecimal
Z008
Integer: byteZ016
Integer: shortZ032
Integer: intZ064
Integer: long
-
Field Summary
Fields Modifier and Type Field Description private int
myComponents
private JavaType
myJavaType
private NumberSet
myNumberSet
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MathType
common(MathType other)
int
getComponents()
java.lang.Class<?>
getJavaClass()
JavaType
getJavaType()
NumberSet
getNumberSet()
long
getTotalMemory()
boolean
isPrimitive()
static boolean
isPrimitive(MathType type1, MathType type2)
static MathType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static MathType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
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 * doubleQuadruple 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
-
-
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 namejava.lang.NullPointerException
- if the argument is null
-
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()
-
-