Adding sypet to repo
[Benchmarks_CSolver.git] / sypet-non-incremental / benchmarks / math / 8 / TestSource.java
diff --git a/sypet-non-incremental/benchmarks/math/8/TestSource.java b/sypet-non-incremental/benchmarks/math/8/TestSource.java
new file mode 100644 (file)
index 0000000..3271b9a
--- /dev/null
@@ -0,0 +1,15 @@
+public static boolean test1() throws Throwable {
+    double[][] known = new double[][] {{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}};
+    double x = 1.5;
+    return predict(known, x) == 2.5;
+}
+
+public static boolean test2() throws Throwable {
+    double[][] known = new double[][] {{1, 3}, {2, 4}, {3, 5}, {4, 6}, {5, 7}};
+    double x = 2.5;
+    return predict(known, x) == 4.5;
+}
+
+public static boolean test() throws Throwable {
+    return test1() && test2();
+}