1% r = CheckDMMAPRepresentation(D, prec)
3% Checks
if the input matrixes define a discrete time
MMAP.
5% All matrices D0...DK must have the same size, D0 must be a
6% transient probability matrix, D1 has only non-negative
7% elements, and the rowsum of D0+D1+...+DK
is 1 (up to the
12% D : list/cell of matrices, length(K)
13% The D0...DK matrices of the DMMAP to check
18% The result of the check
20function r = CheckDMMAPRepresentation(D,prec)
21% CheckDMMAPRepresentation [ (vector of D0, D1 .. DM), prec[10^-14] ] :
22% Checks if the input matrixes define a discrete time
MMAP: D0 and
23% the sum of D1..DM define a DMAP.
'prec' is the numerical precision.
25 global BuToolsVerbose;
26 global BuToolsCheckPrecision;
27 if isempty(BuToolsCheckPrecision)
28 BuToolsCheckPrecision = 1e-12;
31 if ~exist(
'prec',
'var')
32 prec = BuToolsCheckPrecision;
35 if min(min(cell2mat(D(2:end)))) < -prec
37 fprintf ('CheckDMMAPRepresentation: One of the matrices D1 ... DM has a negative element!\n');
43 r = CheckDMAPRepresentation(D{1},SumMatrixList(D(2:end)),prec);