C# Algebra Linear Library

一曲冷凌霜 提交于 2019-12-04 03:56:24

问题


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?


回答1:


See:

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

They are open source too!




回答2:


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.



来源:https://stackoverflow.com/questions/8563124/c-sharp-algebra-linear-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!