我在理解函数 loadwave(...) 的具体工作原理时遇到了一些问题。所以我在这里找到了一个带有描述的文件:/usr/share/scilab/modules/sound/macros/loadwave.sci 使用 find -name ... 命令。
现在我不明白 optim(...) 函数是如何工作的,所以我也想找到它的源文件,但我不能(我尝试使用 的组合再次查找和grep)。/usr/share/scilab/modules/optimization/demos/optim 目录中有一些带有 optim 使用示例的演示文件,但我仍然找不到 optim(...) 本身的任何源代码据我了解,应该看起来如下:
函数[...]=optim(...)
...
结束函数;
请问您能给我一点建议吗?
更新: 现在我只能在文件中找到这个 /usr/share/scilab/modules/optimization/sci_gateway/optimization_gateway.xml:
<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
<GATEWAY name="optimization">
<!-- =================== -->
<!--
Scilab
Interface description. In this file, we define the list of the function which
will be available into Scilab and the link to the "native" function.
gatewayId is the position in the hashtable 'Interfaces' defined in the
file SCI/modules/core/src/c/callinterf.h
primitiveId is the position in the hashtable '<module>Table Tab[]' defined
in the file modules/<module>/sci_gateway/c/gw_<module>.c
primitiveName is the name of the Scilab function
===================
Don't touch if you do not know what you are doing
-->
<!-- =================== -->
<PRIMITIVE gatewayId="11" primitiveId="1" primitiveName="optim" />
<PRIMITIVE gatewayId="11" primitiveId="2" primitiveName="semidef" />
<PRIMITIVE gatewayId="11" primitiveId="3" primitiveName="fsolve" />
<PRIMITIVE gatewayId="11" primitiveId="4" primitiveName="lsqrsolve" />
<PRIMITIVE gatewayId="11" primitiveId="5" primitiveName="qld" />
<PRIMITIVE gatewayId="11" primitiveId="6" primitiveName="qp_solve" />
<PRIMITIVE gatewayId="11" primitiveId="7" primitiveName="readmps" />
</GATEWAY>
因此,在 scilab 的 git 存储库中,下面的 user1149326 给了我一个链接,我找到了文件 scilab/modules/optimization/sci_gateway/c/sci_optim.c ( http://gitweb.scilab.org/?p=scilab.git;a=blob;f=scilab/modules/optimization/sci_gateway/c/sci_optim.c;h=608f7dabe822fc6cfecb456e847f3b7373014322;hb=HEAD )
最佳答案
您可以在 their git repository 查看所有 Scilab 源代码。 。更具体地说,所有 optim
源都在 the optimization module 中。 。请参阅 src
和 macro
文件夹。您可以在 their wiki 上了解该模块的组织方式。 .
我认为来源太复杂,无法让您深入了解 optim
的工作原理。我建议不要查看来源,而是 a document by Scilab about the kinds of optimization ,这也可能会提供您正在寻找的信息。
关于function - Scilab:optim 函数源文件位于何处,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29601321/