Skip to content

Commit

Permalink
Merge 84a8400 into 771a218
Browse files Browse the repository at this point in the history
  • Loading branch information
arturobernalg committed Aug 6, 2021
2 parents 771a218 + 84a8400 commit ed73633
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2792,9 +2792,7 @@ public static double atan2(double y, double x) {
}

// 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ public void addInPlace(final SparseGradient a) {
/** {@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} */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ public double value(double x,

final PolynomialSplineFunction spline = interpolator.interpolate(yArray, interpArray);

double returnValue = spline.value(y);

return returnValue;
return spline.value(y);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public Chromosome mutate(Chromosome original) throws MathIllegalArgumentExceptio
// and change it
newRepr.set(geneIndex, origChrom.getRepresentation().get(geneIndex) == 0 ? 1 : 0);

Chromosome newChrom = origChrom.newFixedLengthChromosome(newRepr);
return newChrom;
return origChrom.newFixedLengthChromosome(newRepr);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,7 @@ public double value(double alpha) {
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);
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -961,9 +961,7 @@ public double exactP(double d, int n, int m, boolean strict) {
* \(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);
}

Expand Down

0 comments on commit ed73633

Please sign in to comment.