From 1f36ce7b31a27b758eef797a63c0571dcb78b338 Mon Sep 17 00:00:00 2001 From: stefan-zobel Date: Sat, 9 Mar 2024 01:55:41 +0100 Subject: [PATCH] Bugfix --- pom.xml | 2 +- src/main/java/net/jamu/matrix/Matrices.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 94601ea..247d85c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ net.sourceforge.streamsupport jamu jar - 1.4.2 + 1.4.3-SNAPSHOT JAMU Java Matrix Utilities built on top of Intel MKL https://github.com/stefan-zobel/JAMU/ diff --git a/src/main/java/net/jamu/matrix/Matrices.java b/src/main/java/net/jamu/matrix/Matrices.java index 8fe9a75..abba85e 100644 --- a/src/main/java/net/jamu/matrix/Matrices.java +++ b/src/main/java/net/jamu/matrix/Matrices.java @@ -3510,7 +3510,7 @@ public static ComplexMatrixF sumRows(ComplexMatrixF A) { * @since 1.4.2 */ public static MatrixD rowsAverage(MatrixD A) { - return sumRows(A).scaleInplace(A.numRows()); + return sumRows(A).scaleInplace(1.0 / A.numRows()); } /** @@ -3524,7 +3524,7 @@ public static MatrixD rowsAverage(MatrixD A) { * @since 1.4.2 */ public static MatrixF rowsAverage(MatrixF A) { - return sumRows(A).scaleInplace(A.numRows()); + return sumRows(A).scaleInplace(1.0f / A.numRows()); } /** @@ -3656,7 +3656,7 @@ public static ComplexMatrixF sumColumns(ComplexMatrixF A) { * @since 1.4.2 */ public static MatrixD colsAverage(MatrixD A) { - return sumColumns(A).scaleInplace(A.numColumns()); + return sumColumns(A).scaleInplace(1.0 / A.numColumns()); } /** @@ -3670,7 +3670,7 @@ public static MatrixD colsAverage(MatrixD A) { * @since 1.4.2 */ public static MatrixF colsAverage(MatrixF A) { - return sumColumns(A).scaleInplace(A.numColumns()); + return sumColumns(A).scaleInplace(1.0f / A.numColumns()); } private static boolean checkApproxEqualArgs(MatrixDimensions A, MatrixDimensions B, double relTol, double absTol) {