According to the best practices page we want to use the fewest calls to the JNI as possible to get the job done.
In my application, I want to add a column of data (held in a List<double> or double[] to a Mat column. Rather than doing this
public void putColumn(int colIndex, List<double> colData, MatOfDouble mat) {
for( int i=0; i<colData.size(); i++) {
mat.put(i, colIndex, colData[i]);
}
I'd prefer to do this:
mat.putColumn(List<double> colData);
Thus reducing colData.size() JNI calls to 1 call. Is there such a function in the Android API?
MatOfDouble has nice calls for exporting Mat data to native: mat.toList() double[] mat.toArray but the fromArray(double...a) only seems to be for the constructor.
By the way, why the difference in declarations for float and double versions of put in MatOfDouble?
public int put(int row, int col, double... data)
public int put(int row, int col, float[] data)
I'm a c++ programmer and double...a is not something i'm familiar with. What does it mean?