找回密码
 注册
Simdroid-非首页
查看: 144|回复: 3

[基础概念] 体会mathlink

[复制链接]
发表于 2007-8-9 12:51:02 | 显示全部楼层 |阅读模式 来自 北京海淀
编写一个f.tm的mathlink模板文件,模版只需定义好被调用的C函数名,形参,类型,返回值的类型.
MathLink Developer Kit 包含一个名为 mpreg 的程序(V5.2路径C:\Program Files\Wolfram Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows\CompilerAdditions\mldev32\bin),将要处理的f.tm 文件作为输入直接调用,mpreg 输出产生 C 源代码,它可以送往 C 编绎器.
e.g mprep  f.tm  -o f.c
当然还要include加上mathlink.h(v5.2路径:C:\Program Files\Wolfram Research\Mathematica\5.2\AddOns\MathLink\DeveloperKit\Windows\CompilerAdditions\mldev32\include),与C的源程序一起编译.

原贴见http://www.hotsim.com.cn/bbs/dispbbs.asp?boardID=3&ID=19&page=1

[ 本帖最后由 donna1997 于 2007-8-9 12:54 编辑 ]

评分

1

查看全部评分

发表于 2007-8-9 20:49:24 | 显示全部楼层 来自 江苏无锡
Simdroid开发平台
问个问题为何要混编啊?
回复 不支持

使用道具 举报

 楼主| 发表于 2007-8-10 10:37:36 | 显示全部楼层 来自 北京海淀
混编的作用是在mathematica中可以调用 VC编译好的程序,例如生成f.exe;Install["f.exe'];在VC中使用Mathematica计算的数据(VC中调用Mathematica函数).

评分

1

查看全部评分

回复 不支持

使用道具 举报

发表于 2007-8-10 11:13:29 | 显示全部楼层 来自 江苏无锡
Yes, we have many language, so we hate to write the code again and again ?
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-5-6 06:14 , Processed in 0.041999 second(s), 19 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表