Class MapToBit
- java.lang.Object
- 
- org.apache.sysds.runtime.compress.colgroup.mapping.AMapToData
- 
- org.apache.sysds.runtime.compress.colgroup.mapping.MapToBit
 
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class MapToBit extends AMapToData - See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description MapToBit(int unique, int size)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopy(AMapToData d)Copy the values in this map into another mapping object.voidcopyBit(BitSet d)voidcopyInt(int[] d)voidfill(int v)Fill the map with a given value.longgetExactSizeOnDisk()Get the size of this Mapping object on disk.intgetIndex(int n)Get the given index back as a integerlonggetInMemorySize()Get the in memory size of this Mapping object.static longgetInMemorySize(int dataLength)MapToFactory.MAP_TYPEgetType()intgetUpperBoundValue()Get the maximum value that is possible to allocate inside this map.booleanisEmpty()voidpreAggregateDDC_DDCMultiCol(AMapToData tm, ADictionary td, double[] v, int nCol)voidpreAggregateDDC_DDCSingleCol(AMapToData tm, double[] td, double[] v)voidreplace(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.AMapToDataresize(int unique)voidset(int n, int v)Set the index to the value.intsetAndGet(int n, int v)Set the index to the value and get the contained value after.intsize()The size of the Mapping object, signaling how many value cells are stored in this mapping object.voidwrite(DataOutput out)Serialize this object to the DataOutput given.- 
Methods inherited from class org.apache.sysds.runtime.compress.colgroup.mapping.AMapToDatagetCounts, getMax, getUnique, preAggregateDDC_DDC, preAggregateDDC_SDCZ, preAggregateDDC_SDCZMultiCol, preAggregateDDC_SDCZSingleCol, preAggregateDense, preAggregateDense, preAggregateSDCZ_DDC, preAggregateSDCZ_SDCZ, preAggregateSparse, preAggregateSparse, setUnique, toString
 
- 
 
- 
- 
- 
Method Detail- 
getTypepublic MapToFactory.MAP_TYPE getType() - Specified by:
- getTypein class- AMapToData
 
 - 
getIndexpublic int getIndex(int n) Description copied from class:AMapToDataGet the given index back as a integer- Specified by:
- getIndexin class- AMapToData
- Parameters:
- n- the index to get
- Returns:
- the value represented in that cell as integer
 
 - 
fillpublic void fill(int v) Description copied from class:AMapToDataFill the map with a given value. NOTE! The value should be representable inside the map. This requirement is not checked.- Specified by:
- fillin class- AMapToData
- Parameters:
- v- the value to fill
 
 - 
getInMemorySizepublic long getInMemorySize() Description copied from class:AMapToDataGet the in memory size of this Mapping object.- Specified by:
- getInMemorySizein class- AMapToData
- Returns:
- The size in Bytes.
 
 - 
getInMemorySizepublic static long getInMemorySize(int dataLength) 
 - 
setpublic void set(int n, int v)Description copied from class:AMapToDataSet the index to the value. NOTE! The value should be representable inside the map. This requirement is not checked.- Specified by:
- setin class- AMapToData
- Parameters:
- n- index to set.
- v- the value to set it to.
 
 - 
setAndGetpublic int setAndGet(int n, int v)Description copied from class:AMapToDataSet the index to the value and get the contained value after.- Specified by:
- setAndGetin class- AMapToData
- Parameters:
- n- index to set.
- v- the value to set it to.
- Returns:
- v as encoded, note this value can be different that the one put in if the map is not able to represent the value
 
 - 
sizepublic int size() Description copied from class:AMapToDataThe size of the Mapping object, signaling how many value cells are stored in this mapping object.- Specified by:
- sizein class- AMapToData
- Returns:
- The length of the mapping object.
 
 - 
replacepublic void replace(int v, int r)Description copied from class:AMapToDataReplace 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.- Specified by:
- replacein class- AMapToData
- Parameters:
- v- The value to replace
- r- The value to put instead
 
 - 
getExactSizeOnDiskpublic long getExactSizeOnDisk() Description copied from class:AMapToDataGet the size of this Mapping object on disk.- Specified by:
- getExactSizeOnDiskin class- AMapToData
- Returns:
- The on disk size in Bytes.
 
 - 
writepublic void write(DataOutput out) throws IOException Description copied from class:AMapToDataSerialize this object to the DataOutput given.- Specified by:
- writein class- AMapToData
- Parameters:
- out- The object to serialize this object into.
- Throws:
- IOException- An IO exception if the Serialization fails.
 
 - 
getUpperBoundValuepublic int getUpperBoundValue() Description copied from class:AMapToDataGet the maximum value that is possible to allocate inside this map.- Specified by:
- getUpperBoundValuein class- AMapToData
- Returns:
- The maximum value.
 
 - 
preAggregateDDC_DDCSingleColpublic void preAggregateDDC_DDCSingleCol(AMapToData tm, double[] td, double[] v) 
 - 
preAggregateDDC_DDCMultiColpublic void preAggregateDDC_DDCMultiCol(AMapToData tm, ADictionary td, double[] v, int nCol) 
 - 
isEmptypublic boolean isEmpty() 
 - 
copypublic void copy(AMapToData d) Description copied from class:AMapToDataCopy the values in this map into another mapping object. NOTE! All contained vales should be representable inside the map given. This requirement is not checked.- Overrides:
- copyin class- AMapToData
- Parameters:
- d- Map to copy all values into.
 
 - 
copyIntpublic void copyInt(int[] d) - Specified by:
- copyIntin class- AMapToData
 
 - 
copyBitpublic void copyBit(BitSet d) - Specified by:
- copyBitin class- AMapToData
 
 - 
resizepublic AMapToData resize(int unique) - Specified by:
- resizein class- AMapToData
 
 
- 
 
-