From 416c77d0f24f899e213e870b0b3e507a98e84ec6 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:14:26 +0100 Subject: [PATCH] fixed files form Math #3 --- projects/Math/3/org/apache/commons/math3/util/MathArrays.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/Math/3/org/apache/commons/math3/util/MathArrays.java b/projects/Math/3/org/apache/commons/math3/util/MathArrays.java index 325fd94..8f83d96 100644 --- a/projects/Math/3/org/apache/commons/math3/util/MathArrays.java +++ b/projects/Math/3/org/apache/commons/math3/util/MathArrays.java @@ -818,7 +818,10 @@ public static double linearCombination(final double[] a, final double[] b) throw new DimensionMismatchException(len, b.length); } + if (len == 1) { // Revert to scalar multiplication. + return a[0] * b[0]; + } final double[] prodHigh = new double[len]; double prodLowSum = 0;