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:
2015-12-09 17:21:53 +01:00
3 changed files with 87 additions and 0 deletions

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();
}
}