majorization check

버전 1.1 (2.99 KB) 작성자: Andrew Knyazev
checks if X is (weakly) majorized by Y, where X and Y must be numeric arrays.
다운로드 수: 457
업데이트 날짜: 2015/5/15

라이선스 보기

MAJLE (Weak) Majorization check
S = MAJLE(X,Y) checks if the real part of X is (weakly) majorized by the real part of Y, where X and Y must be numeric (full or sparse) arrays. It returns S=0, if there is no weak majorization of X by Y, S=1, if there is a weak majorization of X by Y, or S=2, if there is a strong majorization of X by Y. The shapes of X and Y are ignored. NUMEL(X) and NUMEL(Y) may be different, in which case one of them is appended with zeros to match the sizes with the other and, in case of any negative components, a special warning is issued.
S = MAJLE(X,Y,MAJLETOL) allows in addition to specify the tolerance in all inequalities. [S,Z] = MAJLE(X,Y,MAJLETOL) also outputs a row vector Z, which appears in the definition of the (weak) majorization. In the traditional case, where the real vectors X and Y are of the same size, Z = CUMSUM(SORT(Y,'descend')-SORT(X,'descend')). Here, X is weakly majorized by Y, if MIN(Z)>0, and strongly majorized if MIN(Z)=0, see http://en.wikipedia.org/wiki/Majorization
The value of MAJLETOL depends on how X and Y have been computed, i.e., on what the level of error in X or Y is. A good minimal starting point should be MAJLETOL=eps*MAX(NUMEL(X),NUMEL(Y)). The default is 0.

One can use this function to check numerically the validity of the Schur-Horn,Lidskii-Mirsky-Wielandt, and Gelfand-Naimark theorems:

clear all; n=100; majleTol=n*n*eps;
A = randn(n,n); A = A'+A; eA = -sort(-eig(A)); dA = diag(A);
majle(dA,eA,majleTol) % returns the value 2
% which is the Schur-Horn theorem; and
B=randn(n,n); B=B'+B; eB=-sort(-eig(B));
eAmB=-sort(-eig(A-B));
majle(eA-eB,eAmB,majleTol) % returns the value 2
% which is the Lidskii-Mirsky-Wielandt theorem; finally
A = randn(n,n); sA = -sort(-svd(A));
B = randn(n,n); sB = -sort(-svd(B));
sAB = -sort(-svd(A*B));
majle(log2(sAB)-log2(sA), log2(sB), majleTol) % retuns the value 2
majle(log2(sAB)-log2(sB), log2(sA), majleTol) % retuns the value 2
% which are the log versions of the Gelfand-Naimark theorems

Revision: 1.0 $ $Date: 15-Mar-2010
Tested in MATLAB 7.9.0.529 (R2009b) and Octave 3.2.3.

인용 양식

Andrew Knyazev (2024). majorization check (https://www.mathworks.com/matlabcentral/fileexchange/26962-majorization-check), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.1

LGLP license replaced with BSD
added a conversion to a toolbox

1.0.0.0