From ed886b8ef5919577cbbdca70b70940cbcc33f530 Mon Sep 17 00:00:00 2001 From: abchaubey Date: Mon, 21 Dec 2020 23:02:58 +0800 Subject: [PATCH] MATH-1566: Fix CheckStyle Issues --- .../analysis/integration/MidPointIntegrator.java | 15 +++++---------- .../analysis/integration/RombergIntegrator.java | 12 ++++-------- .../analysis/integration/SimpsonIntegrator.java | 10 ++++------ .../analysis/integration/TrapezoidIntegrator.java | 15 +++++---------- .../integration/UnivariateIntegrator.java | 12 ++++-------- .../integration/gauss/GaussIntegrator.java | 5 ++--- .../integration/gauss/GaussIntegratorFactory.java | 15 ++++++--------- .../integration/gauss/HermiteRuleFactory.java | 1 - .../integration/gauss/LaguerreRuleFactory.java | 1 - .../gauss/LegendreHighPrecisionRuleFactory.java | 5 ++--- .../integration/gauss/LegendreRuleFactory.java | 1 - .../gauss/SymmetricGaussIntegrator.java | 8 +++----- 12 files changed, 35 insertions(+), 65 deletions(-) diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/MidPointIntegrator.java b/src/main/java/org/apache/commons/math4/analysis/integration/MidPointIntegrator.java index d010fbd13..757e92ddd 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/MidPointIntegrator.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/MidPointIntegrator.java @@ -16,12 +16,7 @@ */ package org.apache.commons.math4.analysis.integration; -import org.apache.commons.math4.exception.MathIllegalArgumentException; -import org.apache.commons.math4.exception.MaxCountExceededException; -import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.exception.NumberIsTooLargeException; -import org.apache.commons.math4.exception.NumberIsTooSmallException; -import org.apache.commons.math4.exception.TooManyEvaluationsException; import org.apache.commons.math4.util.FastMath; /** @@ -47,9 +42,9 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator { * @param absoluteAccuracy absolute accuracy of the result * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than 39. @@ -69,9 +64,9 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator { * Build a midpoint integrator with given iteration counts. * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than 39. @@ -109,7 +104,7 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator { * @param diffMaxMin Difference between the lower bound and upper bound * of the integration interval. * @return the value of n-th stage integral - * @throws TooManyEvaluationsException if the maximal number of evaluations + * @throws org.apache.commons.math4.exception.TooManyEvaluationsException if the maximal number of evaluations * is exceeded. */ private double stage(final int n, diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/RombergIntegrator.java b/src/main/java/org/apache/commons/math4/analysis/integration/RombergIntegrator.java index 50179dff6..5e81c01b7 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/RombergIntegrator.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/RombergIntegrator.java @@ -16,11 +16,7 @@ */ package org.apache.commons.math4.analysis.integration; -import org.apache.commons.math4.exception.MaxCountExceededException; -import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.exception.NumberIsTooLargeException; -import org.apache.commons.math4.exception.NumberIsTooSmallException; -import org.apache.commons.math4.exception.TooManyEvaluationsException; import org.apache.commons.math4.util.FastMath; /** @@ -47,9 +43,9 @@ public class RombergIntegrator extends BaseAbstractUnivariateIntegrator { * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations * (must be less than or equal to {@link #ROMBERG_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT} @@ -70,9 +66,9 @@ public class RombergIntegrator extends BaseAbstractUnivariateIntegrator { * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations * (must be less than or equal to {@link #ROMBERG_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT} diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/SimpsonIntegrator.java b/src/main/java/org/apache/commons/math4/analysis/integration/SimpsonIntegrator.java index 554be7548..0e85f7299 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/SimpsonIntegrator.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/SimpsonIntegrator.java @@ -16,9 +16,7 @@ */ package org.apache.commons.math4.analysis.integration; -import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.exception.NumberIsTooLargeException; -import org.apache.commons.math4.exception.NumberIsTooSmallException; import org.apache.commons.math4.util.FastMath; /** @@ -44,9 +42,9 @@ public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator { * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations * (must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT} @@ -67,9 +65,9 @@ public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator { * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations * (must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}) - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT} diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/TrapezoidIntegrator.java b/src/main/java/org/apache/commons/math4/analysis/integration/TrapezoidIntegrator.java index 5a7e0e88f..87239c786 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/TrapezoidIntegrator.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/TrapezoidIntegrator.java @@ -16,12 +16,7 @@ */ package org.apache.commons.math4.analysis.integration; -import org.apache.commons.math4.exception.MathIllegalArgumentException; -import org.apache.commons.math4.exception.MaxCountExceededException; -import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.exception.NumberIsTooLargeException; -import org.apache.commons.math4.exception.NumberIsTooSmallException; -import org.apache.commons.math4.exception.TooManyEvaluationsException; import org.apache.commons.math4.util.FastMath; /** @@ -48,9 +43,9 @@ public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator { * @param absoluteAccuracy absolute accuracy of the result * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than 63. @@ -70,9 +65,9 @@ public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator { * Build a trapezoid integrator with given iteration counts. * @param minimalIterationCount minimum number of iterations * @param maximalIterationCount maximum number of iterations - * @exception NotStrictlyPositiveException if minimal number of iterations + * @exception org.apache.commons.math4.exception.NotStrictlyPositiveException if minimal number of iterations * is not strictly positive - * @exception NumberIsTooSmallException if maximal number of iterations + * @exception org.apache.commons.math4.exception.NumberIsTooSmallException if maximal number of iterations * is lesser than or equal to the minimal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations * is greater than 63. @@ -106,7 +101,7 @@ public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator { * @param baseIntegrator integrator holding integration parameters * @param n the stage of 1/2 refinement, n = 0 is no refinement * @return the value of n-th stage integral - * @throws TooManyEvaluationsException if the maximal number of evaluations + * @throws org.apache.commons.math4.exception.TooManyEvaluationsException if the maximal number of evaluations * is exceeded. */ double stage(final BaseAbstractUnivariateIntegrator baseIntegrator, final int n) { diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/UnivariateIntegrator.java b/src/main/java/org/apache/commons/math4/analysis/integration/UnivariateIntegrator.java index 994985cea..97dd416ea 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/UnivariateIntegrator.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/UnivariateIntegrator.java @@ -17,10 +17,6 @@ package org.apache.commons.math4.analysis.integration; import org.apache.commons.math4.analysis.UnivariateFunction; -import org.apache.commons.math4.exception.MathIllegalArgumentException; -import org.apache.commons.math4.exception.MaxCountExceededException; -import org.apache.commons.math4.exception.NullArgumentException; -import org.apache.commons.math4.exception.TooManyEvaluationsException; /** * Interface for univariate real integration algorithms. @@ -65,13 +61,13 @@ public interface UnivariateIntegrator { * @param min the lower bound for the interval * @param max the upper bound for the interval * @return the value of integral - * @throws TooManyEvaluationsException if the maximum number of function + * @throws org.apache.commons.math4.exception.TooManyEvaluationsException if the maximum number of function * evaluations is exceeded - * @throws MaxCountExceededException if the maximum iteration count is exceeded + * @throws org.apache.commons.math4.exception.MaxCountExceededException if the maximum iteration count is exceeded * or the integrator detects convergence problems otherwise - * @throws MathIllegalArgumentException if {@code min > max} or the endpoints do not + * @throws org.apache.commons.math4.exception.MathIllegalArgumentException if {@code min > max} or the endpoints do not * satisfy the requirements specified by the integrator - * @throws NullArgumentException if {@code f} is {@code null}. + * @throws org.apache.commons.math4.exception.NullArgumentException if {@code f} is {@code null}. */ double integrate(int maxEval, UnivariateFunction f, double min, double max); diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegrator.java b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegrator.java index de86f486d..9e0213a49 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegrator.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegrator.java @@ -18,7 +18,6 @@ package org.apache.commons.math4.analysis.integration.gauss; import org.apache.commons.math4.analysis.UnivariateFunction; import org.apache.commons.math4.exception.DimensionMismatchException; -import org.apache.commons.math4.exception.NonMonotonicSequenceException; import org.apache.commons.math4.util.MathArrays; import org.apache.commons.math4.util.Pair; @@ -42,7 +41,7 @@ public class GaussIntegrator { * * @param points Integration points. * @param weights Weights of the corresponding integration nodes. - * @throws NonMonotonicSequenceException if the {@code points} are not + * @throws org.apache.commons.math4.exception.NonMonotonicSequenceException if the {@code points} are not * sorted in increasing order. * @throws DimensionMismatchException if points and weights don't have the same length */ @@ -64,7 +63,7 @@ public class GaussIntegrator { * the pair) and weights (second element of the pair. * * @param pointsAndWeights Integration points and corresponding weights. - * @throws NonMonotonicSequenceException if the {@code points} are not + * @throws org.apache.commons.math4.exception.NonMonotonicSequenceException if the {@code points} are not * sorted in increasing order. * * @see #GaussIntegrator(double[], double[]) diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java index 3b1c2eb99..e65124cd1 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/GaussIntegratorFactory.java @@ -16,11 +16,8 @@ */ package org.apache.commons.math4.analysis.integration.gauss; -import java.math.BigDecimal; - -import org.apache.commons.math4.exception.DimensionMismatchException; -import org.apache.commons.math4.exception.NotStrictlyPositiveException; import org.apache.commons.math4.util.Pair; +import java.math.BigDecimal; /** * Class that provides different ways to compute the nodes and weights to be @@ -81,7 +78,7 @@ public class GaussIntegratorFactory { * @param lowerBound Lower bound of the integration interval. * @param upperBound Upper bound of the integration interval. * @return a Gauss-Legendre integrator. - * @throws NotStrictlyPositiveException if number of points is not positive + * @throws org.apache.commons.math4.exception.NotStrictlyPositiveException if number of points is not positive */ public GaussIntegrator legendre(int numberOfPoints, double lowerBound, @@ -99,7 +96,7 @@ public class GaussIntegratorFactory { * * @param numberOfPoints Order of the integration rule. * @return a Gauss-Legendre integrator. - * @throws NotStrictlyPositiveException if number of points is not positive + * @throws org.apache.commons.math4.exception.NotStrictlyPositiveException if number of points is not positive */ public GaussIntegrator legendreHighPrecision(int numberOfPoints) { return new GaussIntegrator(getRule(legendreHighPrecision, numberOfPoints)); @@ -114,7 +111,7 @@ public class GaussIntegratorFactory { * @param lowerBound Lower bound of the integration interval. * @param upperBound Upper bound of the integration interval. * @return a Gauss-Legendre integrator. - * @throws NotStrictlyPositiveException if number of points is not positive + * @throws org.apache.commons.math4.exception.NotStrictlyPositiveException if number of points is not positive */ public GaussIntegrator legendreHighPrecision(int numberOfPoints, double lowerBound, @@ -145,8 +142,8 @@ public class GaussIntegratorFactory { * @param factory Integration rule factory. * @param numberOfPoints Order of the integration rule. * @return the integration nodes and weights. - * @throws NotStrictlyPositiveException if number of points is not positive - * @throws DimensionMismatchException if the elements of the rule pair do not + * @throws org.apache.commons.math4.exception.NotStrictlyPositiveException if number of points is not positive + * @throws org.apache.commons.math4.exception.DimensionMismatchException if the elements of the rule pair do not * have the same length. */ private static Pair getRule(BaseRuleFactory factory, diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java index c680ed92a..2d5a3e1a9 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/HermiteRuleFactory.java @@ -16,7 +16,6 @@ */ package org.apache.commons.math4.analysis.integration.gauss; -import org.apache.commons.math4.exception.DimensionMismatchException; import org.apache.commons.math4.util.FastMath; import org.apache.commons.math4.util.Pair; diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java index fc9eb3b89..23e45df12 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LaguerreRuleFactory.java @@ -20,7 +20,6 @@ import java.util.Arrays; import org.apache.commons.math4.analysis.polynomials.PolynomialFunction; import org.apache.commons.math4.analysis.polynomials.PolynomialsUtils; -import org.apache.commons.math4.exception.DimensionMismatchException; import org.apache.commons.math4.linear.EigenDecomposition; import org.apache.commons.math4.linear.MatrixUtils; import org.apache.commons.math4.linear.RealMatrix; diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java index 811f6d1c6..a982deb0e 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreHighPrecisionRuleFactory.java @@ -16,12 +16,11 @@ */ package org.apache.commons.math4.analysis.integration.gauss; +import org.apache.commons.math4.util.Pair; + import java.math.BigDecimal; import java.math.MathContext; -import org.apache.commons.math4.exception.DimensionMismatchException; -import org.apache.commons.math4.util.Pair; - /** * Factory that creates Gauss-type quadrature rule using Legendre polynomials. * In this implementation, the lower and upper bounds of the natural interval diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java index 657f594ae..cbc1e7d9b 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/LegendreRuleFactory.java @@ -16,7 +16,6 @@ */ package org.apache.commons.math4.analysis.integration.gauss; -import org.apache.commons.math4.exception.DimensionMismatchException; import org.apache.commons.math4.util.Pair; /** diff --git a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/SymmetricGaussIntegrator.java b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/SymmetricGaussIntegrator.java index 083b8483b..1230a1dc2 100644 --- a/src/main/java/org/apache/commons/math4/analysis/integration/gauss/SymmetricGaussIntegrator.java +++ b/src/main/java/org/apache/commons/math4/analysis/integration/gauss/SymmetricGaussIntegrator.java @@ -17,8 +17,6 @@ package org.apache.commons.math4.analysis.integration.gauss; import org.apache.commons.math4.analysis.UnivariateFunction; -import org.apache.commons.math4.exception.DimensionMismatchException; -import org.apache.commons.math4.exception.NonMonotonicSequenceException; import org.apache.commons.math4.util.Pair; /** @@ -36,9 +34,9 @@ public class SymmetricGaussIntegrator extends GaussIntegrator { * * @param points Integration points. * @param weights Weights of the corresponding integration nodes. - * @throws NonMonotonicSequenceException if the {@code points} are not + * @throws org.apache.commons.math4.exception.NonMonotonicSequenceException if the {@code points} are not * sorted in increasing order. - * @throws DimensionMismatchException if points and weights don't have the same length + * @throws org.apache.commons.math4.exception.DimensionMismatchException if points and weights don't have the same length */ public SymmetricGaussIntegrator(double[] points, double[] weights) { @@ -50,7 +48,7 @@ public class SymmetricGaussIntegrator extends GaussIntegrator { * the pair) and weights (second element of the pair. * * @param pointsAndWeights Integration points and corresponding weights. - * @throws NonMonotonicSequenceException if the {@code points} are not + * @throws org.apache.commons.math4.exception.NonMonotonicSequenceException if the {@code points} are not * sorted in increasing order. * * @see #SymmetricGaussIntegrator(double[], double[])