Skip to content

Commit

Permalink
Merge 8de9db8 into 771a218
Browse files Browse the repository at this point in the history
  • Loading branch information
arturobernalg authored Aug 6, 2021
2 parents 771a218 + 8de9db8 commit bb3e655
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1600,9 +1600,8 @@ public static double pow(final double x, final double y) {
z = z * lnb + 1.0;
z *= lnb;

final double result = exp(lna, z, null);
//result = result + result * z;
return result;
return exp(lna, z, null);

}
}
Expand Down Expand Up @@ -2792,9 +2791,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 bb3e655

Please sign in to comment.