MATH-1566: Fix CheckStyle Issues

This commit is contained in:
abchaubey 2020-12-21 23:02:58 +08:00 committed by Gilles Sadowski
parent a2c3868fb8
commit ed886b8ef5
12 changed files with 35 additions and 65 deletions

View File

@ -16,12 +16,7 @@
*/ */
package org.apache.commons.math4.analysis.integration; 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.NumberIsTooLargeException;
import org.apache.commons.math4.exception.NumberIsTooSmallException;
import org.apache.commons.math4.exception.TooManyEvaluationsException;
import org.apache.commons.math4.util.FastMath; import org.apache.commons.math4.util.FastMath;
/** /**
@ -47,9 +42,9 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator {
* @param absoluteAccuracy absolute accuracy of the result * @param absoluteAccuracy absolute accuracy of the result
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum 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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than 39. * is greater than 39.
@ -69,9 +64,9 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator {
* Build a midpoint integrator with given iteration counts. * Build a midpoint integrator with given iteration counts.
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum 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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than 39. * is greater than 39.
@ -109,7 +104,7 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator {
* @param diffMaxMin Difference between the lower bound and upper bound * @param diffMaxMin Difference between the lower bound and upper bound
* of the integration interval. * of the integration interval.
* @return the value of n-th stage integral * @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. * is exceeded.
*/ */
private double stage(final int n, private double stage(final int n,

View File

@ -16,11 +16,7 @@
*/ */
package org.apache.commons.math4.analysis.integration; 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.NumberIsTooLargeException;
import org.apache.commons.math4.exception.NumberIsTooSmallException;
import org.apache.commons.math4.exception.TooManyEvaluationsException;
import org.apache.commons.math4.util.FastMath; import org.apache.commons.math4.util.FastMath;
/** /**
@ -47,9 +43,9 @@ public class RombergIntegrator extends BaseAbstractUnivariateIntegrator {
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum number of iterations * @param maximalIterationCount maximum number of iterations
* (must be less than or equal to {@link #ROMBERG_MAX_ITERATIONS_COUNT}) * (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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT} * is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT}
@ -70,9 +66,9 @@ public class RombergIntegrator extends BaseAbstractUnivariateIntegrator {
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum number of iterations * @param maximalIterationCount maximum number of iterations
* (must be less than or equal to {@link #ROMBERG_MAX_ITERATIONS_COUNT}) * (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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT} * is greater than {@link #ROMBERG_MAX_ITERATIONS_COUNT}

View File

@ -16,9 +16,7 @@
*/ */
package org.apache.commons.math4.analysis.integration; 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.NumberIsTooLargeException;
import org.apache.commons.math4.exception.NumberIsTooSmallException;
import org.apache.commons.math4.util.FastMath; import org.apache.commons.math4.util.FastMath;
/** /**
@ -44,9 +42,9 @@ public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator {
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum number of iterations * @param maximalIterationCount maximum number of iterations
* (must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}) * (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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT} * is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT}
@ -67,9 +65,9 @@ public class SimpsonIntegrator extends BaseAbstractUnivariateIntegrator {
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum number of iterations * @param maximalIterationCount maximum number of iterations
* (must be less than or equal to {@link #SIMPSON_MAX_ITERATIONS_COUNT}) * (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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT} * is greater than {@link #SIMPSON_MAX_ITERATIONS_COUNT}

View File

@ -16,12 +16,7 @@
*/ */
package org.apache.commons.math4.analysis.integration; 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.NumberIsTooLargeException;
import org.apache.commons.math4.exception.NumberIsTooSmallException;
import org.apache.commons.math4.exception.TooManyEvaluationsException;
import org.apache.commons.math4.util.FastMath; import org.apache.commons.math4.util.FastMath;
/** /**
@ -48,9 +43,9 @@ public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator {
* @param absoluteAccuracy absolute accuracy of the result * @param absoluteAccuracy absolute accuracy of the result
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum 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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than 63. * is greater than 63.
@ -70,9 +65,9 @@ public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator {
* Build a trapezoid integrator with given iteration counts. * Build a trapezoid integrator with given iteration counts.
* @param minimalIterationCount minimum number of iterations * @param minimalIterationCount minimum number of iterations
* @param maximalIterationCount maximum 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 * 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 * is lesser than or equal to the minimal number of iterations
* @exception NumberIsTooLargeException if maximal number of iterations * @exception NumberIsTooLargeException if maximal number of iterations
* is greater than 63. * is greater than 63.
@ -106,7 +101,7 @@ public class TrapezoidIntegrator extends BaseAbstractUnivariateIntegrator {
* @param baseIntegrator integrator holding integration parameters * @param baseIntegrator integrator holding integration parameters
* @param n the stage of 1/2 refinement, n = 0 is no refinement * @param n the stage of 1/2 refinement, n = 0 is no refinement
* @return the value of n-th stage integral * @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. * is exceeded.
*/ */
double stage(final BaseAbstractUnivariateIntegrator baseIntegrator, final int n) { double stage(final BaseAbstractUnivariateIntegrator baseIntegrator, final int n) {

View File

@ -17,10 +17,6 @@
package org.apache.commons.math4.analysis.integration; package org.apache.commons.math4.analysis.integration;
import org.apache.commons.math4.analysis.UnivariateFunction; 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. * Interface for univariate real integration algorithms.
@ -65,13 +61,13 @@ public interface UnivariateIntegrator {
* @param min the lower bound for the interval * @param min the lower bound for the interval
* @param max the upper bound for the interval * @param max the upper bound for the interval
* @return the value of integral * @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 * 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 * 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 * 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); double integrate(int maxEval, UnivariateFunction f, double min, double max);

View File

@ -18,7 +18,6 @@ package org.apache.commons.math4.analysis.integration.gauss;
import org.apache.commons.math4.analysis.UnivariateFunction; import org.apache.commons.math4.analysis.UnivariateFunction;
import org.apache.commons.math4.exception.DimensionMismatchException; 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.MathArrays;
import org.apache.commons.math4.util.Pair; import org.apache.commons.math4.util.Pair;
@ -42,7 +41,7 @@ public class GaussIntegrator {
* *
* @param points Integration points. * @param points Integration points.
* @param weights Weights of the corresponding integration nodes. * @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. * sorted in increasing order.
* @throws DimensionMismatchException if points and weights don't have the same length * @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. * the pair) and weights (second element of the pair.
* *
* @param pointsAndWeights Integration points and corresponding weights. * @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. * sorted in increasing order.
* *
* @see #GaussIntegrator(double[], double[]) * @see #GaussIntegrator(double[], double[])

View File

@ -16,11 +16,8 @@
*/ */
package org.apache.commons.math4.analysis.integration.gauss; 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 org.apache.commons.math4.util.Pair;
import java.math.BigDecimal;
/** /**
* Class that provides different ways to compute the nodes and weights to be * 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 lowerBound Lower bound of the integration interval.
* @param upperBound Upper bound of the integration interval. * @param upperBound Upper bound of the integration interval.
* @return a Gauss-Legendre integrator. * @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, public GaussIntegrator legendre(int numberOfPoints,
double lowerBound, double lowerBound,
@ -99,7 +96,7 @@ public class GaussIntegratorFactory {
* *
* @param numberOfPoints Order of the integration rule. * @param numberOfPoints Order of the integration rule.
* @return a Gauss-Legendre integrator. * @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) { public GaussIntegrator legendreHighPrecision(int numberOfPoints) {
return new GaussIntegrator(getRule(legendreHighPrecision, numberOfPoints)); return new GaussIntegrator(getRule(legendreHighPrecision, numberOfPoints));
@ -114,7 +111,7 @@ public class GaussIntegratorFactory {
* @param lowerBound Lower bound of the integration interval. * @param lowerBound Lower bound of the integration interval.
* @param upperBound Upper bound of the integration interval. * @param upperBound Upper bound of the integration interval.
* @return a Gauss-Legendre integrator. * @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, public GaussIntegrator legendreHighPrecision(int numberOfPoints,
double lowerBound, double lowerBound,
@ -145,8 +142,8 @@ public class GaussIntegratorFactory {
* @param factory Integration rule factory. * @param factory Integration rule factory.
* @param numberOfPoints Order of the integration rule. * @param numberOfPoints Order of the integration rule.
* @return the integration nodes and weights. * @return the integration nodes and weights.
* @throws NotStrictlyPositiveException if number of points is not positive * @throws org.apache.commons.math4.exception.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.DimensionMismatchException if the elements of the rule pair do not
* have the same length. * have the same length.
*/ */
private static Pair<double[], double[]> getRule(BaseRuleFactory<? extends Number> factory, private static Pair<double[], double[]> getRule(BaseRuleFactory<? extends Number> factory,

View File

@ -16,7 +16,6 @@
*/ */
package org.apache.commons.math4.analysis.integration.gauss; 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.FastMath;
import org.apache.commons.math4.util.Pair; import org.apache.commons.math4.util.Pair;

View File

@ -20,7 +20,6 @@ import java.util.Arrays;
import org.apache.commons.math4.analysis.polynomials.PolynomialFunction; import org.apache.commons.math4.analysis.polynomials.PolynomialFunction;
import org.apache.commons.math4.analysis.polynomials.PolynomialsUtils; 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.EigenDecomposition;
import org.apache.commons.math4.linear.MatrixUtils; import org.apache.commons.math4.linear.MatrixUtils;
import org.apache.commons.math4.linear.RealMatrix; import org.apache.commons.math4.linear.RealMatrix;

View File

@ -16,12 +16,11 @@
*/ */
package org.apache.commons.math4.analysis.integration.gauss; package org.apache.commons.math4.analysis.integration.gauss;
import org.apache.commons.math4.util.Pair;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.MathContext; 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. * Factory that creates Gauss-type quadrature rule using Legendre polynomials.
* In this implementation, the lower and upper bounds of the natural interval * In this implementation, the lower and upper bounds of the natural interval

View File

@ -16,7 +16,6 @@
*/ */
package org.apache.commons.math4.analysis.integration.gauss; package org.apache.commons.math4.analysis.integration.gauss;
import org.apache.commons.math4.exception.DimensionMismatchException;
import org.apache.commons.math4.util.Pair; import org.apache.commons.math4.util.Pair;
/** /**

View File

@ -17,8 +17,6 @@
package org.apache.commons.math4.analysis.integration.gauss; package org.apache.commons.math4.analysis.integration.gauss;
import org.apache.commons.math4.analysis.UnivariateFunction; 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; import org.apache.commons.math4.util.Pair;
/** /**
@ -36,9 +34,9 @@ public class SymmetricGaussIntegrator extends GaussIntegrator {
* *
* @param points Integration points. * @param points Integration points.
* @param weights Weights of the corresponding integration nodes. * @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. * 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, public SymmetricGaussIntegrator(double[] points,
double[] weights) { double[] weights) {
@ -50,7 +48,7 @@ public class SymmetricGaussIntegrator extends GaussIntegrator {
* the pair) and weights (second element of the pair. * the pair) and weights (second element of the pair.
* *
* @param pointsAndWeights Integration points and corresponding weights. * @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. * sorted in increasing order.
* *
* @see #SymmetricGaussIntegrator(double[], double[]) * @see #SymmetricGaussIntegrator(double[], double[])