sprank
Structural rank
Syntax
Description
r = sprank( calculates the structural rank of
sparse matrix A)A.
Examples
Calculate the structural rank of a 2-by-4 matrix.
A = [1 0 2 0
2 0 4 0];
A = sparse(A);
rs = sprank(A)rs = 2
Compare the structural rank to the regular rank calculation.
rf = rank(full(A))
rf = 1
For this matrix, the structural rank is 2 since two of the columns are nonzero. But the actual rank of the matrix is 1 since the columns are multiples of each other.
Input Arguments
Input matrix, specified as a sparse matrix.
Data Types: single | double
Complex Number Support: Yes
More About
The structural rank of a matrix is the maximum rank of all matrices with the same nonzero pattern. A matrix has full structural rank if it can be permuted so that the diagonal has no zero entries.
The structural rank is an upper bound on the rank of a matrix, so it satisfies
sprank(A) >= rank(full(A)).
Here are some definitions of the structural rank in terms of other functions:
The structural rank is a "maximum matching" and is related to the Dulmage-Mendelsohn decomposition by
sprank(A) = sum(dmperm(A)>0).Unlike
dmperm, thematchpairsfunction also takes weights into account when it calculates matches. You can calculate a maximum matching by converting the matrix to 1s and 0s and maximizing the weight of the matches withmatchpairs(double(A~=0),0,'max'). The structural rank is then equal to the number of matches.
Extended Capabilities
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version History
Introduced before R2006aYou can specify the input matrix A as single precision. The
function still returns output arguments related to indexing, such as ordering and
permutation vectors, as type double.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)