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?
I am trying to figure out what the command MTensorVector_getReal does. This looks like it is undocumented.
I think that this code is not meant to “work”. It is meant to give a feel of what your code might look like.
“MArgument_getMTensor” seems to be a made-up name for a made-up function with an implication that it will return a Tensor when it is given
an “argument” that is passed into the function “demo1_TI_R”. As you can see, that is the way in which “MArgument_getMTensor” is used.
The story is similar for the function that you ask about (“MTensorVector_getReal”). The function has not been defined. However, from the
way that it is used, you see that it returns a Real when it is given a Tensor and a Vector. An example of a function that would have that sort
of behavior would be something like “get the maximum item of the inner product”. I think the documentation is attempting to be less confusing
or perhaps just more general by not giving a concrete example here.
This is a documentation error. That line should read:
libData->MTensor_getReal(T0, &I0, &R0);
The function extracts a real value from the tensor at the given index. As has been noted in this thread, those example programs have several errors due to not being updated as LibraryLink evolved during its development.