|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectptolemy.math.Quantization
ptolemy.math.FixPointQuantization
public class FixPointQuantization
The FixPointQuantization class defines the mapping of numeric values with unlimited precision to the finite precision supported by arithmetic using the FixPoint class.
It comprises a
An instance of the class is immutable, meaning that its value is set in the constructor and cannot then be modified.
FixPoint
,
Precision
,
Overflow
,
Rounding
,
Serialized Form
Red |
Red (Ed.Willink) |
Field Summary | |
---|---|
protected Precision |
_precision
The precision. |
Fields inherited from class ptolemy.math.Quantization |
---|
_overflow, _rounding |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class ptolemy.math.Quantization |
---|
clone, getEpsilonValue, getExactOverflow, getExactRounding, getExponentBitLength, getFractionBitLength, getIntegerBitLength, getMantissaBitLength, getMaximumUnscaledValue, getMaximumValue, getMinimumUnscaledValue, getMinimumValue, getModuloUnscaledValue, getNumberOfBits, getNumberOfLevels, getOverflow, getRounding, getTinyValue |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Precision _precision
Constructor Detail |
---|
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 FixPointQuantization(Precision precision, Overflow overflow, Rounding rounding)
precision
- The precision.overflow
- The overflow.rounding
- The rounding.Method Detail |
---|
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |