Package org.rcsb.cif.binary.encoding
Class IntervalQuantizationEncoding
java.lang.Object
org.rcsb.cif.binary.encoding.IntervalQuantizationEncoding
- All Implemented Interfaces:
Encoding<FloatArray,Int32Array>
public class IntervalQuantizationEncoding extends Object implements Encoding<FloatArray,Int32Array>
Converts an array of floating point numbers to a Int32Array where the values are quantized within a
given interval into specified number of discrete steps. Values lower than the minimum value or greater than the
maximum are represented by the respective boundary values.
FixedPoint {
kind = "IntervalQuantization"
min: number,
max: number,
numSteps: number,
srcType: Float32 | Float64
}
Example
[0.5, 1, 1.5, 2, 3, 1.345 ]
---IntervalQuantization--->
{ min = 1, max = 2, numSteps = 3 } [0, 0, 1, 2, 2, 1]
-
Constructor Summary
Constructors Constructor Description IntervalQuantizationEncoding()IntervalQuantizationEncoding(int min, int max, int numSteps, int srcType) -
Method Summary
Modifier and Type Method Description FloatArraydecode(Int32Array data)Move one step up the encoding deque.Int32Arrayencode(FloatArray data)Move one step down the encoding deque.Map<String,Object>getMapRepresentation()Converts this encoding to its map representation that can be serialized as BinaryCif.StringtoString()
-
Constructor Details
-
IntervalQuantizationEncoding
public IntervalQuantizationEncoding() -
IntervalQuantizationEncoding
public IntervalQuantizationEncoding(int min, int max, int numSteps, int srcType)
-
-
Method Details
-
getMapRepresentation
Description copied from interface:EncodingConverts this encoding to its map representation that can be serialized as BinaryCif.- Specified by:
getMapRepresentationin interfaceEncoding<FloatArray,Int32Array>- Returns:
- a Map that contains all encoding information
-
decode
Description copied from interface:EncodingMove one step up the encoding deque. One step closer to the original representation of the data.- Specified by:
decodein interfaceEncoding<FloatArray,Int32Array>- Parameters:
data- the container to decode- Returns:
- the decoded information
-
encode
Description copied from interface:EncodingMove one step down the encoding deque. One step closer to aByteArrayrepresentation.- Specified by:
encodein interfaceEncoding<FloatArray,Int32Array>- Parameters:
data- the container to encode- Returns:
- the decoded information
-
toString
-