Go to the first, previous, next, last section, table of contents.

Pseudo-templates

There are some pseudo-template macros available in `templates_on.h' and `templates_off.h'. See a directory link `block' for details on how to use them. Use sparingly, they are a bit of a nightmare, but unavoidable in places.

In particular, the convention is: templates are used for operations on "data" only (vectors, matrices, statistics, sorting). This is intended to cover the case where the program must interface with an external data-source which produces a fixed type. e.g. a big array of char's produced by an 8-bit counter.

All other functions can use double, for floating point, or the appropriate integer type for integers (e.g. unsigned long int for random numbers). It is not the intention to provide a fully templated version of the library.

That would be "putting a quart into a pint pot". To summarize, almost everything should be in a "natural type" which is appropriate for typical usage, and templates are there to handle a few cases where it is unavoidable that other data-types will be encountered.

For floating point work "double" is considered a "natural type". This sort of idea is a part of the C language.


Go to the first, previous, next, last section, table of contents.