class MatrixUtils {

  public static DoubleMatrix2D normalizeColumnL1(DoubleMatrix2D A, double[] work) {
    work = prepareWork(A, work);

    // Calculate the L1 norm for each column
    for (int r = 0; r < A.rows(); r++) {
      for (int c = 0; c < A.columns(); c++) {
        work[c] += A.getQuick(r, c);
      }
    }

    // Normalize
    normalizeColumns(A, work);

    return A;
  }

}