Merge branch 'native-interface' into 'master'

Add NativeProblem that loads `libeva2problem.jnilib` if present.

closes #47

See merge request !4
This commit is contained in:
halfdan committed 2015-12-09 17:21:53 +01:00
commit 0bf3e51f0b
3 files changed
+87

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
package eva2.problems;
/**
*
*/
public class NativeProblem extends AbstractProblemDouble {
private static boolean isLibraryLoaded = false;
public NativeProblem() {
if (!isLibraryLoaded) {
System.loadLibrary("eva2problem");
}
isLibraryLoaded = true;
}
@Override
public native double[] evaluate(double[] x);
@Override
public native String getName();
@Override
public Object clone() {
return this.clone();
}
}