Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System of linear equations in C++? [closed]

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.)

like image 991
Archagon Avatar asked Mar 19 '10 01:03

Archagon


People also ask

What system of equations has no solution?

A system of linear equations has no solution when the graphs are parallel.

What are the 5 examples of linear equation?

Some of the examples of linear equations are 2x – 3 = 0, 2y = 8, m + 1 = 0, x/2 = 3, x + y = 2, 3x – y + z = 3. In this article, we are going to discuss the definition of linear equations, standard form for linear equation in one variable, two variables, three variables and their examples with complete explanation.

What is the solution to the system of linear equations?

The solution to a system of linear equations is the point which lies on both lines. In other words, the solution is the point where the two lines intersect.


2 Answers

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.

like image 50
Chris H Avatar answered Sep 20 '22 20:09

Chris H


Boost has some basic linear algebra stuff.

like image 20
ast4 Avatar answered Sep 19 '22 20:09

ast4