Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Algebra Linear Library

I'm looking for a C# linear algebra library.

I wan't to solve a homogeneous linear system with least squares minimization.

I've been trying to use some librarys but I was just able to find the trivial solution.

Any recommendations?

like image 570
Bruna Avatar asked Dec 19 '11 14:12

Bruna


2 Answers

See:

  • http://www.meta-numerics.net/
  • http://www.mathdotnet.com/
  • http://linearalgebra.codeplex.com/

They are open source too!

like image 147
Suminda Sirinath S. Dharmasena Avatar answered Oct 20 '22 03:10

Suminda Sirinath S. Dharmasena


As commenter oleksii mentioned, you can use Accord.NET to achieve this as well. But you can also use its Solver extension method for that instead of manually creating a SVD:

// Suppose you have matrices A and b and would
// like to find x such that Ax = b (solve for x). 

// So you would have matrices
double[,] A = ... // matrix A
double[]  b = ... // vector b

// Then all that is necessary is to call:
double[] x = A.Solve(b, leastSquares: true);

And that is it. It also works when b is a matrix as well.

Disclaimer: I am the author of this library.

like image 32
Cesar Avatar answered Oct 20 '22 02:10

Cesar