Add NativeProblem that loads libeva2problem.jnilib
if present.
closes #47
This commit is contained in:
27
src/eva2/problems/NativeProblem.java
Normal file
27
src/eva2/problems/NativeProblem.java
Normal 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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user