Package org.apache.sysds.runtime.compress.colgroup

## Interface ColGroupUtils

    public interface ColGroupUtils

### Method Summary

Static Methods
`static void` `addMatrixToResult​(MatrixBlock tmp, MatrixBlock result, IColIndex colIndexes, int rl, int ru)`
`static boolean` `allZero​(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 empty
`static 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 v
`static boolean` `containsInfOrNan​(double pattern, double[] reference)`
`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)
`static double[]` `createReference​(int nCol, double val)`
`static double[]` `extractMostCommonValueInColumns​(MatrixBlock mb)`
`static void` `outerProduct​(double[] leftRowSum, double[] rightColumnSum, double[] result, int rl, int ru)`
`static void` `outerProduct​(double[] leftRowSum, double[] rightColumnSum, IColIndex colIdxRight, double[] result, int nColR, int rl, int ru)`
`static void` `outerProduct​(double[] leftRowSum, SparseBlock rightColSum, IColIndex colIdxRight, double[] result, int nColR, int rl, int ru)`
`static double` `refSum​(double[] reference)`
`static double` `refSumSq​(double[] reference)`
`static double[]` `unaryOperator​(UnaryOperator op, double[] reference)`

### Method Detail

#### binaryDefRowLeft

    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 empty

Parameters:
  `op` - The operator
  `v` - The values to use on the left side of the operator
  `colIndexes` - The column indexes to extract
Returns:
  The result as a double array.

#### binaryDefRowRight

    static 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 v

Parameters:
  `op` - The operator
  `v` - The values to use on the left side of the operator
  `colIndexes` - 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 ColumnGroup
  `rhs` - Right ColumnGroup
  `tmpResult` - The matrix block to move values from
  `result` - The result matrix block to move values to

#### extractMostCommonValueInColumns

    static double[] extractMostCommonValueInColumns​(MatrixBlock mb)

#### 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

    static double[] unaryOperator​(UnaryOperator op,
                                  double[] reference)

#### 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)