MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Converting Mathematica into c++ code

  • To: mathgroup at smc.vnet.net
  • Subject: [mg81835] Re: Converting Mathematica into c++ code
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Thu, 4 Oct 2007 04:31:29 -0400 (EDT)

On 10/3/07 at 6:07 AM, kristophs.post at 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


  • Prev by Date: Re: Multiple nests?
  • Next by Date: Optional arguments & FilterRules
  • Previous by thread: Converting Mathematica into c++ code
  • Next by thread: Re: Bug ???