test_class.file: core/src/test/java/org/carrot2/math/matrix/MatrixUtilsTest.java
test_class.identifier: MatrixUtilsTest
test_class.superclass: extends TestBase
test_case.body: @Test
    public void testSparseNormalizeColumnsL2Zeros() {
      /** A matrix with unnormalized columns */
      DoubleMatrix2D unnormalisedColumns = zeroColumnMatrix();
      MatrixUtils.normalizeSparseColumnL2(unnormalisedColumns, null);
  
      checkL2Normalization(unnormalisedColumns);
    }
test_case.class_method_signature: MatrixUtilsTest.testSparseNormalizeColumnsL2Zeros()
test_case.full_signature: @Test public void testSparseNormalizeColumnsL2Zeros()
test_case.identifier: testSparseNormalizeColumnsL2Zeros
test_case.invocations: zeroColumnMatrix normalizeSparseColumnL2 checkL2Normalization
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSparseNormalizeColumnsL2Zeros()
focal_class.file: core/src/main/java/org/carrot2/math/matrix/MatrixUtils.java
focal_class.identifier: MatrixUtils
focal_class.class_method_signature: MatrixUtils.normalizeColumnL2(DoubleMatrix2D A, double[] work)
focal_class.full_signature: public static DoubleMatrix2D normalizeColumnL2(DoubleMatrix2D A, double[] work)
focal_class.identifier: normalizeColumnL2
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A, double[] work)
focal_class.return: DoubleMatrix2D
focal_class.signature: DoubleMatrix2D normalizeColumnL2(DoubleMatrix2D A, double[] work)
focal_class.class_method_signature: MatrixUtils.normalizeSparseColumnL2(
        final DoubleMatrix2D A, final double[] work)
focal_class.full_signature: public static DoubleMatrix2D normalizeSparseColumnL2(
        final DoubleMatrix2D A, final double[] work)
focal_class.identifier: normalizeSparseColumnL2
focal_class.modifiers: public static
focal_class.parameters: (
        final DoubleMatrix2D A, final double[] work)
focal_class.return: DoubleMatrix2D
focal_class.signature: DoubleMatrix2D normalizeSparseColumnL2(
        final DoubleMatrix2D A, final double[] work)
focal_class.class_method_signature: MatrixUtils.normalizeColumnL1(DoubleMatrix2D A, double[] work)
focal_class.full_signature: public static DoubleMatrix2D normalizeColumnL1(DoubleMatrix2D A, double[] work)
focal_class.identifier: normalizeColumnL1
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A, double[] work)
focal_class.return: DoubleMatrix2D
focal_class.signature: DoubleMatrix2D normalizeColumnL1(DoubleMatrix2D A, double[] work)
focal_class.class_method_signature: MatrixUtils.prepareWork(DoubleMatrix2D A, double[] work)
focal_class.full_signature: private static double[] prepareWork(DoubleMatrix2D A, double[] work)
focal_class.identifier: prepareWork
focal_class.modifiers: private static
focal_class.parameters: (DoubleMatrix2D A, double[] work)
focal_class.return: double[]
focal_class.signature: double[] prepareWork(DoubleMatrix2D A, double[] work)
focal_class.class_method_signature: MatrixUtils.normalizeColumns(DoubleMatrix2D A, double[] work)
focal_class.full_signature: private static void normalizeColumns(DoubleMatrix2D A, double[] work)
focal_class.identifier: normalizeColumns
focal_class.modifiers: private static
focal_class.parameters: (DoubleMatrix2D A, double[] work)
focal_class.return: void
focal_class.signature: void normalizeColumns(DoubleMatrix2D A, double[] work)
focal_class.class_method_signature: MatrixUtils.computeOrthogonality(DoubleMatrix2D A)
focal_class.full_signature: public static double computeOrthogonality(DoubleMatrix2D A)
focal_class.identifier: computeOrthogonality
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A)
focal_class.return: double
focal_class.signature: double computeOrthogonality(DoubleMatrix2D A)
focal_class.class_method_signature: MatrixUtils.computeSparseness(DoubleMatrix2D A)
focal_class.full_signature: public static double computeSparseness(DoubleMatrix2D A)
focal_class.identifier: computeSparseness
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A)
focal_class.return: double
focal_class.signature: double computeSparseness(DoubleMatrix2D A)
focal_class.class_method_signature: MatrixUtils.minInColumns(DoubleMatrix2D A, int[] indices, double[] minValues)
focal_class.full_signature: public static int[] minInColumns(DoubleMatrix2D A, int[] indices, double[] minValues)
focal_class.identifier: minInColumns
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A, int[] indices, double[] minValues)
focal_class.return: int[]
focal_class.signature: int[] minInColumns(DoubleMatrix2D A, int[] indices, double[] minValues)
focal_class.class_method_signature: MatrixUtils.maxInColumns(DoubleMatrix2D A, int[] indices, double[] maxValues)
focal_class.full_signature: public static int[] maxInColumns(DoubleMatrix2D A, int[] indices, double[] maxValues)
focal_class.identifier: maxInColumns
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A, int[] indices, double[] maxValues)
focal_class.return: int[]
focal_class.signature: int[] maxInColumns(DoubleMatrix2D A, int[] indices, double[] maxValues)
focal_class.class_method_signature: MatrixUtils.maxInColumns(
        DoubleMatrix2D A, int[] indices, double[] maxValues, DoubleFunction transform)
