1function Q_DT_MAP_ParsePara(C,C_name,D,D_name)
2%Q_DT_MAP_ParsePara checks the validity of the input matrices C, D as a
3%representation of a discrete-time MAP.
7 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
8 '%d has to be numeric',C_name);
11 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
12 '%s has to be numeric',D_name);
17 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
18 '%s has to be a real matrix',C_name);
21 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
22 '%s has to be a real matrix',D_name);
26if (size(C,1) ~= size(C,2))
27 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
28 '%s is not a square matrix',C_name);
30if (size(D,1) ~= size(D,2))
31 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
32 '%s is not a square matrix',D_name);
34if (size(C,1) ~= size(D,1))
35 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
36 'The matrices %s and %s do not have the same dimension',C_name,D_name);
40if (min(min(C)) < -10^(-14))
41 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
42 'The matrix %s contains negative data',C_name);
44if (min(min(D)) < -10^(-14))
45 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
46 'The matrix %s contains negative data',D_name);
50% check (sub)stochasticity
51if (max(sum(C,2)) > 1+10^(-14))
52 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
53 'The matrix %s has to be substochastic',C_name);
55if (max(sum(C+D,2)) > 1+10^(-14))||(min(sum(C+D,2)) < 1-10^(-14))
56 error(
'MATLAB:Q_DT_MAP_ParsePara:InvalidInput',...
57 'The matrix %s+%s has to be stochastic',C_name+D_name);