是否可以使用 Accelerate/LAPACK 求解非方欠/过约束矩阵?
是否可以使用 Accelerate/LAPACK 求解非方欠/过约束矩阵?比如下面两个矩阵。如果任何变量受到约束,它们应该等于 0 而不是无限。
所以在约束条件下:A,D & E 等于 0,而 B、C 和 E 等于 0。 F 等于-1。
在过度约束的情况下,所有变量都将等于 -1。
约束不足:
____ ____
| (A) (B) (C) (D) (E) (F) |
| -1 0 0 1 0 0 | 0 |
| 1 0 0 0 -1 0 | 0 |
| 0 -1 1 0 0 0 | 0 |
| 0 1 0 0 0 -1 | 0 |
| 0 1 0 0 0 0 | -1 |
|____ ____|
约束过度:
____ ____
| |
| -1 0 0 1 0 0 | 0 |
| 1 0 0 0 -1 0 | 0 |
| 0 -1 1 0 0 0 | 0 |
| 0 1 0 0 0 -1 | 0 |
| 0 1 0 0 0 0 | -1 |
| 0 0 1 -1 0 0 | 0 |
| 1 -1 0 0 0 0 | 0 |
|____ ____|
Is it possible to solve a non-square under/over constrained matrix using Accelerate/LAPACK? Such as the following two matrices. If any variables are under constrained they should equal 0 instead of being infinite.
So in the under constrained case: A, D & E would equal 0, while B, C & F equal -1.
In the over constrained case all variables would be equal to -1.
Under Constrained:
____ ____
| (A) (B) (C) (D) (E) (F) |
| -1 0 0 1 0 0 | 0 |
| 1 0 0 0 -1 0 | 0 |
| 0 -1 1 0 0 0 | 0 |
| 0 1 0 0 0 -1 | 0 |
| 0 1 0 0 0 0 | -1 |
|____ ____|
Over Constrained:
____ ____
| |
| -1 0 0 1 0 0 | 0 |
| 1 0 0 0 -1 0 | 0 |
| 0 -1 1 0 0 0 | 0 |
| 0 1 0 0 0 -1 | 0 |
| 0 1 0 0 0 0 | -1 |
| 0 0 1 -1 0 0 | 0 |
| 1 -1 0 0 0 0 | 0 |
|____ ____|
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的!
相同的例程还将解决最小二乘意义上的超定系统(结果将是残差 ||Ax - b|| 的最小化)。
请注意,
dgels_
假设矩阵具有满秩(即,rank(A) = min(m, n))。如果不是这种情况,您将需要使用不同的例程 (dgelsd_
),该例程使用 SVD 分解而不是 QR。您似乎问了很多有关 LAPACK 的问题。非常值得您花时间阅读文档。
Yes!
The same routine will also solve over-determined systems in the least-squares sense (the result will be a minimizer of the residual ||Ax - b||).
Note that
dgels_
assumes that the matrix has full rank (i.e., rank(A) = min(m, n)). If this is not the case, you will need to use a different routine (dgelsd_
) that uses an SVD factorization instead of QR.You seem to be asking a lot of questions about LAPACK. It would be well worth your time to read the documentation.