1function Q_DT_PH_ParsePara2(alpha,alpha_name,A,A_name)
2%Q_DT_PH_ParsePara checks the validity of the input parameters alpha, A as a
3%representation of a Discrete-Time PH distribution.
7 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
8 '%s has to be numeric', alpha_name);
11 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
12 '%s has to be numeric', A_name);
17 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
18 '%s has to be a real vector', alpha_name);
21 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
22 '%s has to be a real matrix', A_name);
26if (size(alpha,1) ~= 1)
27 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
28 '%s is not a row vector', alpha_name);
30if (size(A,1) ~= size(A,2))
31 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
32 '%s is not a square matrix', A_name);
34if (size(alpha,2) ~= size(A,1))
35 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
36 'The vector %s and the matrix %s do not have the same number of columns', alpha_name, A_name);
40if (min(alpha) < -10^(-14))
41 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
42 'The vector %s contains negative data', alpha_name);
44if (min(min(A)) < -10^(-14))
45 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
46 'The matrix %s contains negative data', A_name);
49% check (sub)stochasticity
50if (sum(alpha,2) > 1+10^(-14))
51 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
52 'The vector %s has to be (sub)stochastic', alpha_name);
54if (max(sum(A,2)) > 1+10^(-14))||(min(sum(A,2)) > 1-10^(-14))
55 error(
'MATLAB:Q_DT_PH_ParsePara:InvalidInput',...
56 'The matrix %s has to be substochastic', A_name);