Combined nested if statements.
This commit is contained in:
parent
1130658baf
commit
63a179da8b
|
@ -213,10 +213,10 @@ public class EnumeratedDistribution<T> implements Serializable {
|
|||
index = -index-1;
|
||||
}
|
||||
|
||||
if (index >= 0 && index < probabilities.length) {
|
||||
if (randomValue < cumulativeProbabilities[index]) {
|
||||
return singletons.get(index);
|
||||
}
|
||||
if (index >= 0 &&
|
||||
index < probabilities.length &&
|
||||
randomValue < cumulativeProbabilities[index]) {
|
||||
return singletons.get(index);
|
||||
}
|
||||
|
||||
/* This should never happen, but it ensures we will return a correct
|
||||
|
|
|
@ -234,13 +234,11 @@ public class GaussNewtonOptimizer implements LeastSquaresOptimizer {
|
|||
currentPoint = current.getPoint();
|
||||
|
||||
// Check convergence.
|
||||
if (previous != null) {
|
||||
if (checker.converged(iterationCounter.getCount(), previous, current)) {
|
||||
return new OptimumImpl(
|
||||
current,
|
||||
evaluationCounter.getCount(),
|
||||
iterationCounter.getCount());
|
||||
}
|
||||
if (previous != null &&
|
||||
checker.converged(iterationCounter.getCount(), previous, current)) {
|
||||
return new OptimumImpl(current,
|
||||
evaluationCounter.getCount(),
|
||||
iterationCounter.getCount());
|
||||
}
|
||||
|
||||
// solve the linearized least squares problem
|
||||
|
|
Loading…
Reference in New Issue