Pith. Sign in

REVIEW

A Basic Introduction on Math-Link in Mathematica

Mathematical Software · Submitted 1 Mar 2006 · 5 references

Pith's verdict: A beginner Mathematica tutorial that calls a Fortran program through a shell pipe but presents itself as MathLink; the central claim is mislabeled and unverified.

T0 · AI review

How this review was made: An AI referee (deepseek-v4-flash) read the paper on August 28, 2026 and answered a fixed list of questions about it. T0 is the starting level every paper gets. The levels describe how deeply Pith has checked the paper, never the authors.

  1. T0 AI review An AI read the paper and answered a fixed list of questions.
  2. T1 Audit Automatic checks that the references and files the paper relies on exist and match.
  3. T2 Compute The paper's code or calculations re-run with the same results.
  4. T3 Formal statement The claims written out in a formal math language a computer can read.
  5. T4 Proof Those claims proved, and the proof checked by computer.

How Pith checks papers →

· 3 major objections · 5 minor · Ask about this paper · The compiled record · Read the full review →
Challenge this review Comment (0) Read on arXiv ↗
Cite ▾
arXiv IDcs/0603005 (version 4)
Pith IDIVCIFS5X, Pith's permanent record of this paper and its review
CitationSantanu K. Maiti. "A Basic Introduction on Math-Link in Mathematica." arXiv:cs/0603005 (2006). https://pith.science/paper/IVCIFS5X
Cite this reviewBibTeX for Pith's review of this paper
Claim paper

Why Pith says this

Highlight any text to comment on it.

Referee report
The paper

The paper claims

This paper shows that a Fortran-90 program can be linked into a Mathematica notebook using two commands, Export and ReadList with a shell redirect.

The reading

