-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmath_20.diff
26 lines (25 loc) · 1.64 KB
/
math_20.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git a/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java b/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java
index 4b7dbf6bb..addae5088 100644
--- a/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java
+++ b/src/main/java/org/apache/commons/math3/optimization/direct/CMAESOptimizer.java
@@ -316,6 +316,21 @@ public class CMAESOptimizer
this.generateStatistics = generateStatistics;
}
+ @Override // defects4j.instrumentation
+ public PointValuePair optimize(int maxEval, MultivariateFunction f, GoalType goalType, double[] startPoint, // defects4j.instrumentation
+ double[] lower, double[] upper) { // defects4j.instrumentation
+ if (Boolean.parseBoolean(System.getProperty("defects4j.instrumentation.enabled"))) { // defects4j.instrumentation
+ PointValuePair resultValue = super.optimize(maxEval, f, goalType, startPoint, lower, upper); // defects4j.instrumentation
+ if ((upper != null) && (resultValue.getPoint()[0] > upper[0])) { // defects4j.instrumentation
+ throw new RuntimeException("[Defects4J_BugReport_Violation]"); // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return resultValue; // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } else { // defects4j.instrumentation
+ return super.optimize(maxEval, f, goalType, startPoint, lower, upper); // defects4j.instrumentation
+ } // defects4j.instrumentation
+ } // defects4j.instrumentation
+
/**
* @return History of sigma values.
*/