MathGroup Archive 2004

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

Search the Archive

Re: From C/C++ to Mathematica?

  • To: mathgroup at
  • Subject: [mg48244] Re: From C/C++ to Mathematica?
  • From: "Roger L. Bagula" <rlbtftn at>
  • Date: Wed, 19 May 2004 02:42:28 -0400 (EDT)
  • References: <c8cgso$el9$>
  • Sender: owner-wri-mathgroup at

> With MathCode C++ you can also generate optimized C++ code for numerical simulations from Mathematica and link existing C, Fortran, or C++ code to your generated code.

MathCode C++

MathCode C++ 1.2
Generates Optimized C++ Code from Mathematica Programs

With MathCode C++ you can generate optimized C++ code that can be 
compiled and connected seamlessly into Mathematica.

Key Features

     * Generation of stand-alone C++ code from Mathematica code, 
optionally connected via MathLink to Mathematica
     * High-speed numeric computations
     * Automatic linking of existing C, C++, and Fortran 90 code into 
your MathCode-generated C++ code base
     * Extended matrix handling

The MathCode C++ code-generation system provides high performance, 
connectivity, and easy-to-use matrix arithmetic for the Mathematica 
developer. The core of the product is the translation of a subset of 
Mathematica code to C++. MathCode C++ requires an external C++ compiler 
to generate executables from the C++ source code (e.g., Microsoft Visual 
C++ on Windows platforms or CC/gcc on Unix platforms). However, all 
interaction with the compiler is handled by functions available in 
MathCode C++. A free compiler for Windows is shipped together with the 

MathCode C++ is excellent for the user who wants to generate optimized 
C++ code that can be compiled for efficient numerical calculations. 
Using MathCode C++ together with the included C++ compiler, Mathematica 
packages can be compiled to executables and connected seamlessly into 
Mathematica. Existing functions/libraries of C, C++, and Fortran 90 code 
can also be linked during compilation and connected into Mathematica.

MathCode C++ makes it possible to develop prototypes in the powerful 
interactive Mathematica environment. These prototypes can be 
automatically translated to fast production code in C++ and linked to 
external applications. MathCode C++ is ideal for people who want to take 
advantage of the speed of native C++ code.

Connectivity to C, C++, or Fortran 90 code is obtained by automatically 
generating MathLink code for calling generated code and external 
applications. Callbacks from external applications into Mathematica can 
also be generated automatically. This implies that Mathematica 
functionality which cannot easily be translated to C++ code can be 
utilized in external applications as well.

Generation of stand-alone external code is supported, and no runtime 
license is necessary for the distribution of compiled code. Functions in 
a Mathematica package that the user wants to compile must take numerical 
arguments and give numerical results for MathCode C++ to be able to 
generate C++ code. However, symbolic Mathematica code can be a part of 
function definitions, provided that the symbolic operations can be 
expanded to arithmetic expressions of an extended class of the 
elementary functions.

Thus, MathCode C++ opens up completely new possibilities for the user 
for cost-effective development of high-performance computational 
applications in the highly productive Mathematica environment.

Developed and supported by MathCore Engineering AB.

MathCore Engineering AB
Teknikringen 1B
SE-583 30 Linköping
phone: +46-(0)13-328500
fax: +46-(0)13-212701
email: info at

MathCode C++ requires Mathematica 3, 4, or 5 and is available for 
Windows, Linux, and Sun Solaris.

Tamagochee wrote:
> Hello,
> I am interested in porting a short program in C++ to Mathematica.
> Main part of the program are various operations on bits such as shifting,
> etc. Program performs decryption of a string that is encoded with public
> key. Since I am not certain I am permitted to post the full source code
> here, please contact me to my e-mail.
> Kind regards,
> Tamagochi

  • Prev by Date: RE: RE: Re: Kernel init.m File
  • Next by Date: Re: System of DE's
  • Previous by thread: From C/C++ to Mathematica?
  • Next by thread: RE: From C/C++ to Mathematica?