public class FixPointQuantization extends Quantization
It comprises a
An instance of the class is immutable, meaning that its value is set in the constructor and cannot then be modified.
Modifier and Type | Field and Description |
---|---|
protected Precision |
_precision
The precision.
|
_overflow, _rounding
Constructor and Description |
---|
FixPointQuantization(Precision precision,
Overflow overflow,
Rounding rounding)
Construct a FixPointQuantization with specified precision, overflow
and rounding.
|
FixPointQuantization(java.lang.String string)
Construct a FixPointQuantization object based on the provided
string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Return true if the given object describes the same
mapping to quantized values as this object.
|
Precision |
getMantissaPrecision()
Return the precision of the mantissa of the value.
|
Precision |
getPrecision()
Return the precision.
|
int |
hashCode()
Return a hash code value for this FixPointQuantization.
|
FixPointQuantization |
setOverflow(Overflow overflow)
Return a FixPointQuantization with a changed overflow strategy.
|
FixPointQuantization |
setPrecision(Precision precision)
Return a FixPointQuantization with a changed precision.
|
FixPointQuantization |
setRounding(Rounding rounding)
Return a FixPointQuantization with a changed rounding strategy.
|
java.lang.String |
toString()
Return a string representing this quantization.
|
clone, getEpsilonValue, getExactOverflow, getExactRounding, getExponentBitLength, getFractionBitLength, getIntegerBitLength, getMantissaBitLength, getMaximumUnscaledValue, getMaximumValue, getMinimumUnscaledValue, getMinimumValue, getModuloUnscaledValue, getNumberOfBits, getNumberOfLevels, getOverflow, getRounding, getTinyValue
protected Precision _precision
public FixPointQuantization(java.lang.String string) throws java.lang.IllegalArgumentException
precision must be one of the Precision formats; integer-bits.fraction-bits or total-bits/integer-bits.
overflow must be one of the Overflow strategies; e.g. saturate or modulo or trap. The default is saturate.
rounding must be one of the Rounding strategies; e.g. up or half_even or unnecessary. The default is nearest.
string
- The string representing the
quantization specification.java.lang.IllegalArgumentException
- If the precision string
supplied, overflow strategy or rounding strategy does not
match one of the known formats.public boolean equals(java.lang.Object object)
equals
in class Quantization
object
- The FixPointQuantization object to use for equality
checking.public Precision getMantissaPrecision()
getMantissaPrecision
in class Quantization
public Precision getPrecision()
getPrecision
in class Quantization
setPrecision(Precision)
public int hashCode()
hashCode
in class Quantization
public FixPointQuantization setOverflow(Overflow overflow)
overflow
- The new overflow strategy.public FixPointQuantization setPrecision(Precision precision)
precision
- The new precision.getPrecision()
public FixPointQuantization setRounding(Rounding rounding)
rounding
- The new rounding.strategy.public java.lang.String toString()
toString
in class Quantization