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.)
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
I am a big fan of Armadillo but your compiler may be an issue here according to the the end of the download page:
It is worth trying out as this is a well-designated (and mostly templated) library.
Otherwise, maybe try Eigen2 which lists your compiler as supported.
Edit: In response to the comment, Armadillo does not require Lapack but works better with it (and better still with tuned Blas):
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.
Boost has some basic linear algebra stuff.
You can use the C++ bindings of LAPACK. A quick google turned up this link to some LAPACK for Windows libraries. Depending on the how big your systems are all this might be overkill though.