Search code examples
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. OS used Ubuntu 12.04. I would like to launch these maple files with my C++ program and recover the results in a text file.

Do you know if there is a way doing it? Thank you in advance for your help.


Solution

  • Since you expect the results to somehow be useful in the C++ context can we presume that the results are arrays of numeric data? If so then one approach might be to have the (worksheet) code save results to (text or binary) files. See ExportMatrix.

    You might be able to run the worksheets using OpenMaple and, say, system[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. You might be able to do that under 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. Even better, when things get very involved, is having your reusable code be saved in .mla Library archives. But you may be able to get your to your goal without such refinements.