1function varargout = qbd_fundmat(B, L, F, matrices, precision, maxNumIt)
2%QBD_FUNDMAT Cyclic-reduction fundamental matrices G (and optionally R) of a QBD.
3% Operates directly on
the raw level blocks (B,L,F) of a homogeneous QBD and
4% supports complex-valued L (as required when L
is shifted by -s*I in a
5% Laplace-domain transient analysis). This differs from QBD_RG, which builds
6%
the blocks from MAP representations and
is only exercised at real argument.
8% VARARGOUT = QBD_FUNDMAT(B, L, F, MATRICES) returns
the matrices named by
9%
the character codes in MATRICES (
default 'G'), in that order. Supported
10% codes:
'G',
'R',
'GR',
'RG'.
12% The G matrix
is obtained by cyclic reduction (Bini-Meini logarithmic
13% reduction); R
is recovered from G as R = Fm*(I-(Lm+Fm*G))^-1.
15% Copyright (c) 2012-2026, Imperial College London
17if nargin < 4 || isempty(matrices); matrices =
'G'; end
18if nargin < 5 || isempty(precision); precision = 1e-14; end
19if nargin < 6 || isempty(maxNumIt); maxNumIt = 50; end
23lamb = max(-real(diag(L)));
35while check > precision && numit < maxNumIt
36 Lstar = BF * BB + BB * BF;
39 BB = (II - Lstar) \ II;
44 check = min(norm(BB, inf), norm(BF, inf));
49outs = cell(1, length(matrices));
50for i = 1:length(matrices)
56 R = Fm * ((II - (Lm + Fm * G)) \ II);
60 line_error(mfilename, sprintf(
'unknown matrix code ''%c'' in ''%s''', c, matrices));