Fixed checkstyle warnings.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1517359 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2013-08-25 18:19:06 +00:00
parent 5151780b34
commit cf4805081b
4 changed files with 34 additions and 33 deletions

View File

@ -80,29 +80,29 @@ public abstract class AbstractLeastSquaresOptimizer<OPTIM extends AbstractLeastS
}
/** {@inheritDoc} */
public OPTIM withTarget(double[] target) {
this.target = target.clone();
public OPTIM withTarget(double[] newTarget) {
this.target = newTarget.clone();
return self();
}
/** {@inheritDoc} */
public OPTIM withWeight(RealMatrix weight) {
this.weight = weight; // XXX Not thread-safe
weightSqrt = squareRoot(weight);
public OPTIM withWeight(RealMatrix newWeight) {
this.weight = newWeight; // XXX Not thread-safe
weightSqrt = squareRoot(newWeight);
return self();
}
/** {@inheritDoc} */
public OPTIM withModelAndJacobian(MultivariateVectorFunction model,
MultivariateMatrixFunction jacobian) {
this.model = model; // XXX Not thread-safe
this.jacobian = jacobian; // XXX Not thread-safe
public OPTIM withModelAndJacobian(MultivariateVectorFunction newModel,
MultivariateMatrixFunction newJacobian) {
this.model = newModel; // XXX Not thread-safe
this.jacobian = newJacobian; // XXX Not thread-safe
return self();
}
/** {@inheritDoc} */
public OPTIM withStartPoint(double[] start) {
this.start = start.clone();
public OPTIM withStartPoint(double[] newStart) {
this.start = newStart.clone();
return self();
}

View File

@ -85,11 +85,11 @@ public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer<GaussNew
}
/**
* @param useLU Whether to use LU decomposition.
* @param newUseLU Whether to use LU decomposition.
* @return this instance.
*/
public GaussNewtonOptimizer withLU(boolean useLU) {
this.useLU = useLU;
public GaussNewtonOptimizer withLU(boolean newUseLU) {
this.useLU = newUseLU;
return self();
}

View File

@ -176,28 +176,28 @@ public class LevenbergMarquardtOptimizer extends AbstractLeastSquaresOptimizer<L
}
/**
* @param initialStepBoundFactor Positive input variable used in
* @param newInitialStepBoundFactor Positive input variable used in
* determining the initial step bound. This bound is set to the
* product of initialStepBoundFactor and the euclidean norm of
* {@code diag * x} if non-zero, or else to {@code initialStepBoundFactor}
* {@code diag * x} if non-zero, or else to {@code newInitialStepBoundFactor}
* itself. In most cases factor should lie in the interval
* {@code (0.1, 100.0)}. {@code 100} is a generally recommended value.
* of the matrix is reduced.
* @return this instance.
*/
public LevenbergMarquardtOptimizer withInitialStepBoundFactor(double initialStepBoundFactor) {
this.initialStepBoundFactor = initialStepBoundFactor;
public LevenbergMarquardtOptimizer withInitialStepBoundFactor(double newInitialStepBoundFactor) {
this.initialStepBoundFactor = newInitialStepBoundFactor;
return self();
}
/**
* Modifies the given parameter.
*
* @param costRelativeTolerance Desired relative error in the sum of squares.
* @param newCostRelativeTolerance Desired relative error in the sum of squares.
* @return this instance.
*/
public LevenbergMarquardtOptimizer withCostRelativeTolerance(double costRelativeTolerance) {
this.costRelativeTolerance = costRelativeTolerance;
public LevenbergMarquardtOptimizer withCostRelativeTolerance(double newCostRelativeTolerance) {
this.costRelativeTolerance = newCostRelativeTolerance;
return self();
}
@ -216,12 +216,12 @@ public class LevenbergMarquardtOptimizer extends AbstractLeastSquaresOptimizer<L
/**
* Modifies the given parameter.
*
* @param orthoTolerance Desired max cosine on the orthogonality between
* @param newOrthoTolerance Desired max cosine on the orthogonality between
* the function vector and the columns of the Jacobian.
* @return this instance.
*/
public LevenbergMarquardtOptimizer withOrthoTolerance(double orthoTolerance) {
this.orthoTolerance = orthoTolerance;
public LevenbergMarquardtOptimizer withOrthoTolerance(double newOrthoTolerance) {
this.orthoTolerance = newOrthoTolerance;
return self();
}
@ -547,17 +547,17 @@ public class LevenbergMarquardtOptimizer extends AbstractLeastSquaresOptimizer<L
*/
private static class InternalData {
/** Weighted Jacobian. */
final double[][] weightedJacobian;
private final double[][] weightedJacobian;
/** Columns permutation array. */
final int[] permutation;
private final int[] permutation;
/** Rank of the Jacobian matrix. */
final int rank;
private final int rank;
/** Diagonal elements of the R matrix in the QR decomposition. */
final double[] diagR;
private final double[] diagR;
/** Norms of the columns of the jacobian matrix. */
final double[] jacNorm;
private final double[] jacNorm;
/** Coefficients of the Householder transforms vectors. */
final double[] beta;
private final double[] beta;
/**
* @param weightedJacobian Weighted Jacobian.

View File

@ -60,7 +60,7 @@ public abstract class AbstractOptimizer<PAIR, OPTIM extends AbstractOptimizer<PA
*
* @param other Instance to copy.
*/
protected AbstractOptimizer(AbstractOptimizer other) {
protected AbstractOptimizer(AbstractOptimizer<PAIR, OPTIM> other) {
checker = other.checker; // XXX Not thread-safe.
evaluations.setMaximalCount(other.getMaxEvaluations());
iterations.setMaximalCount(other.getMaxIterations());
@ -72,13 +72,14 @@ public abstract class AbstractOptimizer<PAIR, OPTIM extends AbstractOptimizer<PA
* @return the "self-type" instance.
*/
protected OPTIM self() {
@SuppressWarnings("unchecked")
final OPTIM optim = (OPTIM) this;
return optim;
}
/** {@inheritDoc} */
public OPTIM withConvergenceChecker(ConvergenceChecker<PAIR> checker) {
this.checker = checker;
public OPTIM withConvergenceChecker(ConvergenceChecker<PAIR> newChecker) {
this.checker = newChecker;
return self();
}