简体   繁体   English

如何使用C ++启动和恢复Maple的结果

[英]How to launch and recover results of Maple with C++

I am using a C++ code which is preparing maple calculations commands sheets. 我正在使用正在准备Maple计算命令表的C ++代码。 OS used Ubuntu 12.04. 操作系统使用Ubuntu 12.04。 I would like to launch these maple files with my C++ program and recover the results in a text file. 我想用我的C ++程序启动这些maple文件,并在文本文件中恢复结果。

Do you know if there is a way doing it? 你知道有办法吗? Thank you in advance for your help. 预先感谢您的帮助。

Try MathLink for example. 例如,尝试使用MathLink。 Here's a nice tutorial like pdf how you can do that: http://www.edenwaith.com/development/tutorials/mathlink/ML_Tut.pdf 这是一个类似pdf的不错的教程,您如何做到这一点: http : //www.edenwaith.com/development/tutorials/mathlink/ML_Tut.pdf

Since you expect the results to somehow be useful in the C++ context can we presume that the results are arrays of numeric data? 既然您期望结果在C ++上下文中会以某种方式有用,我们是否可以假定结果是数字数据数组? If so then one approach might be to have the (worksheet) code save results to (text or binary) files. 如果是这样,那么一种方法可能是让(工作表)代码将结果保存到(文本或二进制)文件中。 See ExportMatrix . 请参见ExportMatrix

You might be able to run the worksheets using OpenMaple and, say, system[launch] . 您可能可以使用OpenMaplesystem [launch]来运行工作表。 But that might only be useful if the worksheets themselves saved the data (eg. to data file) when run. 但这仅在工作表本身在运行时保存了数据(例如保存到数据文件)时才有用。

An alternative might be to use RunWorksheet to run the worksheets as if they were procedures and get "return values" from the. 一种替代方法是使用RunWorksheet来运行工作表,就像它们是过程一样,并从中获取“返回值”。 You might be able to do that under OpenMaple. 您可能可以在OpenMaple下执行此操作。

Using .mpl text files for that Maple source (which can also be read into the GUI) might also make the kind of thing that you might want easier than using worksheets. 为该Maple源使用.mpl文本文件(也可以read到GUI中)也可能比使用工作表更容易。 Even better, when things get very involved, is having your reusable code be saved in .mla Library archives. 更好的是,当涉及到很多事情时,将可重用的代码保存在.mla库档案中。 But you may be able to get your to your goal without such refinements. 但是,如果不进行此类改进,您也许可以实现自己的目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM