Interface ColGroupUtils


public interface ColGroupUtils
  • Field Details

    • LOG

      static final org.apache.commons.logging.Log LOG
  • Method Details

    • 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)
    • reorderDefault

      static double[] reorderDefault(double[] vals, int[] reordering)
    • getSortedSelection

      static ColGroupUtils.P[] getSortedSelection(SparseBlock sb, int rl, int ru)
      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 from
      rl - row to start from
      ru - row to end at
      Returns:
      The coordinates that contain values.