From b69aec0dffd0208f479b8d501a2ee61ffbd3a5ee Mon Sep 17 00:00:00 2001 From: aherbert Date: Thu, 13 Oct 2022 13:59:27 +0100 Subject: [PATCH] Remove use of deprecated class --- .../math4/legacy/analysis/differentiation/DSCompiler.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java index 0094503ec..de9ab7690 100644 --- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java +++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/differentiation/DSCompiler.java @@ -27,7 +27,7 @@ import org.apache.commons.math4.legacy.exception.MathArithmeticException; import org.apache.commons.math4.legacy.exception.MathInternalError; import org.apache.commons.math4.legacy.exception.NotPositiveException; import org.apache.commons.math4.legacy.exception.NumberIsTooLargeException; -import org.apache.commons.numbers.combinatorics.FactorialDouble; +import org.apache.commons.numbers.combinatorics.Factorial; import org.apache.commons.math4.core.jdkmath.JdkMath; /** Class holding "compiled" computation rules for derivative structures. @@ -123,9 +123,6 @@ import org.apache.commons.math4.core.jdkmath.JdkMath; * @since 3.1 */ public final class DSCompiler { - /** Cache for factorials. */ - private static final FactorialDouble FACTORIAL = FactorialDouble.create().withCache(30); - /** Array of all compilers created so far. */ private static AtomicReference compilers = new AtomicReference<>(null); @@ -1759,7 +1756,7 @@ public final class DSCompiler { for (int k = 0; k < orders.length; ++k) { if (orders[k] > 0) { try { - term *= JdkMath.pow(delta[k], orders[k]) / FACTORIAL.value(orders[k]); + term *= JdkMath.pow(delta[k], orders[k]) / Factorial.doubleValue(orders[k]); } catch (NotPositiveException e) { // this cannot happen throw new MathInternalError(e);