Edsoncv said:
Sorry, I wasn't clear in my question.
I mean: A have a big array of doubles in Java( eg. "X") I have two
options:
1) Pass the array to C++ in the native functinon call. eg.
public static native void solveNLPnative(double X[]).
2) Define a getX() method in Java and call this method from C++.
Since this operation will be done many times and "X" could be huge, I
would like to know which of the options is faster.
Thanks
(Warning; I am still new to all this, but)
Personally I don't see that it should make any real difference. If it is
really important you will need to test both.
NB don't forget that in both cases you will actually get a reference to the
Java array itself and you will have to call GetDoubleArrayElements and
ReleaseDoubleArrayElements to get at the underlying array.
So an important question is whether you are merely reading the array or are
actually modifying it.
It seems to me that the potential choke is GetDoubleArrayElements, which you
are going to need whichever method you choose.