The Math foundation classes form the backbone of the foundation classes and provide support for general scalar, vector, and matrix mathematics. These classes are designed to provide high-level interfaces to most linear algebra operations, yet are designed to be computationally efficient. For each category (e.g., vector), we provide a template (e.g., MVector), that implements all operations common to all classes in that category. We then proceed to implement specific types of vectors (e.g. VectorFloat), that contain selected specializations.

The scalar classes mirror the design of our IntegralTypes and provide C++ classes that implement each integral type. The vector and matrix classes then build on these and provide the associated data structures for each scalar. The principal use for these classes should be the implementation of mathematical operations. The data structures library also contains implementations of vectors and other such things that are intended to be general containers for those applications needing math-like data structures, but not the corresponding mathematical operations.

In addition to mirroring the types of classes in each category (i.e., Float, VectorFloat, MatrixFloat), we also provide common sets of functions across all categories. This degree of uniformity makes it easier to understand how to use these classes, and makes it straightforward to move between vector and matrix representations. We also abstract the user from many details of C programming with vectors, including efficient memory allocation (implemented through a centralized memory manager), automatic type conversions, and mixed-type mathematics (adding a constant to a vector, multiplying a vector by a matrix). Programming with the Math foundation classes is mainly procedural, looks similar to MATLAB or other such abstract languages, and yet provides the runtime efficiency of a compiled language.

There are three types of math classes: