1function Q_CT_MMAPK_ParsePara(D0,D0_name,D,D_name)
2%Q_CT_MMAPK_ParsePara checks the validity of the input matrices D0, D as a
3%representation of a Continuous-Time
MMAP[K]. D{i} holds the mxm matrix D_i.
7 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
8 '%s has to be numeric',D0_name);
13 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
14 '%s_%d has to be numeric',D_name, i);
20 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
21 '%s has to be a real matrix',D0_name);
25 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
26 '%s_%d has to be a real matrix',D_name,i);
31if (size(D0,1) ~= size(D0,2))
32 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
33 '%s is not a square matrix',D0_name);
36 if (size(D{i},1) ~= size(D{i},2))
37 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
38 '%s_%d is not a square matrices',D_name,i);
42if (size(D0,1) ~= size(D{1},1))
43 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
44 'The matrices %s and %s_1 do not have the same dimension',D0_name,D_name);
47 if (size(D{i},1) ~= size(D{i+1},1))
48 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
49 'The matrices %s_%d and %s_d do not have the same dimension',D_name,i,D_name,i+1);
53% check negativity of the diagonal entries of D0
54if (max(diag(D0)) > 10^(-14))
55 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
56 'Some diagonal entries of the matrix %s are not negative',D0_name);
58% check nonnegativity of the off-diagonal entries of D0
59if (min(min(D0-diag(diag(D0)) )) < -10^(-14))
60 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
61 'Some off-diagonal entries of the matrix %s are negative',D0_name);
63% check nonnegativity of matrices D{i}
65 if (min(min(D{i})) < -10^(-14))
66 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
67 'The matrix %s_%d contains negative data',D_name,i);
75if (max(sum(Dsum,2)) > 10^(-14)) || (min(sum(Dsum,2)) < -10^(-14))
76 error(
'MATLAB:Q_CT_MMAPK_ParsePara:InvalidInput',...
77 'The matrix %s+%s_1+...+%s_K must have zero row sum',D0_name,D_name,D_name);