Class DoubleCombiner
java.lang.Object
io.nosqlbench.virtdata.library.basics.shared.util.DoubleCombiner
- All Implemented Interfaces:
LongFunction<double[]>
- Direct Known Subclasses:
DoubleVectors
For comprehensive docs on how this works, please see the javadocs for
Combiner<T>. This class is merely a primitive specialization.-
Constructor Summary
ConstructorsConstructorDescriptionDoubleCombiner(String spec, LongToDoubleFunction elementFunction) Construct a combiner which can compose unique combinations of array data. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]apply(long value) static long[]computeRadixFactors(char[][] charsets) double[]getArray(int[] indexes) double[]getEncoding(int[] indexes) getEncoding(long ordinal) int[]getIndexes(long value) Get the indexes directly which are used byapply(long)int[]getIndexes(String encoding) longgetOrdinal(int[] indexes) Using the provided column offsets, derive the ordinal value which matches it.longgetOrdinal(String name) Using the provided name, derive the ordinal value which matches it.protected static longmaxRadixDigits(String spec)
-
Constructor Details
-
DoubleCombiner
Construct a combiner which can compose unique combinations of array data.- Parameters:
spec- The string specifier, as explained inDoubleCombinerdocs.elementFunction- The function that indexes into a unique population of T elements
-
-
Method Details
-
maxRadixDigits
-
apply
public double[] apply(long value) - Specified by:
applyin interfaceLongFunction<double[]>
-
getArray
public double[] getArray(int[] indexes) -
getArray
-
getEncoding
-
getEncoding
-
getIndexes
public int[] getIndexes(long value) Get the indexes directly which are used byapply(long)- Parameters:
value-- Returns:
- an offset array for each column in the provided charset specifiers
-
getIndexes
- 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
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)
-