Class PlaceHolderDict
- java.lang.Object
-
- org.apache.sysds.runtime.compress.colgroup.dictionary.PlaceHolderDict
-
- All Implemented Interfaces:
Serializable,IDictionary
public class PlaceHolderDict extends Object implements IDictionary, Serializable
- 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 Constructor Description PlaceHolderDict(int nVal)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToEntry(double[] v, int fr, int to, int nCol)Adds the dictionary entry from this dictionary to the d dictionaryvoidaddToEntry(double[] v, int fr, int to, int nCol, int rep)Adds the dictionary entry from this dictionary to the v dictionary rep times.voidaddToEntryVectorized(double[] v, int f1, int f2, int f3, int f4, int f5, int f6, int f7, int f8, int t1, int t2, int t3, int t4, int t5, int t6, int t7, int t8, int nCol)Vectorized add to entry, this call helps with a bit of locality for the cache.doubleaggregate(double init, Builtin fn)Aggregate all the contained values, useful in value only computations where the operation is iterating through all values contained in the dictionary.voidaggregateCols(double[] c, Builtin fn, IColIndex colIndexes)Aggregates the columns into the target double array provided.voidaggregateColsWithReference(double[] c, Builtin fn, IColIndex colIndexes, double[] reference, boolean def)Aggregates the columns into the target double array provided.double[]aggregateRows(Builtin fn, int nCol)Aggregate all entries in the rows.double[]aggregateRowsWithDefault(Builtin fn, double[] defaultTuple)Aggregate all entries in the rows of the dictionary with a extra cell in the end that contains the aggregate of the given defaultTuple.double[]aggregateRowsWithReference(Builtin fn, double[] reference)Aggregate all entries in the rows with an offset value reference added.doubleaggregateWithReference(double init, Builtin fn, double[] reference, boolean def)Aggregate all the contained values, with a reference offset.IDictionaryapplyScalarOp(ScalarOperator op)Allocate a new dictionary and applies the scalar operation on each cell of to then return the new dictionary.IDictionaryapplyScalarOpAndAppend(ScalarOperator op, double v0, int nCol)Allocate a new dictionary with one extra row and applies the scalar operation on each cell of to then return the new dictionary.IDictionaryapplyScalarOpWithReference(ScalarOperator op, double[] reference, double[] newReference)Allocate a new dictionary and apply the scalar operation on each cell to then return a new dictionary.IDictionaryapplyUnaryOp(UnaryOperator op)Allocate a new dictionary and apply the unary operator on each cell.IDictionaryapplyUnaryOpAndAppend(UnaryOperator op, double v0, int nCol)Allocate a new dictionary with one extra row and apply the unary operator on each cell.IDictionaryapplyUnaryOpWithReference(UnaryOperator op, double[] reference, double[] newReference)Allocate a new dictionary and apply the scalar operation on each cell to then return a new dictionary.IDictionarybinOpLeft(BinaryOperator op, double[] v, IColIndex colIndexes)Apply binary row operation on the left sideIDictionarybinOpLeftAndAppend(BinaryOperator op, double[] v, IColIndex colIndexes)Apply binary row operation on the left side with one extra row evaluating with zeros.IDictionarybinOpLeftWithReference(BinaryOperator op, double[] v, IColIndex colIndexes, double[] reference, double[] newReference)Apply the binary operator such that each value is offset by the reference before application.IDictionarybinOpRight(BinaryOperator op, double[] v)Apply binary row operation on the right side as with no columns to extract from v.IDictionarybinOpRight(BinaryOperator op, double[] v, IColIndex colIndexes)Apply binary row operation on the right side.IDictionarybinOpRightAndAppend(BinaryOperator op, double[] v, IColIndex colIndexes)Apply binary row operation on the right side with one extra row evaluating with zeros.IDictionarybinOpRightWithReference(BinaryOperator op, double[] v, IColIndex colIndexes, double[] reference, double[] newReference)Apply the binary operator such that each value is offset by the reference before application.IDictionarycbind(IDictionary that, int nCol)Cbind this dictionary with that dictionaryCM_COV_ObjectcentralMoment(ValueFunction fn, int[] counts, int nRows)Central moment function to calculate the central moment of this column group.CM_COV_ObjectcentralMoment(CM_COV_Object ret, ValueFunction fn, int[] counts, int nRows)Central moment function to calculate the central moment of this column group.CM_COV_ObjectcentralMomentWithDefault(ValueFunction fn, int[] counts, double def, int nRows)Central moment function to calculate the central moment of this column group with a default offset on all missing tuples.CM_COV_ObjectcentralMomentWithDefault(CM_COV_Object ret, ValueFunction fn, int[] counts, double def, int nRows)Central moment function to calculate the central moment of this column group with a default offset on all missing tuples.CM_COV_ObjectcentralMomentWithReference(ValueFunction fn, int[] counts, double reference, int nRows)Central moment function to calculate the central moment of this column group with a reference offset on each tuple.CM_COV_ObjectcentralMomentWithReference(CM_COV_Object ret, ValueFunction fn, int[] counts, double reference, int nRows)Central moment function to calculate the central moment of this column group with a reference offset on each tuple.IDictionaryclone()Returns a deep clone of the dictionary.voidcolProduct(double[] res, int[] counts, IColIndex colIndexes)Calculate the column product of the dictionary weighted by counts.voidcolProductWithReference(double[] res, int[] counts, IColIndex colIndexes, double[] reference)Calculate the column product of the dictionary weighted by counts.voidcolSum(double[] c, int[] counts, IColIndex colIndexes)Get the column sum of the values contained in the dictionaryvoidcolSumSq(double[] c, int[] counts, IColIndex colIndexes)Get the column sum of the values contained in the dictionaryvoidcolSumSqWithReference(double[] c, int[] counts, IColIndex colIndexes, double[] reference)Get the column sum of the values contained in the dictionary with an offset reference value added to each cell.booleancontainsValue(double pattern)Detect if the dictionary contains a specific value.booleancontainsValueWithReference(double pattern, double[] reference)Detect if the dictionary contains a specific value with reference offset.booleanequals(double[] v)Indicate if this object is equal to the given array of doubles.booleanequals(IDictionary o)Indicate if the other dictionary is equal to this.IDictionary.DictTypegetDictType()Get the dictionary type this dictionary is.longgetExactSizeOnDisk()Calculate the space consumption if the dictionary is stored on disk.longgetInMemorySize()Returns the memory usage of the dictionary.MatrixBlockDictionarygetMBDict(int nCol)Get this dictionary as a MatrixBlock dictionary.longgetNumberNonZeros(int[] counts, int nCol)Calculate the number of non zeros in the dictionary.longgetNumberNonZerosWithReference(int[] counts, double[] reference, int nRows)Calculate the number of non zeros in the dictionary.intgetNumberOfValues(int ncol)Get the number of distinct tuples given that the column group has n columnsdoublegetSparsity()Get the sparsity of the dictionary.StringgetString(int colIndexes)Get a string representation of the dictionary, that considers the layout of the data.doublegetValue(int i)Get Specific value contained in the dictionary at index.doublegetValue(int r, int col, int nCol)Get Specific value contain in dictionary at index.double[]getValues()Get all the values contained in the dictionary as a linearized double array.voidMMDict(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Matrix multiplication of dictionaries Note the left is this, and it is transposedvoidMMDictDense(double[] left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Matrix multiplication of dictionaries left side dense and transposed right side is this.voidMMDictScaling(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)Matrix multiplication of dictionaries Note the left is this, and it is transposedvoidMMDictScalingDense(double[] left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)Matrix multiplication of dictionaries left side dense and transposed right side is this.voidMMDictScalingSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)Matrix multiplication of dictionaries left side sparse and transposed right side is this.voidMMDictSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Matrix multiplication of dictionaries left side sparse and transposed right side is this.voidmultiplyScalar(double v, double[] ret, int off, int dictIdx, IColIndex cols)Multiply the v value with the dictionary entry at dictIdx and add it to the ret matrix at the columns specified in the int array.IDictionarypreaggValuesFromDense(int numVals, IColIndex colIndexes, IColIndex aggregateColumns, double[] b, int cut)Pre Aggregate values for Right Matrix Multiplication.voidproduct(double[] ret, int[] counts, int nCol)Calculate the product of the dictionary weighted by counts.double[]productAllRowsToDouble(int nrColumns)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.double[]productAllRowsToDoubleWithReference(double[] reference)Method to product all rows to a column vector with a reference values added to all cells, and a reference product in the endvoidproductWithDefault(double[] ret, int[] counts, double[] def, int defCount)Calculate the product of the dictionary weighted by counts with a default value added .voidproductWithReference(double[] ret, int[] counts, double[] reference, int refCount)Calculate the product of the dictionary weighted by counts and offset by referencestatic PlaceHolderDictread(DataInput in)IDictionaryreorder(int[] reorder)Reorder the elements in the dictionary based on the reorder specification given.IDictionaryreplace(double pattern, double replace, int nCol)Make a copy of the values, and replace all values that match pattern with replacement value.IDictionaryreplaceWithReference(double pattern, double replace, double[] reference)Make a copy of the values, and replace all values that match pattern with replacement value.IDictionaryrexpandCols(int max, boolean ignore, boolean cast, int nCol)Rexpand the dictionary (one hot encode)IDictionaryrexpandColsWithReference(int max, boolean ignore, boolean cast, int reference)Rexpand the dictionary (one hot encode)IDictionaryscaleTuples(int[] scaling, int nCol)Scale all tuples contained in the dictionary by the scaling factor given in the int list.IDictionarysliceOutColumnRange(int idxStart, int idxEnd, int previousNumberOfColumns)Modify the dictionary by removing columns not within the index range.IDictionarysubtractTuple(double[] tuple)Allocate a new dictionary where the tuple given is subtracted from all tuples in the previous dictionary.doublesum(int[] counts, int nCol)Get the sum of the values contained in the dictionarydouble[]sumAllRowsToDouble(int nrColumns)Method used as a pre-aggregate of each tuple in the dictionary, to single double values.double[]sumAllRowsToDoubleSq(int nrColumns)Method used as a pre-aggregate of each tuple in the dictionary, to single double values.double[]sumAllRowsToDoubleSqWithDefault(double[] defaultTuple)Method used as a pre-aggregate of each tuple in the dictionary, to single double values.double[]sumAllRowsToDoubleSqWithReference(double[] reference)Method used as a pre-aggregate of each tuple in the dictionary, to single double values.double[]sumAllRowsToDoubleWithDefault(double[] defaultTuple)Do exactly the same as the sumAllRowsToDouble but also sum the array given to a extra index in the end of the array.double[]sumAllRowsToDoubleWithReference(double[] reference)Method used as a pre-aggregate of each tuple in the dictionary, to single double values with a reference.doublesumSq(int[] counts, int nCol)Get the square sum of the values contained in the dictionarydoublesumSqWithReference(int[] counts, double[] reference)Get the square sum of the values contained in the dictionary with a reference offset on each value.voidTSMMToUpperTriangle(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is leftvoidTSMMToUpperTriangleDense(double[] left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is rightvoidTSMMToUpperTriangleDenseScaling(double[] left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is rightvoidTSMMToUpperTriangleScaling(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is leftvoidTSMMToUpperTriangleSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is rightvoidTSMMToUpperTriangleSparseScaling(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is rightvoidTSMMWithScaling(int[] counts, IColIndex rows, IColIndex cols, MatrixBlock ret)Transpose self matrix multiplication with a scaling factor on each pair of values.voidwrite(DataOutput out)Write the dictionary to a DataOutput.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sysds.runtime.compress.colgroup.dictionary.IDictionary
equals
-
-
-
-
Method Detail
-
getValues
public double[] getValues()
Description copied from interface:IDictionaryGet all the values contained in the dictionary as a linearized double array.- Specified by:
getValuesin interfaceIDictionary- Returns:
- linearized double array
-
getValue
public double getValue(int i)
Description copied from interface:IDictionaryGet Specific value contained in the dictionary at index.- Specified by:
getValuein interfaceIDictionary- Parameters:
i- The index to extract the value from- Returns:
- The value contained at the index
-
getValue
public double getValue(int r, int col, int nCol)Description copied from interface:IDictionaryGet Specific value contain in dictionary at index.- Specified by:
getValuein interfaceIDictionary- Parameters:
r- Row targetcol- Col targetnCol- nCol in dictionary- Returns:
- value
-
getInMemorySize
public long getInMemorySize()
Description copied from interface:IDictionaryReturns the memory usage of the dictionary.- Specified by:
getInMemorySizein interfaceIDictionary- Returns:
- a long value in number of bytes for the dictionary.
-
aggregate
public double aggregate(double init, Builtin fn)Description copied from interface:IDictionaryAggregate all the contained values, useful in value only computations where the operation is iterating through all values contained in the dictionary.- Specified by:
aggregatein interfaceIDictionary- Parameters:
init- The initial Value, in cases such as Max value, this could be -infinityfn- The Function to apply to values- Returns:
- The aggregated value as a double.
-
aggregateWithReference
public double aggregateWithReference(double init, Builtin fn, double[] reference, boolean def)Description copied from interface:IDictionaryAggregate all the contained values, with a reference offset.- Specified by:
aggregateWithReferencein interfaceIDictionary- Parameters:
init- The initial value, in cases such as Max value this could be -infinity.fn- The function to apply to the valuesreference- The reference offset to each value in the dictionarydef- If the reference should be treated as an instance of only as reference- Returns:
- The aggregated value as a double.
-
aggregateRows
public double[] aggregateRows(Builtin fn, int nCol)
Description copied from interface:IDictionaryAggregate all entries in the rows.- Specified by:
aggregateRowsin interfaceIDictionary- Parameters:
fn- The aggregate functionnCol- The number of columns contained in the dictionary.- Returns:
- Aggregates for this dictionary tuples.
-
aggregateRowsWithDefault
public double[] aggregateRowsWithDefault(Builtin fn, double[] defaultTuple)
Description copied from interface:IDictionaryAggregate all entries in the rows of the dictionary with a extra cell in the end that contains the aggregate of the given defaultTuple.- Specified by:
aggregateRowsWithDefaultin interfaceIDictionary- Parameters:
fn- The aggregate functiondefaultTuple- The default tuple to aggregate in last cell- Returns:
- Aggregates for this dictionary tuples.
-
aggregateRowsWithReference
public double[] aggregateRowsWithReference(Builtin fn, double[] reference)
Description copied from interface:IDictionaryAggregate all entries in the rows with an offset value reference added.- Specified by:
aggregateRowsWithReferencein interfaceIDictionary- Parameters:
fn- The aggregate functionreference- The reference offset to each value in the dictionary- Returns:
- Aggregates for this dictionary tuples.
-
aggregateCols
public void aggregateCols(double[] c, Builtin fn, IColIndex colIndexes)Description copied from interface:IDictionaryAggregates the columns into the target double array provided.- Specified by:
aggregateColsin interfaceIDictionary- Parameters:
c- The target double array, this contains the full number of columns, therefore the colIndexes for this specific dictionary is needed.fn- The function to apply to individual columnscolIndexes- The mapping to the target columns from the individual columns
-
aggregateColsWithReference
public void aggregateColsWithReference(double[] c, Builtin fn, IColIndex colIndexes, double[] reference, boolean def)Description copied from interface:IDictionaryAggregates the columns into the target double array provided.- Specified by:
aggregateColsWithReferencein interfaceIDictionary- Parameters:
c- The target double array, this contains the full number of columns, therefore the colIndexes for this specific dictionary is needed.fn- The function to apply to individual columnscolIndexes- The mapping to the target columns from the individual columnsreference- The reference offset values to add to each cell.def- If the reference should be treated as a tuple as well
-
applyScalarOp
public IDictionary applyScalarOp(ScalarOperator op)
Description copied from interface:IDictionaryAllocate a new dictionary and applies the scalar operation on each cell of to then return the new dictionary.- Specified by:
applyScalarOpin interfaceIDictionary- Parameters:
op- The operator.- Returns:
- The new dictionary to return.
-
applyScalarOpAndAppend
public IDictionary applyScalarOpAndAppend(ScalarOperator op, double v0, int nCol)
Description copied from interface:IDictionaryAllocate a new dictionary with one extra row and applies the scalar operation on each cell of to then return the new dictionary.- Specified by:
applyScalarOpAndAppendin interfaceIDictionary- Parameters:
op- The operatorv0- The new value to put into each cell in the new rownCol- The number of columns in the dictionary- Returns:
- The new dictionary to return.
-
applyUnaryOp
public IDictionary applyUnaryOp(UnaryOperator op)
Description copied from interface:IDictionaryAllocate a new dictionary and apply the unary operator on each cell.- Specified by:
applyUnaryOpin interfaceIDictionary- Parameters:
op- The operator.- Returns:
- The new dictionary to return.
-
applyUnaryOpAndAppend
public IDictionary applyUnaryOpAndAppend(UnaryOperator op, double v0, int nCol)
Description copied from interface:IDictionaryAllocate a new dictionary with one extra row and apply the unary operator on each cell.- Specified by:
applyUnaryOpAndAppendin interfaceIDictionary- Parameters:
op- The operator.v0- The new value to put into each cell in the new rownCol- The number of columns in the dictionary- Returns:
- The new dictionary to return.
-
applyScalarOpWithReference
public IDictionary applyScalarOpWithReference(ScalarOperator op, double[] reference, double[] newReference)
Description copied from interface:IDictionaryAllocate a new dictionary and apply the scalar operation on each cell to then return a new dictionary. outValues[j] = op(this.values[j] + reference[i]) - newReference[i]- Specified by:
applyScalarOpWithReferencein interfaceIDictionary- Parameters:
op- The operator to apply to each cell.reference- The reference value to add before the operator.newReference- The reference value to subtract after the operator.- Returns:
- A New Dictionary.
-
applyUnaryOpWithReference
public IDictionary applyUnaryOpWithReference(UnaryOperator op, double[] reference, double[] newReference)
Description copied from interface:IDictionaryAllocate a new dictionary and apply the scalar operation on each cell to then return a new dictionary. outValues[j] = op(this.values[j] + reference[i]) - newReference[i]- Specified by:
applyUnaryOpWithReferencein interfaceIDictionary- Parameters:
op- The unary operator to apply to each cell.reference- The reference value to add before the operator.newReference- The reference value to subtract after the operator.- Returns:
- A New Dictionary.
-
binOpLeft
public IDictionary binOpLeft(BinaryOperator op, double[] v, IColIndex colIndexes)
Description copied from interface:IDictionaryApply binary row operation on the left side- Specified by:
binOpLeftin interfaceIDictionary- Parameters:
op- The operation to this dictionaryv- The values to use on the left hand side.colIndexes- The column indexes to consider inside v.- Returns:
- A new dictionary containing the updated values.
-
binOpLeftAndAppend
public IDictionary binOpLeftAndAppend(BinaryOperator op, double[] v, IColIndex colIndexes)
Description copied from interface:IDictionaryApply binary row operation on the left side with one extra row evaluating with zeros.- Specified by:
binOpLeftAndAppendin interfaceIDictionary- Parameters:
op- The operation to this dictionaryv- The values to use on the left hand side.colIndexes- The column indexes to consider inside v.- Returns:
- A new dictionary containing the updated values.
-
binOpLeftWithReference
public IDictionary binOpLeftWithReference(BinaryOperator op, double[] v, IColIndex colIndexes, double[] reference, double[] newReference)
Description copied from interface:IDictionaryApply the binary operator such that each value is offset by the reference before application. Then put the result into the new dictionary, but offset it by the new reference. outValues[j] = op(v[colIndexes[i]], this.values[j] + reference[i]) - newReference[i]- Specified by:
binOpLeftWithReferencein interfaceIDictionary- Parameters:
op- The operation to apply on the dictionary values.v- The values to use on the left side of the operator.colIndexes- The column indexes to use.reference- The reference value to add before operator.newReference- The reference value to subtract after operator.- Returns:
- A new dictionary.
-
binOpRight
public IDictionary binOpRight(BinaryOperator op, double[] v, IColIndex colIndexes)
Description copied from interface:IDictionaryApply binary row operation on the right side.- Specified by:
binOpRightin interfaceIDictionary- Parameters:
op- The operation to this dictionaryv- The values to use on the right hand side.colIndexes- The column indexes to consider inside v.- Returns:
- A new dictionary containing the updated values.
-
binOpRightAndAppend
public IDictionary binOpRightAndAppend(BinaryOperator op, double[] v, IColIndex colIndexes)
Description copied from interface:IDictionaryApply binary row operation on the right side with one extra row evaluating with zeros.- Specified by:
binOpRightAndAppendin interfaceIDictionary- Parameters:
op- The operation to this dictionaryv- The values to use on the right hand side.colIndexes- The column indexes to consider inside v.- Returns:
- A new dictionary containing the updated values.
-
binOpRight
public IDictionary binOpRight(BinaryOperator op, double[] v)
Description copied from interface:IDictionaryApply binary row operation on the right side as with no columns to extract from v.- Specified by:
binOpRightin interfaceIDictionary- Parameters:
op- The operation to this dictionaryv- The values to apply on the dictionary (same number of cols as the dictionary)- Returns:
- A new dictionary containing the updated values.
-
binOpRightWithReference
public IDictionary binOpRightWithReference(BinaryOperator op, double[] v, IColIndex colIndexes, double[] reference, double[] newReference)
Description copied from interface:IDictionaryApply the binary operator such that each value is offset by the reference before application. Then put the result into the new dictionary, but offset it by the new reference. outValues[j] = op(this.values[j] + reference[i], v[colIndexes[i]]) - newReference[i]- Specified by:
binOpRightWithReferencein interfaceIDictionary- Parameters:
op- The operation to apply on the dictionary values.v- The values to use on the right side of the operator.colIndexes- The column indexes to use.reference- The reference value to add before operator.newReference- The reference value to subtract after operator.- Returns:
- A new dictionary.
-
write
public void write(DataOutput out) throws IOException
Description copied from interface:IDictionaryWrite the dictionary to a DataOutput.- Specified by:
writein interfaceIDictionary- Parameters:
out- the output sink to write the dictionary to.- Throws:
IOException- if the sink fails.
-
read
public static PlaceHolderDict read(DataInput in) throws IOException
- Throws:
IOException
-
getExactSizeOnDisk
public long getExactSizeOnDisk()
Description copied from interface:IDictionaryCalculate the space consumption if the dictionary is stored on disk.- Specified by:
getExactSizeOnDiskin interfaceIDictionary- Returns:
- the long count of bytes to store the dictionary.
-
getDictType
public IDictionary.DictType getDictType()
Description copied from interface:IDictionaryGet the dictionary type this dictionary is.- Specified by:
getDictTypein interfaceIDictionary- Returns:
- The Dictionary type this is.
-
getNumberOfValues
public int getNumberOfValues(int ncol)
Description copied from interface:IDictionaryGet the number of distinct tuples given that the column group has n columns- Specified by:
getNumberOfValuesin interfaceIDictionary- Parameters:
ncol- The number of Columns in the ColumnGroup.- Returns:
- the number of value tuples contained in the dictionary.
-
sumAllRowsToDouble
public double[] sumAllRowsToDouble(int nrColumns)
Description copied from interface:IDictionaryMethod used as a pre-aggregate of each tuple in the dictionary, to single double values. Note if the number of columns is one the actual dictionaries values are simply returned.- Specified by:
sumAllRowsToDoublein interfaceIDictionary- Parameters:
nrColumns- The number of columns in the ColGroup to know how to get the values from the dictionary.- Returns:
- a double array containing the row sums from this dictionary.
-
sumAllRowsToDoubleWithDefault
public double[] sumAllRowsToDoubleWithDefault(double[] defaultTuple)
Description copied from interface:IDictionaryDo exactly the same as the sumAllRowsToDouble but also sum the array given to a extra index in the end of the array.- Specified by:
sumAllRowsToDoubleWithDefaultin interfaceIDictionary- Parameters:
defaultTuple- The default row to sum in the end index returned.- Returns:
- a double array containing the row sums from this dictionary.
-
sumAllRowsToDoubleWithReference
public double[] sumAllRowsToDoubleWithReference(double[] reference)
Description copied from interface:IDictionaryMethod used as a pre-aggregate of each tuple in the dictionary, to single double values with a reference.- Specified by:
sumAllRowsToDoubleWithReferencein interfaceIDictionary- Parameters:
reference- The reference values to add to each cell.- Returns:
- a double array containing the row sums from this dictionary.
-
sumAllRowsToDoubleSq
public double[] sumAllRowsToDoubleSq(int nrColumns)
Description copied from interface:IDictionaryMethod used as a pre-aggregate of each tuple in the dictionary, to single double values. Note if the number of columns is one the actual dictionaries values are simply returned.- Specified by:
sumAllRowsToDoubleSqin interfaceIDictionary- Parameters:
nrColumns- The number of columns in the ColGroup to know how to get the values from the dictionary.- Returns:
- a double array containing the row sums from this dictionary.
-
sumAllRowsToDoubleSqWithDefault
public double[] sumAllRowsToDoubleSqWithDefault(double[] defaultTuple)
Description copied from interface:IDictionaryMethod used as a pre-aggregate of each tuple in the dictionary, to single double values. But adds another cell to the return with an extra value that is the sum of the given defaultTuple.- Specified by:
sumAllRowsToDoubleSqWithDefaultin interfaceIDictionary- Parameters:
defaultTuple- The default row to sum in the end index returned.- Returns:
- a double array containing the row sums from this dictionary.
-
sumAllRowsToDoubleSqWithReference
public double[] sumAllRowsToDoubleSqWithReference(double[] reference)
Description copied from interface:IDictionaryMethod used as a pre-aggregate of each tuple in the dictionary, to single double values.- Specified by:
sumAllRowsToDoubleSqWithReferencein interfaceIDictionary- Parameters:
reference- The reference values to add to each cell.- Returns:
- a double array containing the row sums from this dictionary.
-
productAllRowsToDouble
public double[] productAllRowsToDouble(int nrColumns)
Description copied from interface:IDictionaryMethod to product all rows to a column vector.- Specified by:
productAllRowsToDoublein interfaceIDictionary- Parameters:
nrColumns- 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- Parameters:
defaultTuple- The default row that aggregate to last cell- Returns:
- A row product
-
productAllRowsToDoubleWithReference
public double[] productAllRowsToDoubleWithReference(double[] reference)
Description copied from interface:IDictionaryMethod to product all rows to a column vector with a reference values added to all cells, and a reference product in the end- Specified by:
productAllRowsToDoubleWithReferencein interfaceIDictionary- Parameters:
reference- The reference row- Returns:
- A row product
-
colSum
public void colSum(double[] c, int[] counts, IColIndex colIndexes)Description copied from interface:IDictionaryGet the column sum of the values contained in the dictionary- Specified by:
colSumin interfaceIDictionary- Parameters:
c- The output array allocated to contain all column groups output.counts- The counts of the individual tuples.colIndexes- The columns indexes of the parent column group, this indicate where to put the column sum into the c output.
-
colSumSq
public void colSumSq(double[] c, int[] counts, IColIndex colIndexes)Description copied from interface:IDictionaryGet the column sum of the values contained in the dictionary- Specified by:
colSumSqin interfaceIDictionary- Parameters:
c- The output array allocated to contain all column groups output.counts- The counts of the individual tuples.colIndexes- The columns indexes of the parent column group, this indicate where to put the column sum into the c output.
-
colSumSqWithReference
public void colSumSqWithReference(double[] c, int[] counts, IColIndex colIndexes, double[] reference)Description copied from interface:IDictionaryGet the column sum of the values contained in the dictionary with an offset reference value added to each cell.- Specified by:
colSumSqWithReferencein interfaceIDictionary- Parameters:
c- The output array allocated to contain all column groups output.counts- The counts of the individual tuples.colIndexes- The columns indexes of the parent column group, this indicate where to put the column sum into the c output.reference- The reference values to add to each cell.
-
sum
public double sum(int[] counts, int nCol)Description copied from interface:IDictionaryGet the sum of the values contained in the dictionary- Specified by:
sumin interfaceIDictionary- Parameters:
counts- The counts of the individual tuplesnCol- The number of columns contained- Returns:
- The sum scaled by the counts provided.
-
sumSq
public double sumSq(int[] counts, int nCol)Description copied from interface:IDictionaryGet the square sum of the values contained in the dictionary- Specified by:
sumSqin interfaceIDictionary- Parameters:
counts- The counts of the individual tuplesnCol- The number of columns contained- Returns:
- The square sum scaled by the counts provided.
-
sumSqWithReference
public double sumSqWithReference(int[] counts, double[] reference)Description copied from interface:IDictionaryGet the square sum of the values contained in the dictionary with a reference offset on each value.- Specified by:
sumSqWithReferencein interfaceIDictionary- Parameters:
counts- The counts of the individual tuplesreference- The reference value- Returns:
- The square sum scaled by the counts and reference.
-
getString
public String getString(int colIndexes)
Description copied from interface:IDictionaryGet a string representation of the dictionary, that considers the layout of the data.- Specified by:
getStringin interfaceIDictionary- Parameters:
colIndexes- The number of columns in the dictionary.- Returns:
- A string that is nicer to print.
-
sliceOutColumnRange
public IDictionary sliceOutColumnRange(int idxStart, int idxEnd, int previousNumberOfColumns)
Description copied from interface:IDictionaryModify the dictionary by removing columns not within the index range.- Specified by:
sliceOutColumnRangein interfaceIDictionary- Parameters:
idxStart- The column index to start at.idxEnd- The column index to end at (not inclusive)previousNumberOfColumns- The number of columns contained in the dictionary.- Returns:
- A dictionary containing the sliced out columns values only.
-
containsValue
public boolean containsValue(double pattern)
Description copied from interface:IDictionaryDetect if the dictionary contains a specific value.- Specified by:
containsValuein interfaceIDictionary- Parameters:
pattern- The value to search for- Returns:
- true if the value is contained else false.
-
containsValueWithReference
public boolean containsValueWithReference(double pattern, double[] reference)Description copied from interface:IDictionaryDetect if the dictionary contains a specific value with reference offset.- Specified by:
containsValueWithReferencein interfaceIDictionary- Parameters:
pattern- The pattern/ value to search forreference- The reference double array.- Returns:
- true if the value is contained else false.
-
getNumberNonZeros
public long getNumberNonZeros(int[] counts, int nCol)Description copied from interface:IDictionaryCalculate the number of non zeros in the dictionary. The number of non zeros should be scaled with the counts given. This gives the exact number of non zero values in the parent column group.- Specified by:
getNumberNonZerosin interfaceIDictionary- Parameters:
counts- The counts of each dictionary entrynCol- The number of columns in this dictionary- Returns:
- The nonZero count
-
getNumberNonZerosWithReference
public long getNumberNonZerosWithReference(int[] counts, double[] reference, int nRows)Description copied from interface:IDictionaryCalculate the number of non zeros in the dictionary. Each value in the dictionary should be added to the reference value. The number of non zeros should be scaled with the given counts.- Specified by:
getNumberNonZerosWithReferencein interfaceIDictionary- Parameters:
counts- The Counts of each dict entry.reference- The reference vector.nRows- The number of rows in the input.- Returns:
- The NonZero Count.
-
addToEntry
public void addToEntry(double[] v, int fr, int to, int nCol)Description copied from interface:IDictionaryAdds the dictionary entry from this dictionary to the d dictionary- Specified by:
addToEntryin interfaceIDictionary- Parameters:
v- The target dictionary (dense double array)fr- The from index is the tuple index to copy from.to- The to index is the row index to copy into.nCol- The number of columns in both cases
-
addToEntry
public void addToEntry(double[] v, int fr, int to, int nCol, int rep)Description copied from interface:IDictionaryAdds the dictionary entry from this dictionary to the v dictionary rep times.- Specified by:
addToEntryin interfaceIDictionary- Parameters:
v- The target dictionary (dense double array)fr- The from index is the tuple index to copy from.to- The to index is the row index to copy into.nCol- The number of columns in both casesrep- The number of repetitions to apply (simply multiply do not loop)
-
addToEntryVectorized
public void addToEntryVectorized(double[] v, int f1, int f2, int f3, int f4, int f5, int f6, int f7, int f8, int t1, int t2, int t3, int t4, int t5, int t6, int t7, int t8, int nCol)Description copied from interface:IDictionaryVectorized add to entry, this call helps with a bit of locality for the cache.- Specified by:
addToEntryVectorizedin interfaceIDictionary- Parameters:
v- The target dictionary (dense double array)f1- From index 1f2- From index 2f3- From index 3f4- From index 4f5- From index 5f6- From index 6f7- From index 7f8- From index 8t1- To index 1t2- To index 2t3- To index 3t4- To index 4t5- To index 5t6- To index 6t7- To index 7t8- To index 8nCol- Number of columns in the dictionary
-
subtractTuple
public IDictionary subtractTuple(double[] tuple)
Description copied from interface:IDictionaryAllocate a new dictionary where the tuple given is subtracted from all tuples in the previous dictionary.- Specified by:
subtractTuplein interfaceIDictionary- Parameters:
tuple- a double list representing a tuple, it is given that the tuple with is the same as this dictionaries.- Returns:
- a new instance of dictionary with the tuple subtracted.
-
getMBDict
public MatrixBlockDictionary getMBDict(int nCol)
Description copied from interface:IDictionaryGet this dictionary as a MatrixBlock dictionary. This allows us to use optimized kernels coded elsewhere in the system, such as matrix multiplication. Return null if the matrix is empty.- Specified by:
getMBDictin interfaceIDictionary- Parameters:
nCol- The number of columns contained in this column group.- Returns:
- A Dictionary containing a MatrixBlock.
-
scaleTuples
public IDictionary scaleTuples(int[] scaling, int nCol)
Description copied from interface:IDictionaryScale all tuples contained in the dictionary by the scaling factor given in the int list.- Specified by:
scaleTuplesin interfaceIDictionary- Parameters:
scaling- The amount to multiply the given tuples withnCol- The number of columns contained in this column group.- Returns:
- A New dictionary (since we don't want to modify the underlying dictionary)
-
preaggValuesFromDense
public IDictionary preaggValuesFromDense(int numVals, IColIndex colIndexes, IColIndex aggregateColumns, double[] b, int cut)
Description copied from interface:IDictionaryPre Aggregate values for Right Matrix Multiplication.- Specified by:
preaggValuesFromDensein interfaceIDictionary- Parameters:
numVals- The number of values contained in this dictionarycolIndexes- The column indexes that is associated with the parent column groupaggregateColumns- The column to aggregate, this is preprocessed, to find remove consideration for empty columnsb- The values in the right hand side matrixcut- The number of columns in b.- Returns:
- A new dictionary with the pre aggregated values.
-
replace
public IDictionary replace(double pattern, double replace, int nCol)
Description copied from interface:IDictionaryMake a copy of the values, and replace all values that match pattern with replacement value. If needed add a new column index.- Specified by:
replacein interfaceIDictionary- Parameters:
pattern- The value to look forreplace- The value to replace the other value withnCol- The number of columns contained in the dictionary.- Returns:
- A new Column Group, reusing the index structure but with new values.
-
replaceWithReference
public IDictionary replaceWithReference(double pattern, double replace, double[] reference)
Description copied from interface:IDictionaryMake a copy of the values, and replace all values that match pattern with replacement value. If needed add a new column index. With reference such that each value in the dict is considered offset by the values contained in the reference.- Specified by:
replaceWithReferencein interfaceIDictionary- Parameters:
pattern- The value to look forreplace- The value to replace the other value withreference- The reference tuple to add to all entries when replacing- Returns:
- A new Column Group, reusing the index structure but with new values.
-
product
public void product(double[] ret, int[] counts, int nCol)Description copied from interface:IDictionaryCalculate the product of the dictionary weighted by counts.- Specified by:
productin interfaceIDictionary- Parameters:
ret- The result dense double array (containing one value)counts- The count of individual tuplesnCol- Number of columns in the dictionary.
-
productWithDefault
public void productWithDefault(double[] ret, int[] counts, double[] def, int defCount)Description copied from interface:IDictionaryCalculate the product of the dictionary weighted by counts with a default value added .- Specified by:
productWithDefaultin interfaceIDictionary- Parameters:
ret- The result dense double array (containing one value)counts- The count of individual tuplesdef- The default tupledefCount- The count of the default tuple
-
productWithReference
public void productWithReference(double[] ret, int[] counts, double[] reference, int refCount)Description copied from interface:IDictionaryCalculate the product of the dictionary weighted by counts and offset by reference- Specified by:
productWithReferencein interfaceIDictionary- Parameters:
ret- The result dense double array (containing one value)counts- The counts of each entry in the dictionaryreference- The reference value.refCount- The number of occurrences of the ref value.
-
colProduct
public void colProduct(double[] res, int[] counts, IColIndex colIndexes)Description copied from interface:IDictionaryCalculate the column product of the dictionary weighted by counts.- Specified by:
colProductin interfaceIDictionary- Parameters:
res- The result vector to put the result intocounts- The weighted count of individual tuplescolIndexes- The column indexes.
-
colProductWithReference
public void colProductWithReference(double[] res, int[] counts, IColIndex colIndexes, double[] reference)Description copied from interface:IDictionaryCalculate the column product of the dictionary weighted by counts.- Specified by:
colProductWithReferencein interfaceIDictionary- Parameters:
res- The result vector to put the result intocounts- The weighted count of individual tuplescolIndexes- The column indexes.reference- The reference value.
-
centralMoment
public CM_COV_Object centralMoment(ValueFunction fn, int[] counts, int nRows)
Description copied from interface:IDictionaryCentral moment function to calculate the central moment of this column group. MUST be on a single column dictionary.- Specified by:
centralMomentin interfaceIDictionary- Parameters:
fn- The value function to applycounts- The weight of individual tuplesnRows- The number of rows in total of the column group- Returns:
- The central moment Object
-
centralMoment
public CM_COV_Object centralMoment(CM_COV_Object ret, ValueFunction fn, int[] counts, int nRows)
Description copied from interface:IDictionaryCentral moment function to calculate the central moment of this column group. MUST be on a single column dictionary.- Specified by:
centralMomentin interfaceIDictionary- Parameters:
ret- The Central Moment object to be modified and returnedfn- The value function to applycounts- The weight of individual tuplesnRows- The number of rows in total of the column group- Returns:
- The central moment Object
-
centralMomentWithDefault
public CM_COV_Object centralMomentWithDefault(ValueFunction fn, int[] counts, double def, int nRows)
Description copied from interface:IDictionaryCentral moment function to calculate the central moment of this column group with a default offset on all missing tuples. MUST be on a single column dictionary.- Specified by:
centralMomentWithDefaultin interfaceIDictionary- Parameters:
fn- The value function to applycounts- The weight of individual tuplesdef- The default values to offset the tuples withnRows- The number of rows in total of the column group- Returns:
- The central moment Object
-
centralMomentWithDefault
public CM_COV_Object centralMomentWithDefault(CM_COV_Object ret, ValueFunction fn, int[] counts, double def, int nRows)
Description copied from interface:IDictionaryCentral moment function to calculate the central moment of this column group with a default offset on all missing tuples. MUST be on a single column dictionary.- Specified by:
centralMomentWithDefaultin interfaceIDictionary- Parameters:
ret- The Central Moment object to be modified and returnedfn- The value function to applycounts- The weight of individual tuplesdef- The default values to offset the tuples withnRows- The number of rows in total of the column group- Returns:
- The central moment Object
-
centralMomentWithReference
public CM_COV_Object centralMomentWithReference(ValueFunction fn, int[] counts, double reference, int nRows)
Description copied from interface:IDictionaryCentral moment function to calculate the central moment of this column group with a reference offset on each tuple. MUST be on a single column dictionary.- Specified by:
centralMomentWithReferencein interfaceIDictionary- Parameters:
fn- The value function to applycounts- The weight of individual tuplesreference- The reference values to offset the tuples withnRows- The number of rows in total of the column group- Returns:
- The central moment Object
-
centralMomentWithReference
public CM_COV_Object centralMomentWithReference(CM_COV_Object ret, ValueFunction fn, int[] counts, double reference, int nRows)
Description copied from interface:IDictionaryCentral moment function to calculate the central moment of this column group with a reference offset on each tuple. MUST be on a single column dictionary.- Specified by:
centralMomentWithReferencein interfaceIDictionary- Parameters:
ret- The Central Moment object to be modified and returnedfn- The value function to applycounts- The weight of individual tuplesreference- The reference values to offset the tuples withnRows- The number of rows in total of the column group- Returns:
- The central moment Object
-
rexpandCols
public IDictionary rexpandCols(int max, boolean ignore, boolean cast, int nCol)
Description copied from interface:IDictionaryRexpand the dictionary (one hot encode)- Specified by:
rexpandColsin interfaceIDictionary- Parameters:
max- the tuple width of the outputignore- If we should ignore zero and negative valuescast- If we should cast all double values to whole integer valuesnCol- The number of columns in the dictionary already (should be 1)- Returns:
- A new dictionary
-
rexpandColsWithReference
public IDictionary rexpandColsWithReference(int max, boolean ignore, boolean cast, int reference)
Description copied from interface:IDictionaryRexpand the dictionary (one hot encode)- Specified by:
rexpandColsWithReferencein interfaceIDictionary- Parameters:
max- the tuple width of the outputignore- If we should ignore zero and negative valuescast- If we should cast all double values to whole integer valuesreference- A reference value to add to all tuples before expanding- Returns:
- A new dictionary
-
getSparsity
public double getSparsity()
Description copied from interface:IDictionaryGet the sparsity of the dictionary.- Specified by:
getSparsityin interfaceIDictionary- Returns:
- a sparsity between 0 and 1
-
multiplyScalar
public void multiplyScalar(double v, double[] ret, int off, int dictIdx, IColIndex cols)Description copied from interface:IDictionaryMultiply the v value with the dictionary entry at dictIdx and add it to the ret matrix at the columns specified in the int array.- Specified by:
multiplyScalarin interfaceIDictionary- Parameters:
v- Value to multiplyret- Output dense double array locationoff- Offset into the ret array that the "row" output starts atdictIdx- The dictionary entry to multiply.cols- The columns to multiply into of the output.
-
TSMMWithScaling
public void TSMMWithScaling(int[] counts, IColIndex rows, IColIndex cols, MatrixBlock ret)Description copied from interface:IDictionaryTranspose self matrix multiplication with a scaling factor on each pair of values.- Specified by:
TSMMWithScalingin interfaceIDictionary- Parameters:
counts- The scaling factorrows- The row indexescols- The col indexesret- The output matrix block
-
MMDict
public void MMDict(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)
Description copied from interface:IDictionaryMatrix multiplication of dictionaries Note the left is this, and it is transposed- Specified by:
MMDictin interfaceIDictionary- Parameters:
right- Right hand side of multiplicationrowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix block
-
MMDictDense
public void MMDictDense(double[] left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Description copied from interface:IDictionaryMatrix multiplication of dictionaries left side dense and transposed right side is this.- Specified by:
MMDictDensein interfaceIDictionary- Parameters:
left- Dense left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix block
-
MMDictSparse
public void MMDictSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)
Description copied from interface:IDictionaryMatrix multiplication of dictionaries left side sparse and transposed right side is this.- Specified by:
MMDictSparsein interfaceIDictionary- Parameters:
left- Sparse left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix block
-
TSMMToUpperTriangle
public void TSMMToUpperTriangle(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)
Description copied from interface:IDictionaryMatrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is left- Specified by:
TSMMToUpperTrianglein interfaceIDictionary- Parameters:
right- Right siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix block
-
TSMMToUpperTriangleDense
public void TSMMToUpperTriangleDense(double[] left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)Description copied from interface:IDictionaryMatrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is right- Specified by:
TSMMToUpperTriangleDensein interfaceIDictionary- Parameters:
left- Dense left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix block
-
TSMMToUpperTriangleSparse
public void TSMMToUpperTriangleSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)
Description copied from interface:IDictionaryMatrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is right- Specified by:
TSMMToUpperTriangleSparsein interfaceIDictionary- Parameters:
left- Sparse left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix block
-
TSMMToUpperTriangleScaling
public void TSMMToUpperTriangleScaling(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)
Description copied from interface:IDictionaryMatrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is left- Specified by:
TSMMToUpperTriangleScalingin interfaceIDictionary- Parameters:
right- Right siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightscale- Scale factorresult- The output matrix block
-
TSMMToUpperTriangleDenseScaling
public void TSMMToUpperTriangleDenseScaling(double[] left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)Description copied from interface:IDictionaryMatrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is right- Specified by:
TSMMToUpperTriangleDenseScalingin interfaceIDictionary- Parameters:
left- Dense left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightscale- Scale factorresult- The output matrix block
-
TSMMToUpperTriangleSparseScaling
public void TSMMToUpperTriangleSparseScaling(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)
Description copied from interface:IDictionaryMatrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is right- Specified by:
TSMMToUpperTriangleSparseScalingin interfaceIDictionary- Parameters:
left- Sparse left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightscale- Scale factorresult- The output matrix block
-
cbind
public IDictionary cbind(IDictionary that, int nCol)
Description copied from interface:IDictionaryCbind this dictionary with that dictionary- Specified by:
cbindin interfaceIDictionary- Parameters:
that- the right hand side dictionary to cbindnCol- the right hand side number of columns- Returns:
- The combined dictionary
-
equals
public boolean equals(IDictionary o)
Description copied from interface:IDictionaryIndicate if the other dictionary is equal to this.- Specified by:
equalsin interfaceIDictionary- Parameters:
o- The other object- Returns:
- If it is equal
-
equals
public final boolean equals(double[] v)
Description copied from interface:IDictionaryIndicate if this object is equal to the given array of doubles.- Specified by:
equalsin interfaceIDictionary- Parameters:
v- The list of double values- Returns:
- If they are equal to this.
-
reorder
public IDictionary reorder(int[] reorder)
Description copied from interface:IDictionaryReorder the elements in the dictionary based on the reorder specification given.- Specified by:
reorderin interfaceIDictionary- Parameters:
reorder- The order to move to.- Returns:
- A new Dictionary that is reordered.s
-
clone
public IDictionary clone()
Description copied from interface:IDictionaryReturns a deep clone of the dictionary.- Specified by:
clonein interfaceIDictionary- Returns:
- A deep clone
-
MMDictScaling
public void MMDictScaling(IDictionary right, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)
Description copied from interface:IDictionaryMatrix multiplication of dictionaries Note the left is this, and it is transposed- Specified by:
MMDictScalingin interfaceIDictionary- Parameters:
right- Right hand side of multiplicationrowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix blockscaling- The scaling
-
MMDictScalingDense
public void MMDictScalingDense(double[] left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)Description copied from interface:IDictionaryMatrix multiplication of dictionaries left side dense and transposed right side is this.- Specified by:
MMDictScalingDensein interfaceIDictionary- Parameters:
left- Dense left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix blockscaling- The scaling
-
MMDictScalingSparse
public void MMDictScalingSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)
Description copied from interface:IDictionaryMatrix multiplication of dictionaries left side sparse and transposed right side is this.- Specified by:
MMDictScalingSparsein interfaceIDictionary- Parameters:
left- Sparse left siderowsLeft- Offset rows on the leftcolsRight- Offset cols on the rightresult- The output matrix blockscaling- The scaling
-
-