- 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 theNumberSetsymbol combined with the total number of bits used to represent the components.For instance: C128 refers to C =
ComplexNumberwhich 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 C128Complex Number: 2 * doubleH256Quaternion: 4 * doubleQ128Rational Number: 2 * longR032Real Number: floatR064Real Number: doubleR128Real Number: 2 * doubleR256Real Number:BigDecimalZ008Integer: byteZ016Integer: shortZ032Integer: intZ064Integer: long
-
Field Summary
Fields Modifier and Type Field Description private intmyComponentsprivate JavaTypemyJavaTypeprivate NumberSetmyNumberSet
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MathTypecommon(MathType other)intgetComponents()<N extends java.lang.Comparable<N>>
FunctionSet<N>getFunctionSet()java.lang.Class<?>getJavaClass()JavaTypegetJavaType()NumberSetgetNumberSet()<N extends java.lang.Comparable<N>>
Scalar.Factory<N>getScalarFactory()longgetTotalMemory()booleanisPrimitive()static booleanisPrimitive(MathType type1, MathType type2)static MathTypevalueOf(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: floatNumber of decimal digits: ~7.22
-
R064
public static final MathType R064
Real Number: doubleNumber of decimal digits: ~15.95
-
R128
public static final MathType R128
Real Number: 2 * doubleQuadruple precision emulated using a pair of double precision numbers
Number of decimal digits: ~34.02
-
R256
public static final MathType R256
Real Number:BigDecimalRefer to it as "256" since (the way it's used in ojAlgo) it roughly corresponds to binary 256 octuple precision.
Number of decimal digits: ~71.34
-
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()
-
getFunctionSet
public <N extends java.lang.Comparable<N>> FunctionSet<N> getFunctionSet()
-
getJavaClass
public java.lang.Class<?> getJavaClass()
-
getJavaType
public JavaType getJavaType()
-
getNumberSet
public NumberSet getNumberSet()
-
getScalarFactory
public <N extends java.lang.Comparable<N>> Scalar.Factory<N> getScalarFactory()
-
getTotalMemory
public long getTotalMemory()
-
isPrimitive
public boolean isPrimitive()
-
-