This manual consists of a short reference for the C language and a more substantial reference for version 2.1d of the CATAM software library, CCATSL: a collection of mathematical and graphical routines for use with a range of popular C compilers.
The CATAM projects, which originated in 1969 for Mathematics undergraduates in the University of Cambridge, with the object of encouraging computer exploration of aspects of the syllabus for the Mathematical Tripos. Originally, CATAM stood for Computer-Aided Teaching of Applied Mathematics, but this was extended several years ago to Computer-Aided Teaching of All Mathematics. It was pioneered by Dr Robert Harding of the Department of Applied Mathematics and Theoretical Physics (DAMTP); today it is supervised by the Computational Projects Assessors Committee, chaired by the Director Dr Nikolaos Nikiforakis of DAMTP.
Serious computer work begins in the second year: undergraduates become familiar with the C language, with the mathematical and graphical routines comprising CCATSL, and with networked computers. There are varied projects in the second year covering pure and applied, statistical and applicable mathematics. In the third year, the choice is very wide, and the projects relate directly to specific lecture courses in the Mathematical Tripos. These include fluid and solid mechanics, quantum theory, dynamics, general relativity, astrophysics, numerical methods, optimization, dynamical systems, number and group theory, algebra, analysis, statistics and probability. Most students now take the CATAM option, and it can contribute significantly towards the class of degree. The CATAM Software Library has been carefully designed to facilitate the programming of projects in C, removing much of the tedious work in equation solving, graphics, and screen layout. New users can begin with the high-level graphics routines where minimum knowledge is required, and gradually develop their expertise towards the lower levels which demand a more detailed understanding.
There is no argument today about the fundamental place of computer methods in mathematics. As is being demonstrated in research laboratories throughout the world, the combination of numerical methods with computer programming is bringing to life so much that was formerly intractable. Successful completion of CATAM projects implies the development of important programming and investigative skills of widespread value in industrial and commercial work, as well as in scientific research.
This version of the manual, in both printed form and online version, was prepared for the Faculty of Mathematics by Giles Thompson, based on the two previous versions: the Scientific Programmer's Toolkit by M. H. Beilby, R. D. Harding and M. R. Manning, which is the primary reference for the chapter on Mathematical routines, and the CATAM Manual by John Evans.
We will use a few typographical conventions throughout this manual.
A fixed-pitch font will indicate
text, possibly just single words, which would normally appear in a
program listing, such as printf.
Function definitions follow a standard layout:
| void CubicRootsCL ( |
double a, |
| double b, |
|
| double c, |
|
| int *nroots, |
|
| double *r1, |
|
| double *r2, |
|
| double *r3); |
|
Here we are presenting the definition of the function
CubicRootsCL, which solves a cubic equation. The
left-hand and middle columns give the return type (void) and the
name of the function (CubicRootsCL) while the right-hand column
gives the type of each argument. Note that some of the
arguments to CubicRootsCL are declared with a
* indicating that Cubic will use
nroots, r1, r2 and r3 to pass back information
about the roots of the cubic; the values of a, b
and c will not be changed by CubicRootsCL.
After a definition like this comes a
description of the meaning of all the arguments:
| a, b, c |
The coefficients in the cubic equation |
|
| nroots |
Pointer to a variable to hold the number of roots when CubicRootsCL returns. |
|
| r1, r2, r3 |
Pointers to variables to hold the roots, in non-decreasing order. |
From this information we can see that a typical call of
CubicRootsCL might look like
|
CubicRootsCL(0,-1, 0, &n, &a, &b, &c); |