Message Boards Message Boards

0
|
1234 Views
|
0 Replies
|
0 Total Likes
View groups...
Share
Share this post:

When the function WSGetReal64Array() can be used?

I am writing an app that uses Wolfram Engine as a computational backend. In the app, a thread that receives a packet from the kernel calls WSReady() to poll it. When an object is received from the kernel, after checking the packet type, WSGetType() is called to check the object type, and then WSGetSymbol(), WSGetFunction() or etc. is called to receive an expression from the kernel accordingly.

There is a WSTP function that receives an array from kernel, for example, WSGetReal64Array(). The array is expressed as a list of real numbers in the kernel. When the receiving thread examines its type using WSGetType(), it can be found as WSTKFUNC (function), whose head is "List", with a sequence of real numbers as its arguments. This means that WSGetReal64Array() doesn't have its turn to receive a real array if it tries to sort the return value of WSGetType() in a switch-case statement.

Does the receiving thread have to know in advance what expression will be returned from kernel in order to efficiently receive numerical data using WSGetReal64Array()?

Is there any way for the receiving thread to independently determine that an object from the kernel is a real array?

POSTED BY: YAMADA TAKATOSHI
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract