System of linear equations in C++?

Archagon picture Archagon · Mar 19, 2010 · Viewed 18.9k times · Source

I need to solve a system of linear equations in my program. Is there a simple linear algebra library for C++, preferably comprised of no more than a few headers? I've been looking for nearly an hour, and all the ones I found require messing around with Linux, compiling DLLs in MinGW, etc. etc. etc. (I'm using Visual Studio 2008.)

Answer

Chris H picture Chris H · Mar 19, 2010

I think Eigen is what you're looking for.

http://eigen.tuxfamily.org/index.php?title=Main_Page

It is a headers only library and compiles on many compilers. It even uses exotic assembly for faster math.

This is the page that shows off the linear solver api.

http://eigen.tuxfamily.org/dox-2.0/TutorialAdvancedLinearAlgebra.html

It has a few solvers with a simple api.