%BDQZ  Block-diagonal QZ decomposition.
%
%   [AA,BB,TL,TR,BLKS] = BDQZ(A,B,CONDMAX) computes transformation matrices
%   TL and TR such that AA = TL'*A*TR and BB = TL'*B*TR are block diagonal
%   and each diagonal pair (AAj,BBj) is in QZ form:
%     * AAj is quasi upper-triangular (real case) or upper-triangular 
%       (complex case)
%     * BBj is upper-triangular with real diagonal.
%   The fifth output BLKS is the vector of block sizes.
%
%   The optional argument CONDMAX specifies an upper bound on the condition
%   number of TL and TR. The default value is CONDMAX=1e4. Use CONDMAX
%   to control the trade off between block size and accuracy of the
%   decomposition (the larger CONDMAX, the smaller the blocks are,
%   but the more ill-conditioned TL and TR can be).
%
%   [AA,BB,TL,TR] = BDQZ(A,B,[],BLKS) prespecifies the desired block sizes.
%   The input pair A,B must be in real or complex QZ form when using this
%   syntax (see QZ for details).
%
%   See also QZ, ORDQZ, COND.

%   Author(s): V. Sima, P. Gahinet
%   Copyright 2023 The MathWorks, Inc.

%   Based on LAPACK's DTGSYL, ZTGSYL, DGGES, ZGGES and SLICOT's 
%   MB04RD and MB04RZ routines.
