public double[] meanRows() {
        int nRows = getRowDimension();
        int nCols = getColumnDimension();
        double[] result = sumRows();

        for (int r = 0; r < nRows; r++) {
            result[r] = result[r] / nCols;
        }

        return result;
    }