focal_class.full_signature: public static int[] maxInColumns(
        DoubleMatrix2D A, int[] indices, double[] maxValues, DoubleFunction transform)
focal_class.identifier: maxInColumns
focal_class.modifiers: public static
focal_class.parameters: (
        DoubleMatrix2D A, int[] indices, double[] maxValues, DoubleFunction transform)
focal_class.return: int[]
focal_class.signature: int[] maxInColumns(
        DoubleMatrix2D A, int[] indices, double[] maxValues, DoubleFunction transform)
focal_class.class_method_signature: MatrixUtils.inColumns(
        DoubleMatrix2D A,
        int[] indices,
        double[] extValues,
        DoubleComparator doubleComparator,
        DoubleFunction transform)
focal_class.full_signature: private static int[] inColumns(
        DoubleMatrix2D A,
        int[] indices,
        double[] extValues,
        DoubleComparator doubleComparator,
        DoubleFunction transform)
focal_class.identifier: inColumns
focal_class.modifiers: private static
focal_class.parameters: (
        DoubleMatrix2D A,
        int[] indices,
        double[] extValues,
        DoubleComparator doubleComparator,
        DoubleFunction transform)
focal_class.return: int[]
focal_class.signature: int[] inColumns(
        DoubleMatrix2D A,
        int[] indices,
        double[] extValues,
        DoubleComparator doubleComparator,
        DoubleFunction transform)
focal_class.class_method_signature: MatrixUtils.maxInRow(DoubleMatrix2D A, int row)
focal_class.full_signature: public static int maxInRow(DoubleMatrix2D A, int row)
focal_class.identifier: maxInRow
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A, int row)
focal_class.return: int
focal_class.signature: int maxInRow(DoubleMatrix2D A, int row)
focal_class.class_method_signature: MatrixUtils.sumRows(DoubleMatrix2D A, double[] sums)
focal_class.full_signature: public static double[] sumRows(DoubleMatrix2D A, double[] sums)
focal_class.identifier: sumRows
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D A, double[] sums)
focal_class.return: double[]
focal_class.signature: double[] sumRows(DoubleMatrix2D A, double[] sums)
focal_class.class_method_signature: MatrixUtils.frobeniusNorm(DoubleMatrix2D matrix)
focal_class.full_signature: public static double frobeniusNorm(DoubleMatrix2D matrix)
focal_class.identifier: frobeniusNorm
focal_class.modifiers: public static
focal_class.parameters: (DoubleMatrix2D matrix)
focal_class.return: double
focal_class.signature: double frobeniusNorm(DoubleMatrix2D matrix)
focal_class.class_method_signature: MatrixUtils.sortedRowsView(
        DoubleMatrix2D matrix, IndirectComparator comparator)
focal_class.full_signature: public static DoubleMatrix2D sortedRowsView(
        DoubleMatrix2D matrix, IndirectComparator comparator)
focal_class.identifier: sortedRowsView
focal_class.modifiers: public static
focal_class.parameters: (
        DoubleMatrix2D matrix, IndirectComparator comparator)
focal_class.return: DoubleMatrix2D
focal_class.signature: DoubleMatrix2D sortedRowsView(
        DoubleMatrix2D matrix, IndirectComparator comparator)
focal_method.body: public static DoubleMatrix2D normalizeSparseColumnL2(
        final DoubleMatrix2D A, final double[] work) {
      final double[] w = prepareWork(A, work);
  
      A.forEachNonZero(
          new IntIntDoubleFunction() {
            @Override
            public double apply(int row, int column, double value) {
              w[column] += value * value;
              return value;
            }
          });
  
      // Take the square root
      for (int c = 0; c < A.columns(); c++) {
        w[c] = Math.sqrt(w[c]);
      }
  
      // Normalize
      A.forEachNonZero(
          new IntIntDoubleFunction() {
            @Override
            public double apply(int row, int column, double value) {
              A.setQuick(row, column, value / w[column]);
              return 0;
            }
          });
  
      return A;
    }
focal_method.class_method_signature: MatrixUtils.normalizeSparseColumnL2(
        final DoubleMatrix2D A, final double[] work)
focal_method.full_signature: public static DoubleMatrix2D normalizeSparseColumnL2(
        final DoubleMatrix2D A, final double[] work)
focal_method.identifier: normalizeSparseColumnL2
focal_method.invocations: prepareWork forEachNonZero columns sqrt forEachNonZero setQuick
focal_method.modifiers: public static
focal_method.parameters: (
        final DoubleMatrix2D A, final double[] work)
focal_method.return: DoubleMatrix2D
focal_method.signature: DoubleMatrix2D normalizeSparseColumnL2(
        final DoubleMatrix2D A, final double[] work)