Class AIdentityDictionary

All Implemented Interfaces:
Serializable, IDictionary
Direct Known Subclasses:
IdentityDictionary, IdentityDictionarySlice

public abstract class AIdentityDictionary extends ACachingMBDictionary
See Also:
  • 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: 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
    • sort

      public int[] sort()
      Description copied from interface: IDictionary
      Sort 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.