I suggest Armadillo :
Armadillo - C ++ linear algebra library (mathematical mathematics), aimed at achieving a good balance between speed and ease of use
This is the C ++ template library:
A delayed-estimation approach is used (at compile time) to combine several operations into one and reduce (or eliminate) the need for temporary; this is automatically done through template metaprograms
A simple example from a web page:
#include <iostream> #include <armadillo> int main(int argc, char** argv) { arma::mat A = arma::randu<arma::mat>(4,5); arma::mat B = arma::randu<arma::mat>(4,5); std::cout << A*Bt() << std::endl; return 0; }
source share