Skip to content

Commit

Permalink
Merge pull request #357 from Serrof/issue-330
Browse files Browse the repository at this point in the history
update: make public constructors of abstract classes protected
  • Loading branch information
Serrof authored Nov 5, 2024
2 parents 30d1f9b + 52a102f commit 3703d65
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public abstract class FieldUnivariateDerivative<S extends CalculusFieldElement<S
* </p>
* @since 3.0
*/
public FieldUnivariateDerivative() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected FieldUnivariateDerivative() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public abstract class UnivariateDerivative<T extends UnivariateDerivative<T>>
* </p>
* @since 3.0
*/
public UnivariateDerivative() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected UnivariateDerivative() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class AbstractRuleFactory implements RuleFactory {
* </p>
* @since 3.0
*/
public AbstractRuleFactory() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected AbstractRuleFactory() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public abstract class FieldAbstractRuleFactory<T extends CalculusFieldElement<T>
/** Simple constructor
* @param field field to which rule coefficients belong
*/
public FieldAbstractRuleFactory(final Field<T> field) {
protected FieldAbstractRuleFactory(final Field<T> field) {
this.field = field;
this.pointsAndWeights = new TreeMap<>();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public abstract class AbstractIntegerDistribution implements IntegerDistribution
* </p>
* @since 3.0
*/
public AbstractIntegerDistribution() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected AbstractIntegerDistribution() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public abstract class IterativeLinearSolver {
*
* @param maxIterations the maximum number of iterations
*/
public IterativeLinearSolver(final int maxIterations) {
protected IterativeLinearSolver(final int maxIterations) {
this.manager = new IterationManager(maxIterations);
}

Expand All @@ -55,7 +55,7 @@ public IterativeLinearSolver(final int maxIterations) {
* @param manager the custom iteration manager
* @throws NullArgumentException if {@code manager} is {@code null}
*/
public IterativeLinearSolver(final IterationManager manager)
protected IterativeLinearSolver(final IterationManager manager)
throws NullArgumentException {
MathUtils.checkNotNull(manager);
this.manager = manager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public abstract class IterativeLinearSolverEvent
* @param iterations the number of iterations performed at the time
* {@code this} event is created
*/
public IterativeLinearSolverEvent(final Object source, final int iterations) {
protected IterativeLinearSolverEvent(final Object source, final int iterations) {
super(source, iterations);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public abstract class PreconditionedIterativeLinearSolver
*
* @param maxIterations the maximum number of iterations
*/
public PreconditionedIterativeLinearSolver(final int maxIterations) {
protected PreconditionedIterativeLinearSolver(final int maxIterations) {
super(maxIterations);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public abstract class RealVector {
* </p>
* @since 3.0
*/
public RealVector() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected RealVector() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public abstract class SparseRealVector extends RealVector {
* </p>
* @since 3.0
*/
public SparseRealVector() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected SparseRealVector() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public abstract class AbstractUnscentedTransform implements UnscentedTransformPr
* Constructor.
* @param stateDim the dimension of the state
*/
public AbstractUnscentedTransform(final int stateDim) {
protected AbstractUnscentedTransform(final int stateDim) {
// Check state dimension
if (stateDim == 0) {
// State dimension must be different from 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public abstract class AbstractCurveFitter {
* </p>
* @since 3.0
*/
public AbstractCurveFitter() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected AbstractCurveFitter() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ public abstract class AdamsFieldIntegrator<T extends CalculusFieldElement<T>> ex
* @param scalRelativeTolerance allowed relative error
* @exception MathIllegalArgumentException if order is 1 or less
*/
public AdamsFieldIntegrator(final Field<T> field, final String name,
final int nSteps, final int order,
final double minStep, final double maxStep,
final double scalAbsoluteTolerance,
final double scalRelativeTolerance)
protected AdamsFieldIntegrator(final Field<T> field, final String name, final int nSteps, final int order,
final double minStep, final double maxStep, final double scalAbsoluteTolerance,
final double scalRelativeTolerance)
throws MathIllegalArgumentException {
super(field, name, nSteps, order, minStep, maxStep,
scalAbsoluteTolerance, scalRelativeTolerance);
Expand All @@ -89,11 +87,9 @@ public AdamsFieldIntegrator(final Field<T> field, final String name,
* @param vecRelativeTolerance allowed relative error
* @exception IllegalArgumentException if order is 1 or less
*/
public AdamsFieldIntegrator(final Field<T> field, final String name,
final int nSteps, final int order,
final double minStep, final double maxStep,
final double[] vecAbsoluteTolerance,
final double[] vecRelativeTolerance)
protected AdamsFieldIntegrator(final Field<T> field, final String name, final int nSteps, final int order,
final double minStep, final double maxStep, final double[] vecAbsoluteTolerance,
final double[] vecRelativeTolerance)
throws IllegalArgumentException {
super(field, name, nSteps, order, minStep, maxStep,
vecAbsoluteTolerance, vecRelativeTolerance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ public abstract class AdamsIntegrator extends MultistepIntegrator {
* @param scalRelativeTolerance allowed relative error
* @exception MathIllegalArgumentException if order is 1 or less
*/
public AdamsIntegrator(final String name, final int nSteps, final int order,
final double minStep, final double maxStep,
final double scalAbsoluteTolerance,
final double scalRelativeTolerance)
protected AdamsIntegrator(final String name, final int nSteps, final int order,
final double minStep, final double maxStep,
final double scalAbsoluteTolerance,
final double scalRelativeTolerance)
throws MathIllegalArgumentException {
super(name, nSteps, order, minStep, maxStep,
scalAbsoluteTolerance, scalRelativeTolerance);
Expand All @@ -77,10 +77,9 @@ public AdamsIntegrator(final String name, final int nSteps, final int order,
* @param vecRelativeTolerance allowed relative error
* @exception IllegalArgumentException if order is 1 or less
*/
public AdamsIntegrator(final String name, final int nSteps, final int order,
final double minStep, final double maxStep,
final double[] vecAbsoluteTolerance,
final double[] vecRelativeTolerance)
protected AdamsIntegrator(final String name, final int nSteps, final int order,
final double minStep, final double maxStep,
final double[] vecAbsoluteTolerance, final double[] vecRelativeTolerance)
throws IllegalArgumentException {
super(name, nSteps, order, minStep, maxStep,
vecAbsoluteTolerance, vecRelativeTolerance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public abstract class AdaptiveStepsizeFieldIntegrator<T extends CalculusFieldEle
* @param scalAbsoluteTolerance allowed absolute error
* @param scalRelativeTolerance allowed relative error
*/
public AdaptiveStepsizeFieldIntegrator(final Field<T> field, final String name,
final double minStep, final double maxStep,
final double scalAbsoluteTolerance,
final double scalRelativeTolerance) {
protected AdaptiveStepsizeFieldIntegrator(final Field<T> field, final String name,
final double minStep, final double maxStep,
final double scalAbsoluteTolerance,
final double scalRelativeTolerance) {
super(field, name);
stepsizeHelper = new StepsizeHelper(minStep, maxStep, scalAbsoluteTolerance, scalRelativeTolerance);
resetInternalState();
Expand All @@ -111,10 +111,10 @@ public AdaptiveStepsizeFieldIntegrator(final Field<T> field, final String name,
* @param vecAbsoluteTolerance allowed absolute error
* @param vecRelativeTolerance allowed relative error
*/
public AdaptiveStepsizeFieldIntegrator(final Field<T> field, final String name,
final double minStep, final double maxStep,
final double[] vecAbsoluteTolerance,
final double[] vecRelativeTolerance) {
protected AdaptiveStepsizeFieldIntegrator(final Field<T> field, final String name,
final double minStep, final double maxStep,
final double[] vecAbsoluteTolerance,
final double[] vecRelativeTolerance) {
super(field, name);
stepsizeHelper = new StepsizeHelper(minStep, maxStep, vecAbsoluteTolerance, vecRelativeTolerance);
resetInternalState();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public abstract class AdaptiveStepsizeIntegrator
* @param scalAbsoluteTolerance allowed absolute error
* @param scalRelativeTolerance allowed relative error
*/
public AdaptiveStepsizeIntegrator(final String name,
protected AdaptiveStepsizeIntegrator(final String name,
final double minStep, final double maxStep,
final double scalAbsoluteTolerance,
final double scalRelativeTolerance) {
Expand All @@ -100,7 +100,7 @@ public AdaptiveStepsizeIntegrator(final String name,
* @param vecAbsoluteTolerance allowed absolute error
* @param vecRelativeTolerance allowed relative error
*/
public AdaptiveStepsizeIntegrator(final String name,
protected AdaptiveStepsizeIntegrator(final String name,
final double minStep, final double maxStep,
final double[] vecAbsoluteTolerance,
final double[] vecRelativeTolerance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public abstract class AbstractConvergenceChecker<P>
* @param relativeThreshold relative tolerance threshold
* @param absoluteThreshold absolute tolerance threshold
*/
public AbstractConvergenceChecker(final double relativeThreshold,
final double absoluteThreshold) {
protected AbstractConvergenceChecker(final double relativeThreshold,
final double absoluteThreshold) {
this.relativeThreshold = relativeThreshold;
this.absoluteThreshold = absoluteThreshold;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ public abstract class BaseMultiStartMultivariateOptimizer<P>
* @param generator Random vector generator to use for restarts.
* @throws MathIllegalArgumentException if {@code starts < 1}.
*/
public BaseMultiStartMultivariateOptimizer(final BaseMultivariateOptimizer<P> optimizer,
final int starts,
final RandomVectorGenerator generator) {
protected BaseMultiStartMultivariateOptimizer(final BaseMultivariateOptimizer<P> optimizer, final int starts,
final RandomVectorGenerator generator) {
super(optimizer.getConvergenceChecker());

if (starts < 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class BoundedConstraint implements Constraint {
* @param lower lower bound (null if no lower bound)
* @param upper upper bound (null if no upper bound)
*/
public BoundedConstraint(final RealVector lower, final RealVector upper) {
protected BoundedConstraint(final RealVector lower, final RealVector upper) {

// ensure lower is always properly set, even when there are no lower bounds
if (lower == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public abstract class AbstractEvaluation implements Evaluation {
* @param observationSize the number of observations.
* Needed for {@link #getRMS()} and {@link #getReducedChiSquare(int)}.
*/
public AbstractEvaluation(final int observationSize) {
protected AbstractEvaluation(final int observationSize) {
this.observationSize = observationSize;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public abstract class AbstractStorelessUnivariateStatistic
* </p>
* @since 3.0
*/
public AbstractStorelessUnivariateStatistic() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected AbstractStorelessUnivariateStatistic() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public abstract class AbstractMultipleLinearRegression implements
* </p>
* @since 3.0
*/
public AbstractMultipleLinearRegression() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
protected AbstractMultipleLinearRegression() { // NOPMD - unnecessary constructor added intentionally to make javadoc happy
// nothing to do
}

Expand Down
5 changes: 4 additions & 1 deletion src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ If the output is not quite correct, check for invisible trailing spaces!
</properties>
<body>
<release version="4.0" date="TBD" description="TBD">
<action dev="serrof" type="update" issue="issues/330">
Made constructors of abstract classes protected when they were public.
</action>
<action dev="serrof" type="add" issue="issues/335">
Add boolean for propagation direction in (Field)AdaptableInterval.
Add boolean for propagation direction in (Field)AdaptableInterval.
</action>
<action dev="luc" type="update" issue="issues/350">
Removed obsolete hipparchus-migration module.
Expand Down

0 comments on commit 3703d65

Please sign in to comment.