home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 7.ddi / ROBUST.DI$ / BLKRSCH.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  1.3 KB  |  53 lines

  1. function [v,t,m] = blkrsch(a,Type,cut)
  2. %
  3. % Block-Ordered Real Schur Form
  4. %
  5. % [V,T,M] = BLKRSCH(A,TYPE,CUT) produces a real block-ordered
  6. %       decomposition of a real matrix A
  7. %
  8. %               V'AV = T = |B1  B12|
  9. %                          | 0   B2|
  10. %
  11. %               B1 = T(1:CUT,1:CUT)
  12. %               B2 = T(CUT+1:N,CUT+1:N)
  13. %
  14. %     Six types of ordering can be selected:
  15. %       
  16. %         Type = 1 --- Re(eig(B1)) < 0, Re(eig(B2)) > 0.
  17. %         Type = 2 --- Re(eig(B1)) > 0, Re(eig(B2)) < 0.
  18. %         Type = 3 --- Re(eig(B1)) > Re(eig(B2)).
  19. %         Type = 4 --- Re(eig(B1)) < Re(eig(B2)).
  20. %         Type = 5 --- abs(eig(B1)) > abs(eig(B2)).
  21. %         Type = 6 --- abs(eig(B1)) < abs(eig(B2)).
  22. %
  23.  
  24. % R. Y. Chiang & M. G. Safonov 4/4/86
  25. % Copyright (c) 1988 by the MathWorks, Inc.
  26. % All Rights Reserved.
  27.  
  28. %
  29. % ----- Ordered Complex Schur Decomposition :
  30. %
  31. [ra,ca] = size(a);
  32. [qn,tn,m,swap] = cschur(a,Type);
  33. %
  34. % ----- Find the Orthonomal basis :
  35. %
  36. if Type == 1
  37.   cut = m;
  38. end
  39. %
  40. if Type == 2
  41.   cut = ra-m;
  42. end
  43. %
  44. kk = -1;
  45. if cut == ra,     v = eye(ra);     t = a;     kk = 1;  end
  46. if cut == 0.,     v = eye(ra);     t = a;     kk = 1;  end
  47. if kk < 0
  48.      qord = [real(qn(:,1:cut)) imag(qn(:,1:cut))];
  49.      [v,r] = qr(qord);
  50.      t = v' * a * v;
  51. end
  52. %
  53. % ----- End of BLKRSCH.M ---- RYC/MGS 4/4/86 %