`mlx` interface for Java packaging of Matlab functions?

左心房为你撑大大i 提交于 2021-01-29 08:00:39

问题


I am looking at the Matlab information on packaging functions for invocation from Java, specifically in the context of a variable number of input arguments. A number of function signatures are for "mlx interface", but there is no explanation of what this means.

Web searching shows that *.mlx is file extension of Jupyter-like file for Matlab code. It is unclear whether this has anything to do with the use of this acronym in the interface documentation cited above. The manner in which it is presented seems to indicate that any reader should know what it is, and mlx signatures take up half of the examples shown, so it is obviously a prominent use case. In contrast, I've never heard of a Jupyter-like Matlab file before, and likewise, did not know of an *.mlx file extension until now (though there are many TMW corners I've not ventured near).

What does "mlx interface" mean in the context of function signatures in Java packaged Matlab?

Why does it figure so prominently into the Java interface?


回答1:


It looks as if the answer is not available in Matlab's doc documentation, nor the HTML counterparts on the web. Hints of the answer are buried deep in real-book documenation like MATLAB Compiler SDK Java User's Guide:

A standard signature in Java...specifies input arguments for each overloaded method as one or more input arguments of class java.lang.Object or any subclass (including subclasses of MWArray). The standard interface specifies return values, if any, as a subclass of MWArray.

[The] mlx API...allows the user to specify the inputs to a function as an Object array, where each array element is one input argument. Similarly, the user also gives the mlx interface a preallocated Object array to hold the outputs of the function. The allocated length of the output array determines the number of desired function outputs.

The mlx interface may also be accessed using java.util.List containers in place of Object arrays for the inputs and outputs. Note that if List containers are used, the output List passed in must contain a number of elements equal to the desired number of function outputs.

A web search for mlx-api shows that it is Matlab interface for C/C++: Functions Generated from MATLAB Files. While the acronym mlx may have been motivated by this, it seems that the only thing inheritted by the Java signature is the acronym. The signature itself is completely dissimilar to that in the posted page Pass Variable Numbers of Inputs.



来源:https://stackoverflow.com/questions/64546670/mlx-interface-for-java-packaging-of-matlab-functions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!