Class MapToUByte
- java.lang.Object
-
- org.apache.sysds.runtime.compress.colgroup.mapping.AMapToData
-
- org.apache.sysds.runtime.compress.colgroup.mapping.MapToByte
-
- org.apache.sysds.runtime.compress.colgroup.mapping.MapToUByte
-
- All Implemented Interfaces:
Serializable
public class MapToUByte extends MapToByte
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MapToUByte(int unique, int size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decompressToRange(double[] c, int rl, int ru, int offR, double[] values)
void
decompressToRangeNoOff(double[] c, int rl, int ru, double[] values)
void
decompressToRangeOff(double[] c, int rl, int ru, int offR, double[] values)
void
fill(int v)
Fill the map with a given value.int[]
getCounts(int[] ret)
Get the number of counts of each unique value contained in this map.int
getIndex(int n)
Get the given index back as a integerstatic long
getInMemorySize(int dataLength)
int
getMaxPossible()
Get the maximum possible value to encode in this encoding.MapToFactory.MAP_TYPE
getType()
int
getUpperBoundValue()
Get the maximum value that is possible to allocate inside this map.void
replace(int v, int r)
Replace v with r for all entries, NOTE! It is assumed that you call this correctly: - with two distinct values that is representable inside the given AMapToData.AMapToData
resize(int unique)
Reallocate the map, to a smaller instance if applicable.int
setAndGet(int n, int v)
Set the index to the value and get the contained value after.void
write(DataOutput out)
Serialize this object to the DataOutput given.-
Methods inherited from class org.apache.sysds.runtime.compress.colgroup.mapping.MapToByte
append, appendN, copyBit, copyInt, countRuns, equals, getExactSizeOnDisk, getInMemorySize, lmSparseMatrixRow, set, size, slice
-
Methods inherited from class org.apache.sysds.runtime.compress.colgroup.mapping.AMapToData
copy, countRuns, equals, getCounts, getMax, getUnique, preAggregateDDC_DDC, preAggregateDDC_RLE, preAggregateDDC_SDCZ, preAggregateDDC_SDCZMultiCol, preAggregateDDC_SDCZSingleCol, preAggregateDense, preAggregateDense, preAggregateRLE_DDC, preAggregateSDCZ_DDC, preAggregateSDCZ_SDCZ, preAggregateSparse, preAggregateSparse, set, setUnique, toString, verify
-
-
-
-
Method Detail
-
getType
public MapToFactory.MAP_TYPE getType()
-
getIndex
public int getIndex(int n)
Description copied from class:AMapToData
Get the given index back as a integer
-
setAndGet
public int setAndGet(int n, int v)
Description copied from class:AMapToData
Set the index to the value and get the contained value after.
-
fill
public void fill(int v)
Description copied from class:AMapToData
Fill the map with a given value. NOTE! The value should be representable inside the map. This requirement is not checked.
-
getInMemorySize
public static long getInMemorySize(int dataLength)
-
write
public void write(DataOutput out) throws IOException
Description copied from class:AMapToData
Serialize this object to the DataOutput given.- Overrides:
write
in classMapToByte
- Parameters:
out
- The object to serialize this object into.- Throws:
IOException
- An IO exception if the Serialization fails.
-
replace
public void replace(int v, int r)
Description copied from class:AMapToData
Replace v with r for all entries, NOTE! It is assumed that you call this correctly: - with two distinct values that is representable inside the given AMapToData.
-
getUpperBoundValue
public int getUpperBoundValue()
Description copied from class:AMapToData
Get the maximum value that is possible to allocate inside this map.- Overrides:
getUpperBoundValue
in classMapToByte
- Returns:
- The maximum value.
-
getCounts
public int[] getCounts(int[] ret)
Description copied from class:AMapToData
Get the number of counts of each unique value contained in this map. Note that in the case the mapping is shorter than number of rows the counts sum to the number of mapped values not the number of rows.
-
getMaxPossible
public int getMaxPossible()
Description copied from class:AMapToData
Get the maximum possible value to encode in this encoding. For instance in a bit you can encode 2 values- Overrides:
getMaxPossible
in classMapToByte
- Returns:
- The maximum number of distinct values to encode
-
decompressToRange
public void decompressToRange(double[] c, int rl, int ru, int offR, double[] values)
- Overrides:
decompressToRange
in classMapToByte
-
decompressToRangeOff
public void decompressToRangeOff(double[] c, int rl, int ru, int offR, double[] values)
- Overrides:
decompressToRangeOff
in classMapToByte
-
decompressToRangeNoOff
public void decompressToRangeNoOff(double[] c, int rl, int ru, double[] values)
- Overrides:
decompressToRangeNoOff
in classMapToByte
-
resize
public AMapToData resize(int unique)
Description copied from class:AMapToData
Reallocate the map, to a smaller instance if applicable. Note it does not change the length of the array, just the datatype. Note that it returns the input if the input is the smallest representation that fits, otherwise it will return something that is smaller.
-
-