@@ -0,0 +1,2086 @@
+package org.ojalgo.matrix;%0A%0Aimport static org.ojalgo.function.aggregator.Aggregator.*;%0A%0Aimport org.junit.jupiter.api.Test;%0Aimport org.ojalgo.TestUtils;%0Aimport org.ojalgo.matrix.BasicMatrix.Builder;%0A%0Apublic class ReductionTest %7B%0A%0A    public ReductionTest() %7B%0A        super();%0A    %7D%0A%0A    /**%0A     * https://stackoverflow.com/questions/49682219/how-to-get-average-of-elements-along-columns-or-rows-in-an-ojalgo-matrix%0A     * %3Cbr%3E%0A     * https://github.com/optimatika/ojAlgo/issues/91#issuecomment-379399975%0A     */%0A    @Test%0A    public void testReduction() %7B%0A%0A        Builder%3CPrimitiveMatrix%3E builder = PrimitiveMatrix.FACTORY.getBuilder(2, 3);%0A        builder.set(0, 0, 1.0);%0A        builder.set(0, 1, 2.0);%0A        builder.set(0, 2, 3.0);%0A        builder.set(1, 0, 4.0);%0A        builder.set(1, 1, 5.0);%0A        builder.set(1, 2, 6.0);%0A        PrimitiveMatrix matrix = builder.get();%0A%0A        PrimitiveMatrix reducedRows = matrix.reduceRows(AVERAGE);%0A        PrimitiveMatrix reducedColumns = matrix.reduceColumns(AVERAGE);%0A%0A        TestUtils.assertEquals(2, reducedRows.count());%0A        TestUtils.assertEquals(2, reducedRows.countRows());%0A        TestUtils.assertEquals(1, reducedRows.countColumns());%0A%0A        TestUtils.assertEquals(2.0, reducedRows.doubleValue(0, 0));%0A        TestUtils.assertEquals(5.0, reducedRows.doubleValue(1, 0));%0A%0A        TestUtils.assertEquals(2.0, reducedRows.doubleValue(0));%0A        TestUtils.assertEquals(5.0, reducedRows.doubleValue(1));%0A%0A        TestUtils.assertEquals(3, reducedColumns.count());%0A        TestUtils.assertEquals(1, reducedColumns.countRows());%0A        TestUtils.assertEquals(3, reducedColumns.countColumns());%0A%0A        TestUtils.assertEquals(2.5, reducedColumns.doubleValue(0, 0));%0A        TestUtils.assertEquals(3.5, reducedColumns.doubleValue(0, 1));%0A        TestUtils.assertEquals(4.5, reducedColumns.doubleValue(0, 2));%0A%0A        TestUtils.assertEquals(2.5, reducedColumns.doubleValue(0));%0A        TestUtils.assertEquals(3.5, reducedColumns.doubleValue(1));%0A        TestUtils.assertEquals(4.5, reducedColumns.doubleValue(2));%0A    %7D%0A%0A%7D%0A

Add test case for the original example