Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Converting Mathematica into c++ code

544 views
Skip to first unread message

kristoph

unread,
Oct 3, 2007, 6:09:46 AM10/3/07
to
Dear all,

I'm quiet new at the subject but would like to know if there is a
possibility to convert mathematica code into c++ code. I'm simulating
thousands of stochastic dynamical systems. Calculations consists of
matrix inversion, nested lists, loops etc.

My Mathematica program is fast but unfortunately too slow for some
expansions. I read that c++ is suppose to be much faster but
unfortunately I have no experience in coding it. I know that there is
Mathcode c++ but this is a little expensive I have to say.

I'm very grateful for any comments and suggestions.

Thanks
Kristoph


Bill Rowe

unread,
Oct 4, 2007, 4:45:11 AM10/4/07
to
On 10/3/07 at 6:07 AM, kristop...@web.de (kristoph) wrote:

>I'm quiet new at the subject but would like to know if there is a
>possibility to convert mathematica code into c++ code. I'm
>simulating thousands of stochastic dynamical systems. Calculations
>consists of matrix inversion, nested lists, loops etc.

There are tools available that will convert *some* Mathematica
code to C++ code or C code. But I emphasize some. If the
Mathematica code involves specialized Mathematica functions,
they will not be converted to C++ nor is it reasonable to expect this.

>My Mathematica program is fast but unfortunately too slow for some
>expansions. I read that c++ is suppose to be much faster but
>unfortunately I have no experience in coding it. I know that there
>is Mathcode c++ but this is a little expensive I have to say.

Any compiled code that is appropriately optimized and debugged
with optimal algorithms can be expected to run faster than
Mathematica. But converting Mathematica code to something that
is optimal and can be compiled is far from a trivial task. If
you've no experience with C++, it is quite unlikely you will be
able to achieve the improvement you desire. It is far more
likely, in the time it takes you to get the code sufficiently
well optimized, debugged and compiled in C++, Mathematica could
have solved the original problem.
--
To reply via email subtract one hundred and four

0 new messages