You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2019/05/31 12:15:49 UTC
[commons-numbers] 01/04: [NUMBERS-108] - Cleaning up Checkstyle
reported issues
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
commit 9b7a1cb34645e041341efa03e96f2f29d62bb4f4
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Thu May 30 19:13:07 2019 +0200
[NUMBERS-108] - Cleaning up Checkstyle reported issues
---
.../apache/commons/numbers/arrays/CosAngle.java | 5 +++
.../numbers/combinatorics/BinomialCoefficient.java | 5 +++
.../combinatorics/BinomialCoefficientDouble.java | 5 +++
.../commons/numbers/combinatorics/Factorial.java | 5 +++
.../combinatorics/LogBinomialCoefficient.java | 5 +++
.../commons/numbers/core/ArithmeticUtils.java | 36 +++++++++++++---------
.../org/apache/commons/numbers/gamma/Digamma.java | 5 +++
.../java/org/apache/commons/numbers/gamma/Erf.java | 5 +++
.../commons/numbers/gamma/ErfDifference.java | 5 +++
.../org/apache/commons/numbers/gamma/Erfc.java | 5 +++
.../org/apache/commons/numbers/gamma/Gamma.java | 5 +++
.../apache/commons/numbers/gamma/InvGamma1pm1.java | 5 +++
.../apache/commons/numbers/gamma/InverseErf.java | 5 +++
.../apache/commons/numbers/gamma/InverseErfc.java | 5 +++
.../numbers/gamma/LanczosApproximation.java | 5 +++
.../org/apache/commons/numbers/gamma/LogBeta.java | 7 +++++
.../org/apache/commons/numbers/gamma/LogGamma.java | 5 +++
.../apache/commons/numbers/gamma/LogGamma1p.java | 5 +++
.../apache/commons/numbers/gamma/LogGammaSum.java | 5 +++
.../commons/numbers/gamma/RegularizedBeta.java | 5 +++
.../commons/numbers/gamma/RegularizedGamma.java | 5 +++
.../org/apache/commons/numbers/gamma/Trigamma.java | 5 +++
22 files changed, 129 insertions(+), 14 deletions(-)
diff --git a/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/CosAngle.java b/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/CosAngle.java
index 58e5f51..f20debf 100644
--- a/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/CosAngle.java
+++ b/commons-numbers-arrays/src/main/java/org/apache/commons/numbers/arrays/CosAngle.java
@@ -20,6 +20,11 @@ package org.apache.commons.numbers.arrays;
* Computes the cosine of the angle between two vectors.
*/
public class CosAngle {
+
+ private CosAngle() {
+ // intentionally empty.
+ }
+
/**
* Computes the cosine of the angle between {@code v1} and {@code v2}.
*
diff --git a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficient.java b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficient.java
index 6da5a7d..e44e01e 100644
--- a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficient.java
+++ b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficient.java
@@ -26,6 +26,11 @@ import org.apache.commons.numbers.core.ArithmeticUtils;
* can be selected from an {@code n}-element set.
*/
public class BinomialCoefficient {
+
+ private BinomialCoefficient() {
+ // intentionally empty.
+ }
+
/**
* Computes de binomial coefficient.
* The largest value of {@code n} for which all coefficients can
diff --git a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficientDouble.java b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficientDouble.java
index 609b13e..404a56e 100644
--- a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficientDouble.java
+++ b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/BinomialCoefficientDouble.java
@@ -24,6 +24,11 @@ package org.apache.commons.numbers.combinatorics;
* can be selected from an {@code n}-element set.
*/
public class BinomialCoefficientDouble {
+
+ private BinomialCoefficientDouble() {
+ // intentionally empty.
+ }
+
/**
* Computes de binomial coefficient.
* The largest value of {@code n} for which all coefficients can
diff --git a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Factorial.java b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Factorial.java
index 714830e..78d2983 100644
--- a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Factorial.java
+++ b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/Factorial.java
@@ -21,6 +21,11 @@ package org.apache.commons.numbers.combinatorics;
* <a href="http://mathworld.wolfram.com/Factorial.html">Factorial of a number</a>.
*/
public class Factorial {
+
+ private Factorial() {
+ // intentionally empty.
+ }
+
/** All long-representable factorials */
static final long[] FACTORIALS = new long[] {
1L, 1L, 2L,
diff --git a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/LogBinomialCoefficient.java b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/LogBinomialCoefficient.java
index d943fae..993c577 100644
--- a/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/LogBinomialCoefficient.java
+++ b/commons-numbers-combinatorics/src/main/java/org/apache/commons/numbers/combinatorics/LogBinomialCoefficient.java
@@ -24,6 +24,11 @@ package org.apache.commons.numbers.combinatorics;
* can be selected from an {@code n}-element set.
*/
public class LogBinomialCoefficient {
+
+ private LogBinomialCoefficient() {
+ // intentionally empty.
+ }
+
/**
* Computes the logarithm of the binomial coefficient.
* The largest value of {@code n} for which all coefficients can
diff --git a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/ArithmeticUtils.java b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/ArithmeticUtils.java
index 36a84f5..aa1bb7b 100644
--- a/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/ArithmeticUtils.java
+++ b/commons-numbers-core/src/main/java/org/apache/commons/numbers/core/ArithmeticUtils.java
@@ -26,6 +26,14 @@ import java.text.MessageFormat;
*/
public final class ArithmeticUtils {
+ private static final String OVERFLOW_IN_ADDITION_MESSAGE = "overflow in addition: {0} + {1}";
+ private static final String OVERFLOW_GCD_MESSAGE_2_POWER_31 = "overflow: gcd({0}, {1}) is 2^31";
+ private static final String OVERFLOW_GCD_MESSAGE_2_POWER_63 = "overflow: gcd({0}, {1}) is 2^63";
+ private static final String OVERFLOW_IN_SUBTRACTION_MESSAGE = "overflow in subtraction: {0} + {1}";
+
+ private static final String NEGATIVE_EXPONENT_1 = "negative exponent ({";
+ private static final String NEGATIVE_EXPONENT_2 = "})";
+
/** Private constructor. */
private ArithmeticUtils() {
super();
@@ -43,7 +51,7 @@ public final class ArithmeticUtils {
public static int addAndCheck(int x, int y) {
long s = (long)x + (long)y;
if (s < Integer.MIN_VALUE || s > Integer.MAX_VALUE) {
- throw new NumbersArithmeticException("overflow in addition: {0} + {1}", x, y);
+ throw new NumbersArithmeticException(OVERFLOW_IN_ADDITION_MESSAGE, x, y);
}
return (int)s;
}
@@ -57,7 +65,7 @@ public final class ArithmeticUtils {
* @throws ArithmeticException if the result can not be represented as an long
*/
public static long addAndCheck(long a, long b) {
- return addAndCheck(a, b, "overflow in addition: {0} + {1}");
+ return addAndCheck(a, b, OVERFLOW_IN_ADDITION_MESSAGE);
}
/**
@@ -94,7 +102,7 @@ public final class ArithmeticUtils {
b == 0) {
if (a == Integer.MIN_VALUE ||
b == Integer.MIN_VALUE) {
- throw new NumbersArithmeticException("overflow: gcd({0}, {1}) is 2^31",
+ throw new NumbersArithmeticException(OVERFLOW_GCD_MESSAGE_2_POWER_31,
p, q);
}
return Math.abs(a + b);
@@ -121,7 +129,7 @@ public final class ArithmeticUtils {
}
if (useLong) {
if(al == bl) {
- throw new NumbersArithmeticException("overflow: gcd({0}, {1}) is 2^31",
+ throw new NumbersArithmeticException(OVERFLOW_GCD_MESSAGE_2_POWER_31,
p, q);
}
long blbu = bl;
@@ -129,7 +137,7 @@ public final class ArithmeticUtils {
al = blbu % al;
if (al == 0) {
if (bl > Integer.MAX_VALUE) {
- throw new NumbersArithmeticException("overflow: gcd({0}, {1}) is 2^31",
+ throw new NumbersArithmeticException(OVERFLOW_GCD_MESSAGE_2_POWER_31,
p, q);
}
return (int) bl;
@@ -231,7 +239,7 @@ public final class ArithmeticUtils {
long v = q;
if ((u == 0) || (v == 0)) {
if ((u == Long.MIN_VALUE) || (v == Long.MIN_VALUE)){
- throw new NumbersArithmeticException("overflow: gcd({0}, {1}) is 2^63",
+ throw new NumbersArithmeticException(OVERFLOW_GCD_MESSAGE_2_POWER_63,
p, q);
}
return Math.abs(u) + Math.abs(v);
@@ -256,7 +264,7 @@ public final class ArithmeticUtils {
k++; // cast out twos.
}
if (k == 63) {
- throw new NumbersArithmeticException("overflow: gcd({0}, {1}) is 2^63",
+ throw new NumbersArithmeticException(OVERFLOW_GCD_MESSAGE_2_POWER_63,
p, q);
}
// B2. Initialize: u and v have been divided by 2^k and at least
@@ -452,11 +460,11 @@ public final class ArithmeticUtils {
if (a < 0) {
ret = a - b;
} else {
- throw new NumbersArithmeticException("overflow in subtraction: {0} + {1}", a, -b);
+ throw new NumbersArithmeticException(OVERFLOW_IN_SUBTRACTION_MESSAGE, a, -b);
}
} else {
// use additive inverse
- ret = addAndCheck(a, -b, "overflow in subtraction: {0} + {1}");
+ ret = addAndCheck(a, -b, OVERFLOW_IN_SUBTRACTION_MESSAGE);
}
return ret;
}
@@ -473,7 +481,7 @@ public final class ArithmeticUtils {
public static int pow(final int k,
final int e) {
if (e < 0) {
- throw new IllegalArgumentException("negative exponent ({" + e + "})");
+ throw new IllegalArgumentException(NEGATIVE_EXPONENT_1 + e + NEGATIVE_EXPONENT_2);
}
int exp = e;
@@ -507,7 +515,7 @@ public final class ArithmeticUtils {
public static long pow(final long k,
final int e) {
if (e < 0) {
- throw new IllegalArgumentException("negative exponent ({" + e + "})");
+ throw new IllegalArgumentException(NEGATIVE_EXPONENT_1 + e + NEGATIVE_EXPONENT_2);
}
int exp = e;
@@ -539,7 +547,7 @@ public final class ArithmeticUtils {
*/
public static BigInteger pow(final BigInteger k, int e) {
if (e < 0) {
- throw new IllegalArgumentException("negative exponent ({" + e + "})");
+ throw new IllegalArgumentException(NEGATIVE_EXPONENT_1 + e + NEGATIVE_EXPONENT_2);
}
return k.pow(e);
@@ -555,7 +563,7 @@ public final class ArithmeticUtils {
*/
public static BigInteger pow(final BigInteger k, long e) {
if (e < 0) {
- throw new IllegalArgumentException("negative exponent ({" + e + "})");
+ throw new IllegalArgumentException(NEGATIVE_EXPONENT_1 + e + NEGATIVE_EXPONENT_2);
}
BigInteger result = BigInteger.ONE;
@@ -582,7 +590,7 @@ public final class ArithmeticUtils {
*/
public static BigInteger pow(final BigInteger k, BigInteger e) {
if (e.compareTo(BigInteger.ZERO) < 0) {
- throw new IllegalArgumentException("negative exponent ({" + e + "})");
+ throw new IllegalArgumentException(NEGATIVE_EXPONENT_1 + e + NEGATIVE_EXPONENT_2);
}
BigInteger result = BigInteger.ONE;
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Digamma.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Digamma.java
index 24d329e..f6867c1 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Digamma.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Digamma.java
@@ -27,6 +27,11 @@ package org.apache.commons.numbers.gamma;
* @see Gamma
*/
public class Digamma {
+
+ private Digamma() {
+ // intentional empty.
+ }
+
/** <a href="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant">Euler-Mascheroni constant</a>. */
private static final double GAMMA = 0.577215664901532860606512090082;
/** C limit. */
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erf.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erf.java
index 5bef7d8..2795398 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erf.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erf.java
@@ -20,6 +20,11 @@ package org.apache.commons.numbers.gamma;
* <a href="http://mathworld.wolfram.com/Erf.html">Error function</a>.
*/
public class Erf {
+
+ private Erf() {
+ // intenitonal empty.
+ }
+
/**
* <p>
* This implementation computes erf(x) using the
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/ErfDifference.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/ErfDifference.java
index 31e1f59..636dd49 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/ErfDifference.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/ErfDifference.java
@@ -20,6 +20,11 @@ package org.apache.commons.numbers.gamma;
* Computes the difference between {@link Erf error function values}.
*/
public class ErfDifference {
+
+ private ErfDifference() {
+ // intentionally empty.
+ }
+
/**
* This number solves {@code erf(x) = 0.5} within 1 ulp.
* More precisely, the current implementations of
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erfc.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erfc.java
index 6eea0f9..54e8550 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erfc.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Erfc.java
@@ -20,6 +20,11 @@ package org.apache.commons.numbers.gamma;
* <a href="http://mathworld.wolfram.com/Erfc.html">Complementary error function</a>.
*/
public class Erfc {
+
+ private Erfc() {
+ // intentionally empty.
+ }
+
/**
* <p>
* This implementation computes erfc(x) using the
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Gamma.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Gamma.java
index 3fbb838..dc26f28 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Gamma.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Gamma.java
@@ -31,6 +31,11 @@ package org.apache.commons.numbers.gamma;
* </p>
*/
public class Gamma {
+
+ private Gamma() {
+ // intentionally empty.
+ }
+
/** √(2π). */
private static final double SQRT_TWO_PI = 2.506628274631000502;
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InvGamma1pm1.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InvGamma1pm1.java
index ab1d77b..f936c7c 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InvGamma1pm1.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InvGamma1pm1.java
@@ -22,6 +22,11 @@ package org.apache.commons.numbers.gamma;
* Class is immutable.
*/
class InvGamma1pm1 {
+
+ private InvGamma1pm1() {
+ // intentionally empty.
+ }
+
/*
* Constants copied from DGAM1 in the NSWC library.
*/
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErf.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErf.java
index b149fa5..8295800 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErf.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErf.java
@@ -27,6 +27,11 @@ package org.apache.commons.numbers.gamma;
* </p>
*/
public class InverseErf {
+
+ private InverseErf() {
+ // intentionally empty.
+ }
+
/**
* Returns the inverse error function.
*
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErfc.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErfc.java
index e1a4359..92ff0ea 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErfc.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/InverseErfc.java
@@ -27,6 +27,11 @@ package org.apache.commons.numbers.gamma;
* </p>
*/
public class InverseErfc {
+
+ private InverseErfc() {
+ // intentional empty.
+ }
+
/**
* Returns the inverse complementary error function.
*
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LanczosApproximation.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LanczosApproximation.java
index e95c831..f2dc5ee 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LanczosApproximation.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LanczosApproximation.java
@@ -32,6 +32,11 @@ package org.apache.commons.numbers.gamma;
* of the convergent Lanczos complex Gamma approximation</a>.
*/
public class LanczosApproximation {
+
+ private LanczosApproximation() {
+ // intentional empty.
+ }
+
/** \( g = \frac{607}{128} \). */
private static final double LANCZOS_G = 607d / 128d;
/** Lanczos coefficients. */
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java
index a1fd6ac..11b2b27 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogBeta.java
@@ -23,6 +23,13 @@ package org.apache.commons.numbers.gamma;
* </p>
*/
public class LogBeta {
+
+ /** Private constructor. */
+ private LogBeta() {
+ // intentional empty.
+ }
+
+
/** The constant value of ½log 2π. */
private static final double HALF_LOG_TWO_PI = 0.9189385332046727;
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma.java
index f58a3bc..d50f06b 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma.java
@@ -22,6 +22,11 @@ package org.apache.commons.numbers.gamma;
* Class is immutable.
*/
public class LogGamma {
+
+ private LogGamma() {
+ // intentionally empty.
+ }
+
/** Lanczos constant. */
private static final double LANCZOS_G = 607d / 128d;
/** Performance. */
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma1p.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma1p.java
index 3a9753d..74b2935 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma1p.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGamma1p.java
@@ -22,6 +22,11 @@ package org.apache.commons.numbers.gamma;
* Class is immutable.
*/
class LogGamma1p {
+
+ private LogGamma1p() {
+ // intentionally empty
+ }
+
/**
* Computes the function \( \ln \Gamma(1 + x) \) for \( -0.5 \leq x \leq 1.5 \).
*
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGammaSum.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGammaSum.java
index 07405aa..5d957fd 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGammaSum.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/LogGammaSum.java
@@ -23,6 +23,11 @@ package org.apache.commons.numbers.gamma;
* </p>
*/
class LogGammaSum {
+
+ private LogGammaSum() {
+ // intentionally empty
+ }
+
/**
* Computes the value of log Γ(a + b) for 1 ≤ a, b ≤ 2.
* Based on the <em>NSWC Library of Mathematics Subroutines</em>
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedBeta.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedBeta.java
index f54effe..61f6218 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedBeta.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedBeta.java
@@ -26,6 +26,11 @@ import org.apache.commons.numbers.fraction.ContinuedFraction;
* </p>
*/
public class RegularizedBeta {
+
+ private RegularizedBeta() {
+ // intentionally empty.
+ }
+
/** Maximum allowed numerical error. */
private static final double DEFAULT_EPSILON = 1e-14;
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedGamma.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedGamma.java
index 1aae5f3..9fa1ad8 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedGamma.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/RegularizedGamma.java
@@ -25,6 +25,11 @@ import org.apache.commons.numbers.fraction.ContinuedFraction;
* Class is immutable.
*/
public class RegularizedGamma {
+
+ private RegularizedGamma() {
+ // intentionally empty.
+ }
+
/** Maximum allowed numerical error. */
private static final double DEFAULT_EPSILON = 1e-15;
diff --git a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Trigamma.java b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Trigamma.java
index 3c8242e..7ea4add 100644
--- a/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Trigamma.java
+++ b/commons-numbers-gamma/src/main/java/org/apache/commons/numbers/gamma/Trigamma.java
@@ -23,6 +23,11 @@ package org.apache.commons.numbers.gamma;
* \( \psi_1(x) = \frac{d^2}{dx^2} (\ln \Gamma(x)) \).
*/
public class Trigamma {
+
+ private Trigamma() {
+ // intentional empty.
+ }
+
/** C limit. */
private static final double C_LIMIT = 49;
/** S limit. */