The Matrix Template Library 2

  |   Home   |   Documentation   |  

The Matrix Template Library 2 (MTL2) is a high-performance generic component library that provides comprehensive linear algebra functionality for a wide variety of matrix formats.

As with the Standard Template Library (STL), MTL2 uses a five-fold approach, consisting of generic functions, containers, iterators, adaptors, and function objects, all developed specifically for high performance numerical linear algebra. Within this framework, MTL2 provides generic algorithms corresponding to the mathematical operations that define linear algebra. Similarly, the containers, adaptors, and iterators are used to represent and to manipulate concrete linear algebra objects such as matrices and vectors.

To many scientific computing users, however, the advantages of an elegant programming interface are secondary to issues of performance. Generic programming is a powerful tool in this regard as well - performance tuning can itself be described in a generic fashion. These performance tuning abstractions are realized in a generic low-level library - the Basic Linear Algebra Instruction Set (BLAIS). Experimental results show that MTL2 with the BLAIS achieves performance that is as good as, or better than, vendor-tuned libraries. Thus, MTL2 demonstrates that the proper abstractions can be used to achieve high levels of performance, contrary to conventional wisdom. In addition, MTL2 requires orders of magnitude fewer lines of code for its implementation, with the concomitant savings in development and maintenance effort.

News

  • July 5, 2005: Distribution 2.1.2-22, which is adapted to the stricter syntax requirements in new compilers like gcc 4.0 can be downloaded here.
  • In parallel, Peter Gottschling and Dave Abrahams started the development of MTL version 4.0. It was planned to have an alpha version already released. "A good plan today is better than a perfect plan tomorrow" Robert De Niro said in "Wag the dog". This is certainly true for crisis management but we doubt the same applies for scientific software development. This development is now continued in Germany at SimuNova UG with support from Dresden University of Technology, see here.

Features

The Matrix Template Library is:

Generic, Orthogonal, and Comprehensive:
MTL2 includes a large number of data formats and algorithms, including most popular sparse and dense matrix formats and functionality equivalent to Level 3 BLAS.
Flexible and Extensible:
The MTL2 interface is designed to allow new functionality to be easily incorporated.
High Performance:
With a good optimizing compiler, such as KAI's C++, MTL2 provides performance equal to (and in many cases better than) vendor-tuned math libraries.
Reliable:
MTL2 is extensively tested on a regular basis.
Portable:
MTL2 is written in ANSI C++ and can be compiled and used on any target platform with an ANSI C++ compiler. Currently, compilers known to work are KAI's C++ on various platforms, MIPSp ro 7.3 on SGI, Visual C++ 6.0 and Metrowerks CodeWarrior Pro 5 on NT, egcs-2.91.60 and gcc 2.95.x on various platforms. See FAQ for more information.

Last Release

This is version 2.1.2 of MTL2 and its second full release. The development of MTL2 is terminated.