The Iterative Template Library
Generic Components for High Performance Scientific Computing
  Search | Support |  Download 
 The MTL FAQ
 Introduction and General Information

What is MTL?

The Matrix Template Library (MTL) is a collection of generic components for high performance scientific computing.

MTL is not a "class library." The fundamental paradigm behind a class library is object-orientation. The fundamental paradigm behind MTL is genericity. (Just because MTL is written in C++ does not make it object-oriented -- generic programming is an independent paradigm from object-oriented programming.)

How do I install MTL?

See the INSTALL file in the MTL distribution for complete instructions. The basic steps are to invoke configure with appropriate options and then to make install. Since MTL is a collection of components consisting entirely of header files, there are no executables or libraries to be compiled as part of the installation process. Invoking make install simply copies the header files to the directory specified when you invoke configure (the default is /usr/local/include).

Where is the documentation?

The latest version of the MTL documentation can always be found on this site. In addition, the programmer's guide, in HTML format, is bundled in the MTL distribution. Once we hack perceps to spew latex instead of HTML, there will be documentation available suitable for printing. (Advisor's note: This is likely to be done sometime before Jeremy's thesis will be turned in this spring.)

What happened to Version 1?

"Be prepared to throw one version away, because you will anyway." -- F. Brooks, The Mythical Man Month.

 How To

How can I use MTL in conjunction with Blitz?

The easiest way (currently) to use MTL with Blitz arrays is to get a pointer to the data from the Blitz array (and also the stride information, also know as leading dimension) and construct an MTL matrix out of it (I call these matrices with "external" storage, and the constructors are documented as the "external data constructors"). You will want to look at matrices of type:
matrix < T, rectangle<>, dense < external > , row_major >::type
or
matrix < T, rectangle<>, dense < external >, column_major >::type

How do I use MTL with LAPACK?

See the examples.

How do I read in matrix or vector data files?

See the examples.
 Problems

How do I configure MTL to use KCC?

The MTL distribution uses configure to set up all of the Makefiles in the distribution tree. One of the things that gets set up when configure is run is the C++ compiler. To get configure to set you up with a particular compiler (in this example, KCC), issue the following commands (assuming csh) prior to running configure (with whatever other options you may be using):
unix% setenv CXX KCC
unix% setenv CCC KCC
unix% /bin/rm config.cache

What does this error message mean?

Coming soon - an annotated list of common error messages.

These error messages are impossible to understand?

Coming soon - an annotated list of common error messages.
 About MTL

What platforms are supported?

Presently, we have tested MTL on the following platforms:

  • IRIX64 6.4
  • SunOS 5.6
  • Linux 2.0.35
Since the compiler is the most important issue (see below), we expect that MTL will also work on closely similar platforms (e.g., SunOS 5.5).

Under Windows 9x or NT, MTL may possibly compile using egcs and one of the unix emulation environments such as cygwin or UWIN. We have tried neither but would be interested to know if anyone tries these out.

For compatibility with Visual C++, see What compilers are supported?

What compilers are supported?

MTL should work with any compiler that completely supports the ANSI C++ standard. The following compilers have been tested and are known to work:
  • SGI
    • MIPSpro Compilers: Version 7.2.1.1m
    • KAI C++ 3.3f
  • Solaris
    • KAI C++ 3.3e
    • egcs-2.91.60 (which is called version 1.1.1)
  • Linux
    • KAI C++ 3.3g
    • egcs-2.91.60
For commercial compilers, it seems that compilers based on the Edison Design Group front end are able to compile MTL.

MTL is known not to work with Microsoft Visual C++ through 6.0 (VC++ does not have partial specialization support). Version 4.0 of the Intel C++ compiler (which can plug into the Visual Studio Environment) is compliant enough with ANSI C++ to compile MTL. Unfortunately, it still relies on the VC++ header files, which must be hacked somewhat to allow MTL to compile (among other things, reverse_iterator and iterator_traits are broken). Version 4.0 is presently finishing its beta testing but should be released sometime in March 1999.

Nothing is known about other Windows compilers (e.g., Borland) at the present time.

Why is MTL written in C++ and not Fortran?

MTL has two particular strengths: genericity and high performance. To implement MTL, a language must support genericity and it must offer high performance. Presently, there are various languages that offer one or the other of these, but only C++ offers both. Fortran, for instance, has the reputation of offering high performance. However, it does not support generic programming. As our performance results clearly show, C++ can provide performance on par with Fortran.

There are even some applications where the presence of higher-level abstractions can allow significantly higher performance than Fortran.

Why is MTL written in C++ and not Java?

The Java language was developed for certain particular purposes. Scientific computing was not one of those purposes. Generic programming was not one of those purposes.

To offer sufficient performance for scientific computing, Java must be compiled to native object code, not byte code. To provide genericity, the Java language would have to be changed to include operator overloading and templates. Hmm. Templates, overloading, compilation to native object code.

On top of all that, Java has some problems with its floating point model.

 Miscellaneous

I work at a company and your license says MTL can only be used for non-commercial purposes. Does that mean I can't use it?

The license does not mean that you cannot freely use MTL if you work at a company. It does mean that you cannot sell a product that uses MTL without a commercial license from the University.

 About This Site

How did you create this site?

No WYSIWYG or GUI web site tools were used in the creation of this site.

We tried to automate the process of site creation and maintenance to the largest degree possible. The MTL component documentation was extracted from source code using a perl-based tool called perceps (somewhat hacked for our own purposes). The other pages were constructed based on on hand-edited php3 templates (using emacs). Finally, some stylistic elements are controlled with a cascading style sheet.

Images, shadows, stylized text were created using the Gimp.

Being somewhat artistically impaired, we found creating the site look and feel to be one of the hardest parts of this entire effort. Drawing and placing the little 5 pixel by 5 pixel shadows to get the corner shadows was the least fun (and they still don't look all that great).

If you have comments or suggestions, email mtl-devel@osl.iu.edu
Author: Andrew Lumsdaine,     Lie-Quan Lee,     Jeremy Siek
E-Mail: lums@osl.iu.edu,     llee@osl.iu.edu,     jsiek@osl.iu.edu
Created: July 27, 1998
Modified: Thu 24-Aug-2006 EST
Copyright ©1997-2012