The documentation for LibraryLink has the following example
DLLEXPORT int demo_TI_R(WolframLibraryData libData,
mint Argc, MArgument *Args, MArgument Res) {
MTensor T0;
mint I0;
double R0;
T0 = MArgument_getMTensor(Args[0]);
I0 = MArgument_getInteger(Args[1]);
R0 = libData->MTensorVector_getReal(T0, I0);
MArgument_setReal(Res, R0);
return LIBRARY_NO_ERROR;
}
I am trying to figure out what the command MTensorVector_getReal does. This looks like it is undocumented.
Similarly, in the following example from the documentation, it is not clear what funStruct is, and where it is coming from. Should it be libData instead?
DLLEXPORT int demo1_TI_R(WolframLibraryData libData,
mint Argc, MArgument *Args, MArgument Res) {
MTensor T0;
mint I0;
double R0;
T0 = MArgument_getMTensor(Args[0]);
I0 = MArgument_getInteger(Args[1]);
R0 = funStruct->MTensorVector_getReal( T0, I0);
libData->MTensor_free(T0);
MArgument_setReal(Res, R0);
return LIBRARY_NO_ERROR;
}
Any clarifications on these would be very much appreciated.