Class AIdentityDictionary
java.lang.Object
org.apache.sysds.runtime.compress.colgroup.dictionary.ADictionary
org.apache.sysds.runtime.compress.colgroup.dictionary.ACachingMBDictionary
org.apache.sysds.runtime.compress.colgroup.dictionary.AIdentityDictionary
- All Implemented Interfaces:
Serializable,IDictionary
- Direct Known Subclasses:
IdentityDictionary,IdentityDictionarySlice
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.sysds.runtime.compress.colgroup.dictionary.IDictionary
IDictionary.DictType -
Field Summary
Fields inherited from interface org.apache.sysds.runtime.compress.colgroup.dictionary.IDictionary
LOG -
Constructor Summary
ConstructorsConstructorDescriptionAIdentityDictionary(int nRowCol) Create an identity matrix dictionary.AIdentityDictionary(int nRowCol, boolean withEmpty) -
Method Summary
Modifier and TypeMethodDescriptionfinal booleancontainsValue(double pattern) Detect if the dictionary contains a specific value.static longgetInMemorySize(int numberColumns) double[]productAllRowsToDouble(int nCol) Method to product all rows to a column vector.double[]productAllRowsToDoubleWithDefault(double[] defaultTuple) Method to product all rows to a column vector with a default value added in the end.int[]sort()Sort the values of this dictionary via an index of how the values mapped previously.booleanMethods inherited from class org.apache.sysds.runtime.compress.colgroup.dictionary.ACachingMBDictionary
createMBDict, getMBDictMethods inherited from class org.apache.sysds.runtime.compress.colgroup.dictionary.ADictionary
addToEntry, addToEntry, addToEntryVectorized, aggregate, aggregateCols, aggregateColsWithReference, aggregateRows, aggregateRowsWithDefault, aggregateRowsWithReference, aggregateWithReference, append, applyScalarOp, applyScalarOpAndAppend, applyScalarOpWithReference, applyUnaryOp, applyUnaryOpAndAppend, applyUnaryOpWithReference, binOpLeft, binOpLeftAndAppend, binOpLeftWithReference, binOpRight, binOpRight, binOpRightAndAppend, binOpRightWithReference, cbind, centralMoment, centralMoment, centralMomentWithDefault, centralMomentWithDefault, centralMomentWithReference, centralMomentWithReference, clone, colProduct, colProductWithReference, colSum, colSumSq, colSumSqWithReference, containsValueWithReference, correctNan, countNNZZeroColumns, equals, equals, getMBDict, getNumberNonZerosWithReference, getRow, getSparsity, getValue, getValue, getValues, MMDict, MMDictDense, MMDictScaling, MMDictScalingDense, MMDictScalingSparse, MMDictSparse, multiplyScalar, preaggValuesFromDense, product, productAllRowsToDoubleWithReference, productWithDefault, productWithReference, putDense, putSparse, reorder, replace, replaceWithReference, rexpandCols, rexpandColsWithReference, rightMMPreAggSparse, scaleTuples, sliceOutColumnRange, subtractTuple, sum, sumAllRowsToDouble, sumAllRowsToDoubleSq, sumAllRowsToDoubleSqWithDefault, sumAllRowsToDoubleSqWithReference, sumAllRowsToDoubleWithDefault, sumAllRowsToDoubleWithReference, sumSq, sumSqWithReference, TSMMToUpperTriangle, TSMMToUpperTriangleDense, TSMMToUpperTriangleDenseScaling, TSMMToUpperTriangleScaling, TSMMToUpperTriangleSparse, TSMMToUpperTriangleSparseScaling, TSMMWithScalingMethods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.sysds.runtime.compress.colgroup.dictionary.IDictionary
equals, getDictType, getExactSizeOnDisk, getInMemorySize, getNumberNonZeros, getNumberOfColumns, getNumberOfValues, getString, sliceColumns, write
-
Constructor Details
-
AIdentityDictionary
public AIdentityDictionary(int nRowCol) Create an identity matrix dictionary. It behaves as if allocated a Sparse Matrix block but exploits that the structure is known to have certain properties.- Parameters:
nRowCol- The number of rows and columns in this identity matrix.
-
AIdentityDictionary
public AIdentityDictionary(int nRowCol, boolean withEmpty)
-
-
Method Details
-
withEmpty
public boolean withEmpty() -
getInMemorySize
public static long getInMemorySize(int numberColumns) -
containsValue
public final boolean containsValue(double pattern) Description copied from interface:IDictionaryDetect if the dictionary contains a specific value.- Specified by:
containsValuein interfaceIDictionary- Overrides:
containsValuein classADictionary- Parameters:
pattern- The value to search for- Returns:
- true if the value is contained else false.
-
productAllRowsToDouble
public double[] productAllRowsToDouble(int nCol) Description copied from interface:IDictionaryMethod to product all rows to a column vector.- Specified by:
productAllRowsToDoublein interfaceIDictionary- Overrides:
productAllRowsToDoublein classADictionary- Parameters:
nCol- The number of columns in the ColGroup to know how to get the values from the dictionary.- Returns:
- A row product
-
productAllRowsToDoubleWithDefault
public double[] productAllRowsToDoubleWithDefault(double[] defaultTuple) Description copied from interface:IDictionaryMethod to product all rows to a column vector with a default value added in the end.- Specified by:
productAllRowsToDoubleWithDefaultin interfaceIDictionary- Overrides:
productAllRowsToDoubleWithDefaultin classADictionary- Parameters:
defaultTuple- The default row that aggregate to last cell- Returns:
- A row product
-
sort
public int[] sort()Description copied from interface:IDictionarySort the values of this dictionary via an index of how the values mapped previously. In practice this design means we can reuse the previous dictionary for the resulting column group- Returns:
- The sorted index.
-