Boost LA

boost/la/array_matrix_traits.hpp

This header introduces specializations of the matrix_traits, deduce_matrix and deduce_matrix2 templates that make it possible to pass 2D C arrays to any Boost LA function that takes a matrix of matching size.

For example, to compute the determinant of a square 2D C array matrix, you can use:

float a[4][4];
float det = determinant(a);

To use Boost LA operator overloads, at least one of the arguments must not be of a built-in type; for example, you can't multiply a C array matrix by a scalar by using operator*= directly. Use mref to work around this issue:

float a[4][4];
mref(a) *= 42;