Next: Acknowledgements Up: An Efficient Symbolic-Numeric Environment Previous: Code optimization using

Conclusions and further enhancements

Many considerable shortcomings of Mathematica's format rules have been addressed. Particular attention has been given to the accuracy and syntax of translated code. At the same time Format.m has been written to perform efficiently, allow the user a high degree of control over the formatted output and interact seamlessly with the rest of the Mathematica system. The package has been written primarily for use with Splice but may also be used interactively within a session. The problem-specific editing of files has been minimised by the provision of numerous formatting options. Tedious syntax errors may thus be eliminated.

Many physical problems have a degree of mathematical structure which may be utilised in the formulation of a general template file. In this way precise mathematical information relating to a problem can be derived using Mathematica and passed to a more efficient computational environment.

It is possible to further enhance a symbolic-numeric interface by compiling, linking and executing programs and analysing results in a single Mathematica session. [11] provides an example of an interface for accessing numerical libraries in the Unix environment. Robb [5] has developed the commercial package InterCall, which links Mathematica with the NAG and IMSL libraries as well as user supplied routines. For example, InterCall facilitates the definition of a Mathematica function which executes external code. MacGregor and co-workers [14] also developed a code translation package for Mathematica as an internal project for Schlumberger plc., but this was never formally released.

A process analogous to the Splice form of unstructured communication will be available using TemplateFile in AXIOM [3] version 2.0 - along with additional tools for generating complete subprograms. However, the syntax of these additional tools is (necessarily) quite complicated in comparison with the template approach. The GENTRAN package [8] for REDUCE also enables the use of template files among other more complex techniques. Perhaps surprisingly there is no such facility yet in Maple.

Other utilities for C and FORTRAN code generation exist and may be useful. Public domain versions include:

  1. Toolpack (also available from NAG [22]) is a utility for formatting and rewriting FORTRAN code. The utility addresses some performance issues (such as vectorisation of loops) whilst maintaining logical structure.

  2. f2c - this is a FORTRAN to C translation tool. Complete source code is available from AT&T.

  3. GNU FORTRAN - this is a front end (in development) which uses f2c and the GNU CC compiler. For up to date information, see [7].
The program nb2tex is also useful for converting Mathematica notebooks into documents [19].

The package Format.m and related files are available from the MathSource archive [19] under the item number 0205-254. The current version supersedes that distributed as part of the electronic supplement to the Mathematica Journal [28]. The package Optimize.m and related files can be found under the item number 0206-592.


bondaren@thsun1.jinr.ru