Many people doing "serious" matrix stuff, rely on BLAS, adding LaPack / ATLAS (normal matrices) orUMFPACK (sparse matrices) for more advanced math. The reason is that this code is well-tested, stable, reliable, and quite fast. Furthermore, you can buy them directly from a vendor (e.g. Intel MKL) tuned towards your architecture, but also get them for free. uBLAS mentioned in Manuel's answer is probably the standard C++ wrapper around BLAS. And if you need something like LaPack later on, there arebindings to do so. However, none of these classes ticks your box for being templated and easy to use. Actually, I must admit, that I tend to call the C / Fortran interface directly when I use a BLAS / LaPack implementation, since I don't see much advantage in the C++ wrapper. If I a need a simple-to-use, general-purpose C++ matrix library, I tend to use Eigen (I used to use NewMatin the past). Advantages: quite fast on Intel architecture, probably the fastest for smaller matricesnice interfacealmost everything you expect from a matrix libraryyou can easily add new typesDisadvantages (IMO): single-processorslower for larger matrices and some advanced math than ATLAS (e.g. LU decomposition)only experimental support for sparse matrices.
SparseLib++ is a C++ class library for efficient sparse matrix computations across various computational platforms. The software package consists of matrix classes encompassing several sparse storage formats (e.g. compressed row, compressed column and coordinate formats), and providing basic functionality for managing sparse matrices. The Sparse BLAS Toolkit is used to for efficient kernel mathematical operations (e.g. sparse matrix-vector multiply) and to enhance portability and performance across a wide range of computer architectures. Included in the package are various preconditioners commonly used in iterative solvers for linear systems of equations. The focus is on computational support for iterative methods (for example, see IML++), but the sparse matrix objects presented here can be used in their own right.
SparseLib++ matrices can be built out of nearly any C++ matrix/vector classes; it is shipped with the MV++ classes by default.