Package org.apache.sysds.runtime.compress.colgroup.dictionary

## 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`

    public abstract class AIdentityDictionary
    extends ACachingMBDictionary

See Also:
  Serialized Form

### 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

Constructors
`AIdentityDictionary​(int nRowCol)` Create an identity matrix dictionary.
`AIdentityDictionary​(int nRowCol, boolean withEmpty)`

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `containsValue​(double pattern)` Detect if the dictionary contains a specific value.
`static long` `getInMemorySize​(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.
`boolean` `withEmpty()`

### Methods inherited from class org.apache.sysds.runtime.compress.colgroup.dictionary.ACachingMBDictionary

`createMBDict, getMBDict`

### Methods 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, TSMMWithScaling`

### Methods inherited from class java.lang.Object

`getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.sysds.runtime.compress.colgroup.dictionary.IDictionary

`equals, getDictType, getExactSizeOnDisk, getInMemorySize, getNumberNonZeros, getNumberOfColumns, getNumberOfValues, getString, write`

### Constructor Detail

#### 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 Detail

#### withEmpty

    public boolean withEmpty()

#### getInMemorySize

    public static long getInMemorySize​(int numberColumns)

#### containsValue

    public final boolean containsValue​(double pattern)

Description copied from interface: `IDictionary`
Detect if the dictionary contains a specific value.

Specified by:
  `containsValue` in interface `IDictionary`
Overrides:
  `containsValue` in class `ADictionary`
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: `IDictionary`
Method to product all rows to a column vector.

Specified by:
  `productAllRowsToDouble` in interface `IDictionary`
Overrides:
  `productAllRowsToDouble` in class `ADictionary`
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: `IDictionary`
Method to product all rows to a column vector with a default value added in the end.

Specified by:
  `productAllRowsToDoubleWithDefault` in interface `IDictionary`
Overrides:
  `productAllRowsToDoubleWithDefault` in class `ADictionary`
Parameters:
  `defaultTuple` - The default row that aggregate to last cell
Returns:
  A row product