This is a tutorial paper whose central claim is that an external Fortran-90 program can be coupled to a Mathematica notebook using proper mathlink commands rather than a formal interface. The worked example constructs two square matrices in Mathematica, exports them to a data file, calls a compiled Fortran executable with ReadList["!mat True], and reads the product matrix back so that Eigenvalues can be computed in the notebook. The paper says this makes tedious numerical work fast, because compiled Fortran does the heavy loop while Mathematica keeps the analysis. It is aimed at beginners and also gives guidance on compilation and optimization flags for Fortran source files.

What carries the argument

The central mechanism is the command pair Export["mat3.dat", output] and ReadList["!mat <mat3.dat", Number, RecordLists -> True]. Export writes the matrix order followed by the two input matrices as plain text; the '!' prefix tells Mathematica to execute the external command 'mat' with the file redirected as its standard input; the Fortran program reads the order n, reads matrices a and b, computes c = matmul(a,b), and prints the result; ReadList parses those printed numbers back into a flat list, and Partition reassembles them into the product matrix. The work of carrying the data is done entirely by a text file and standard input/output, which is why no C-level MathLink programming is needed.

Extended reading notes

Core claim

The paper's discovery is that the Mathematica command ReadList["!mat <mat3.dat", Number, RecordLists -> True] completes a working bridge between a notebook and a separately compiled Fortran-90 executable. In the worked example, Mathematica builds two square matrices, inserts a leading row containing the matrix order, exports the result to mat3.dat, invokes the external program 'mat' through the '!' shell escape, and reads back the product matrix, which is then partitioned and passed to Eigenvalues. The article presents this as a general recipe: with the right compiler command, the same Export/ReadList pattern links Fortran 77 and Fortran 95 programs as well. The surrounding tutorial material on starting Mathematica, writing programs, and local versus global variables is preparation for this main mechanism.

Load-bearing premise

The load-bearing premise is that the numbers written to mat3.dat line up exactly with the Fortran program's READ(*) sequence: first the matrix order n, then all n×n entries of a, then all n×n entries of b; the paper never verifies this ordering against the file it actually exports.

Editorial extensions

If this is right

  • For a fixed compiled executable, changing the single parameter ns in the notebook cell regenerates the data file and produces eigenvalues for matrices of that order.
  • The same Export/ReadList recipe can be reused for other Fortran programs (F77 or F95) by compiling with the appropriate command, such as xlf, f77, or xlf95.
  • A user can keep the executable in a separate directory and connect to it with SetDirectory, then restore the original directory with ResetDirectory.
  • Because the bridge uses only a text file and standard input/output, no knowledge of the MathLink C API is required to use the example.

Reading between the lines

Editorial extensions of the paper, not claims the author makes directly.

  • The described 'mathlink' is actually a text-file pipe: if a future version changes Mathematica's Export formatting or the Fortran READ order, the link breaks silently; a formal MathLink interface would not have that fragility.
  • The same stdin/stdout handoff should work for any compiled numerical program, not only Fortran, so the recipe generalizes to C, C++, or command-line programs that read numbers and print numbers.
  • A direct timing comparison between Mathematica's built-in matrix multiplication and the linked Fortran executable for large ns would make the speed claim testable; the paper reports no such measurement.
Original abstract

Starting from the basic ideas of mathematica, we give a detailed description about the way of linking of external programs with mathematica through proper mathlink commands. This article may be quite helpful for the beginners to start with and write programs in mathematica. In the first part, we illustrate how to use a mathemtica notebook and write a complete program in the notebook. Following with this, we also mention elaborately about the utility of the local and global variables those are very essential for writing a program in mathematica. All the commands needed for doing different mathematical operations can be found with some proper examples in the mathematica book written by Stephen Wolfram \cite{wolfram}. In the rest of this article, we concentrate our study on the most significant issue which is the process of linking of {\em external programs} with mathematica, so-called the mathlink operation. By using proper mathlink commands one can run very tedious jobs efficiently and the operations become extremely fast.

The compiled record

The paper's own sentences, arranged, kept beside the review and separate from it. Each label is drawn from a closed vocabulary; the number beside it is the probability the classifier gave that label. Numbers in the tables are the authors', checked by code. No sentence in this record was written by a model.

Compiled by classifier-1.13-20260917 via OpenRouter, question bank abstract-p1-20260923, 2026-09-23: 1 request, 5,555 input tokens, $0.0002 reported.

What the abstract itself states, as probabilities: claims first 0.03 · states limitation 0.12 · human participants 0.02 · controlled comparison 0.01 · randomized assignment 0.01 · states quantitative result 0.03 · compares with prior results 0.04 · mentions code or data availability 0.03.

The abstract, sentence by sentence

arXiv listing abstract v4. Results and the main claim are underlined; .

Starting from the basic ideas of mathematica, we give a detailed description about the way of linking of external programs with mathematica through proper mathlink commands. This article may be quite helpful for the beginners to start with and write programs in mathematica. In the first part, we illustrate how to use a mathemtica notebook and write a complete program in the notebook. Following with this, we also mention elaborately about the utility of the local and global variables those are very essential for writing a program in mathematica. All the commands needed for doing different mathematical operations can be found with some proper examples in the mathematica book written by Stephen Wolfram \cite{wolfram}. In the rest of this article, we concentrate our study on the most significant issue which is the process of linking of {\em external programs} with mathematica, so-called the mathlink operation. By using proper mathlink commands one can run very tedious jobs efficiently and the operations become extremely fast.

background contribution method result interpretation main claim

What the classifier reports for each sentence. The number is the probability it gave the label.
#sentencerolethe authors' own workstates the main conclusionstrength
s0 Starting from the basic ideas of mathematica, we give a detailed description about the way of linking of external programs with mathematica through proper mathlink commands. contribution 0.88 0.55 0.12 asserted 0.99
s1 This article may be quite helpful for the beginners to start with and write programs in mathematica. interpretation 0.71 0.07 0.08 hedged possibility 1.00
s2 In the first part, we illustrate how to use a mathemtica notebook and write a complete program in the notebook. contribution 0.44 0.49 0.03 asserted 1.00
s3 Following with this, we also mention elaborately about the utility of the local and global variables those are very essential for writing a program in mathematica. contribution 0.41 0.20 0.03 asserted 0.99
s4 All the commands needed for doing different mathematical operations can be found with some proper examples in the mathematica book written by Stephen Wolfram \cite{wolfram}. background 1.00 0.04 0.03 asserted 0.96
s5 In the rest of this article, we concentrate our study on the most significant issue which is the process of linking of {\em external programs} with mathematica, so-called the mathlink operation. contribution 0.90 0.27 0.13 asserted 0.96
s6 By using proper mathlink commands one can run very tedious jobs efficiently and the operations become extremely fast. interpretation 0.36 0.14 0.39 asserted 0.62

What kind of paper the classifier reports this is: method or tool 0.76 · evidence from argument 0.62.

What was examined, and what was not

sources read
  • arXiv listing abstract v4
not examined
  • full text
  • figures and tables
  • references and citing sentences
  • relations to other papers
levels run
  • P abstract
not run
  • S sections
  • T body sentences
  • C citations
  • R cross-paper relations

Every quoted sentence on this record is the authors'. Every label is from Pith's closed vocabulary, with the probability shown beside it. Every number in the measurements table is the authors', checked by code. Record as JSON

Figures
Figure 1. A 2D plot for a set of two random numbers.
Figure 2. Schematic representation of mathlink operations

Figures reproduced from arXiv:cs/0603005 by the authors.

References

Discussion

Disagree with the review, or know something it missed? Leave a comment, highlight any passage above to comment on it, or challenge this review formally.