简体   繁体   English

为什么Sprank(A)和A \\ b在Matlab中报告不同的排名?

[英]Why sprank(A) and A\b report different rank in matlab?

I have a point set P and I construct it's adjacent matrix A by k-nearest neighbor. 我有一个点集P,我用k最近邻居构造了它的相邻矩阵A。 Each row of A is [...+1...-1...], indicates a pair of neighbor points. A的每一行是[... + 1 ...- 1 ...],表示一对相邻点。 The size of A is 48348 x 8058, sprank(A) is 8058. But when I do the following, it gives me a warning: "Warning: Rank deficient, rank = 8055, tol = 8.307912e-10." A的大小为48348 x 8058,sprank(A)为8058。但是当我执行以下操作时,它给我一个警告:“警告:等级不足,等级= 8055,tol = 8.307912e-10。”

a=A*b; a = A * b; c=A\\a; c = A \\ a;

and norm(cb) is quite large. 并且norm(cb)很大。 It seems something is wrong with the adjacent matrix A, but I can't figure it out. 相邻矩阵A似乎有问题,但我无法弄清楚。 Thanks in advance! 提前致谢!

sprank only tells you how many rows/columns of your matrix have non-zero elements, while A\\b is reporting the actual rank of the matrix which indicates how many rows of your matrix are linearly independent . sprank仅告诉您矩阵中有多少行/列具有非零元素,而A\\b报告矩阵的实际等级,它指示矩阵中有多少行是线性独立的 For example, for following matrix: 例如,对于以下矩阵:

A = [-1  1  0  0;
      0  1 -1  0;
      1  0 -1  0; 
      0  0  1 -1]

sprank(A) is 4 but rank(A) is only 3 because you can write the third row as a linear combination of the other rows, specifically A(2,:) - A(1,:) . sprank(A)是4,而rank(A)只有3,因为您可以将第三行写为其他行的线性组合,特别是A(2,:) - A(1,:)

The issue that you need to address is either in how you're computing A (if you expect that to generate a system of linearly independent equations) or you need to find a way to use A that doesn't require factorizing a rank deficient matrix. 您需要解决的问题是如何计算A (如果希望生成线性独立方程组的系统),或者需要找到一种不需要分解秩不足矩阵的使用A的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM