问题描述
我需要求解一个方程和约束条件不确定的线性系统,然后找到最小化成本函数的特定解决方案.这需要在将在.NET和Mono中运行的纯可移植托管代码中完成.我可以使用哪些免费的库来实现此目的?
I need to solve an under-determined linear system of equations and constraints, then find the particular solution that minimises a cost function. This needs to be done in purely portable managed code that will run in .NET and Mono. What freely available libraries are there that I can use to implement this?
我发现免费库提供的所有优化算法仅支持单个变量的时间间隔约束,例如0 < x < 1
,而不是像x + 2y < 4
这样的约束.我还发现,线性方程求解器通常仅支持具有一种解的线性系统.
All of the optimisation algorithms provided by free libraries I have found only support interval constraints on single variables, e.g. 0 < x < 1
, not constraints like x + 2y < 4
. I have also found that often the linear equations solvers only support linear systems with one solution.
到目前为止,我找到的最接近的是 DotNumerics ,其中包括用于解决欠定线性问题的奇异值分解系统,但其优化算法仅支持单变量约束(据我所知).
The closest I have found so far is DotNumerics, which includes Singular Value Decomposition for solving under-determined linear systems, but its optimisation algorithms only support single-variable constraints (as far as I can tell).
还有其他一些关于线性规划的问题,但是我的关键要求是多变量约束和解决不确定系统.我尚未找到支持多变量约束的免费库.
There are several other questions asking about linear programming, but my key requirements are multi-variable constraints and solving under-determined systems. I have yet to find a free library that supports multi-variable constraints.
推荐答案
ALGLIB 是常见的解决方法线性求解器之类的库.绝望之前,我会好好看一下.
ALGLIB is the usual go-to library for things like linear solvers. I would give that a good look before despairing.
这篇关于NET/C#的线性编程库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!