Interface ColGroupUtils
public interface ColGroupUtils
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic voidaddMatrixToResult(MatrixBlock tmp, MatrixBlock result, IColIndex colIndexes, int rl, int ru) static booleanallZero(double[] in) static double[]binaryDefRowLeft(BinaryOperator op, double[] v, IColIndex colIndexes) Calculate the result of performing the binary operation on an empty row to the left v op emptystatic double[]binaryDefRowRight(BinaryOperator op, double[] v, IColIndex colIndexes) Calculate the result of performing the binary operation on an empty row to the right empty op vstatic booleancontainsInfOrNan(double pattern, double[] reference) static voidcopyValuesColGroupMatrixBlocks(AColGroup lhs, AColGroup rhs, MatrixBlock tmpResult, MatrixBlock result) Copy values from tmpResult into correct positions of result (according to colIndexes in lhs and rhs)static double[]createReference(int nCol, double val) static double[]static ColGroupUtils.P[]getSortedSelection(SparseBlock sb, int rl, int ru) Get a list of points locations from the SparseBlock.static voidouterProduct(double[] leftRowSum, double[] rightColumnSum, double[] result, int rl, int ru) static voidouterProduct(double[] leftRowSum, double[] rightColumnSum, IColIndex colIdxRight, double[] result, int nColR, int rl, int ru) static voidouterProduct(double[] leftRowSum, SparseBlock rightColSum, IColIndex colIdxRight, double[] result, int nColR, int rl, int ru) static doublerefSum(double[] reference) static doublerefSumSq(double[] reference) static double[]reorderDefault(double[] vals, int[] reordering) static double[]unaryOperator(UnaryOperator op, double[] reference)
-
Field Details
-
LOG
static final org.apache.commons.logging.Log LOG
-
-
Method Details
-
binaryDefRowLeft
Calculate the result of performing the binary operation on an empty row to the left v op empty- Parameters:
op- The operatorv- The values to use on the left side of the operatorcolIndexes- The column indexes to extract- Returns:
- The result as a double array.
-
binaryDefRowRight
Calculate the result of performing the binary operation on an empty row to the right empty op v- Parameters:
op- The operatorv- The values to use on the left side of the operatorcolIndexes- The column indexes to extract- Returns:
- The result as a double array.
-
copyValuesColGroupMatrixBlocks
static void copyValuesColGroupMatrixBlocks(AColGroup lhs, AColGroup rhs, MatrixBlock tmpResult, MatrixBlock result) Copy values from tmpResult into correct positions of result (according to colIndexes in lhs and rhs)- Parameters:
lhs- Left ColumnGrouprhs- Right ColumnGrouptmpResult- The matrix block to move values fromresult- The result matrix block to move values to
-
extractMostCommonValueInColumns
-
refSum
static double refSum(double[] reference) -
refSumSq
static double refSumSq(double[] reference) -
allZero
static boolean allZero(double[] in) -
containsInfOrNan
static boolean containsInfOrNan(double pattern, double[] reference) -
createReference
static double[] createReference(int nCol, double val) -
unaryOperator
-
outerProduct
static void outerProduct(double[] leftRowSum, double[] rightColumnSum, double[] result, int rl, int ru) -
outerProduct
static void outerProduct(double[] leftRowSum, double[] rightColumnSum, IColIndex colIdxRight, double[] result, int nColR, int rl, int ru) -
outerProduct
static void outerProduct(double[] leftRowSum, SparseBlock rightColSum, IColIndex colIdxRight, double[] result, int nColR, int rl, int ru) -
addMatrixToResult
static void addMatrixToResult(MatrixBlock tmp, MatrixBlock result, IColIndex colIndexes, int rl, int ru) -
reorderDefault
static double[] reorderDefault(double[] vals, int[] reordering) -
getSortedSelection
Get a list of points locations from the SparseBlock. This is used to find 1 indexes in a sparse selection matrix. We assume the input only have one non zero per row, and that non zero is a 1.- Parameters:
sb- Sparse block to extract points fromrl- row to start fromru- row to end at- Returns:
- The coordinates that contain values.
-