Class DoubleCombiner

java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.util.DoubleCombiner
All Implemented Interfaces:
LongFunction<double[]>
Direct Known Subclasses:
DoubleVectors

public class DoubleCombiner extends Object implements LongFunction<double[]>
For comprehensive docs on how this works, please see the javadocs for Combiner<T>. This class is merely a primitive specialization.
  • Constructor Details

    • DoubleCombiner

      public DoubleCombiner(String spec, LongToDoubleFunction elementFunction)
      Construct a combiner which can compose unique combinations of array data.
      Parameters:
      spec - The string specifier, as explained in DoubleCombiner docs.
      elementFunction - The function that indexes into a unique population of T elements
  • Method Details

    • maxRadixDigits

      protected static long maxRadixDigits(String spec)
    • apply

      public double[] apply(long value)
      Specified by:
      apply in interface LongFunction<double[]>
    • getArray

      public double[] getArray(int[] indexes)
    • getArray

      public double[] getArray(String encoding)
    • getEncoding

      public String getEncoding(long ordinal)
    • getEncoding

      public String getEncoding(int[] indexes)
    • getIndexes

      public int[] getIndexes(long value)
      Get the indexes directly which are used by apply(long)
      Parameters:
      value -
      Returns:
      an offset array for each column in the provided charset specifiers
    • getIndexes

      public int[] getIndexes(String encoding)
      Parameters:
      encoding - the string encoding for the given ordinal
      Returns:
      the indexes used to select a value from the value function for each position in the output array
    • getOrdinal

      public long getOrdinal(String name)
      Using the provided name, derive the ordinal value which matches it.
      Parameters:
      name - - the textual name, expressed as an ASCII string
      Returns:
      the long which can be used to construct the matching name or related array.
    • getOrdinal

      public long getOrdinal(int[] indexes)
      Using the provided column offsets, derive the ordinal value which matches it.
      Parameters:
      indexes - - the indexes used to derive an array of values, or equivalently a name
      Returns:
      the long which can be used to construct the matching name or related array.
    • computeRadixFactors

      public static long[] computeRadixFactors(char[][] charsets)