This commit is contained in:
Gilles Sadowski 2021-08-07 15:34:48 +02:00
commit 26fc13cf66
7 changed files with 9 additions and 15 deletions

View File

@ -2792,9 +2792,7 @@ public final class AccurateMath {
}
// Call atan
final double result = atan(ra, rb, x < 0);
return result;
return atan(ra, rb, x < 0);
}
/** Compute the arc sine of a number.

View File

@ -178,8 +178,7 @@ public final class SparseGradient implements RealFieldElement<SparseGradient>, S
/** {@inheritDoc} */
@Override
public SparseGradient add(final double c) {
final SparseGradient out = new SparseGradient(value + c, derivatives);
return out;
return new SparseGradient(value + c, derivatives);
}
/** {@inheritDoc} */

View File

@ -142,9 +142,7 @@ public class PiecewiseBicubicSplineInterpolatingFunction
final PolynomialSplineFunction spline = interpolator.interpolate(yArray, interpArray);
double returnValue = spline.value(y);
return returnValue;
return spline.value(y);
}
/**

View File

@ -50,8 +50,7 @@ public class BinaryMutation implements MutationPolicy {
// and change it
newRepr.set(geneIndex, origChrom.getRepresentation().get(geneIndex) == 0 ? 1 : 0);
Chromosome newChrom = origChrom.newFixedLengthChromosome(newRepr);
return newChrom;
return origChrom.newFixedLengthChromosome(newRepr);
}
}

View File

@ -119,8 +119,7 @@ public class LineSearch {
for (int i = 0; i < n; i++) {
x[i] = startPoint[i] + alpha * direction[i];
}
final double obj = mainOptimizer.computeObjectiveValue(x);
return obj;
return mainOptimizer.computeObjectiveValue(x);
}
};

View File

@ -961,9 +961,7 @@ public class KolmogorovSmirnovTest {
* \(D_{n,m}\) greater than {@code d}
*/
public double approximateP(double d, int n, int m) {
final double dm = m;
final double dn = n;
return 1 - ksSum(d * AccurateMath.sqrt((dm * dn) / (dm + dn)),
return 1 - ksSum(d * AccurateMath.sqrt(((double) m * (double) n) / ((double) m + (double) n)),
KS_SUM_CAUCHY_CRITERION, MAXIMUM_PARTIAL_SUM_COUNT);
}

View File

@ -101,6 +101,9 @@ Caveat:
Update class "SimplexOptimizer" (in package "o.a.c.m.legacy.optim.nonlinear.scalar.noderiv")
to support simulated annealing.
</action>
<action dev="aherbert" due-to="Arturo Bernal" type="update" issue="MATH-1573">
Remove redundant local variables.
</action>
<action dev="aherbert" due-to="Arturo Bernal" type="update" issue="MATH-1572">
Simplify conditional expressions.
</action>