HOME

TheInfoList



OR:

The Matrix Template Library (MTL) is a
linear algebra Linear algebra is the branch of mathematics concerning linear equations such as: :a_1x_1+\cdots +a_nx_n=b, linear maps such as: :(x_1, \ldots, x_n) \mapsto a_1x_1+\cdots +a_nx_n, and their representations in vector spaces and through matrices. ...
library for
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
programs. The MTL uses template programming, which considerably reduces the code length. All matrices and vectors are available in all classical numerical formats: float, double, complex or complex. Furthermore,
generic programming Generic programming is a style of computer programming in which algorithms are written in terms of types ''to-be-specified-later'' that are then ''instantiated'' when needed for specific types provided as parameters. This approach, pioneered b ...
allows the usage of arbitrary types as long as they provide the necessary operations. For instance one can use arbitrary integer formats (e.g. unsigned short), types for interval arithmetic (e.g. boost::interval) from the
Boost C++ Libraries Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It conta ...
,
quaternion In mathematics, the quaternion number system extends the complex numbers. Quaternions were first described by the Irish mathematician William Rowan Hamilton in 1843 and applied to mechanics in three-dimensional space. Hamilton defined a quatern ...
s (e.g. boost::quaternion), types of higher precision (e.g.
GNU Multi-Precision Library GNU Multiple Precision Arithmetic Library (GMP) is a free library for arbitrary-precision arithmetic, operating on signed integers, rational numbers, and floating-point numbers. There are no practical limits to the precision except the ones imp ...
) and appropriate user-defined types. The MTL supports several implementations of dense matrices and
sparse matrices In numerical analysis and scientific computing, a sparse matrix or sparse array is a matrix in which most of the elements are zero. There is no strict definition regarding the proportion of zero-value elements for a matrix to qualify as sparse b ...
. MTL2 has been developed by Jeremy Siek and Andrew Lumsdaine.J.G. Siek and A. Lumsdaine: ''The Matrix Template Library: A Generic Programming Approach to High Performance Numerical Linear Algebra''. ISCOPE 1998.
The latest version, MTL4, is developed by Peter Gottschling and Andrew Lumsdaine. It contains most of MTL2's functionality and adds new optimization techniques as meta-tuning, e.g.
loop unrolling Loop unrolling, also known as loop unwinding, is a loop transformation technique that attempts to optimize a program's execution speed at the expense of its binary size, which is an approach known as space–time tradeoff. The transformation ca ...
of dynamically sized containers can be specified in the function call. Platform-independent performance scalability is reached by recursive data structures and algorithms.P. Gottschling, D.S. Wise, and M.D. Adams: ''Representation-transparent matrix algorithms with scalable performance.'' ICS '07: Proc. 21st intern. conf. on Supercomputing, pp. 116--125, ACM Press, New York, 2007.
Generic applications can be written in a natural notation, e.g. v += A*q - w;, while the library dispatches to the appropriate algorithms: matrix vector products vs. matrix products vs. vector scalar products etcetera. The goal is to encapsulate performance issues inside the library and provide scientists an intuitive interface. MTL4 is used in different
finite element The finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat t ...
and finite volume packages, e.g. the
FEniCS Project The FEniCS Project is a collection of free and open-source software components with the common goal to enable automated solution of differential equations. The components provide scientific computing tools for working with computational meshes, f ...
.Dolfin web page within the FEniCS project.


See also

*
List of numerical libraries This is a list of numerical libraries, which are libraries used in software development for performing numerical calculations. It is not a complete listing but is instead a list of numerical libraries with articles on Wikipedia, with few exceptio ...


References

{{reflist


External links


MTL
homepage
MTL4
homepage C++ numerical libraries