public double[] sumRows() {
        int nRows = getRowDimension();
        int nCols = getColumnDimension();
        double data[][] = getDataRef();

        double[] result = new double[nRows];

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

        return result;
    }