1% r = CheckPHRepresentation(alpha, A, prec)
3% Checks
if the given vector and matrix define a valid phase-
8% alpha : matrix, shape (1,M)
9% Initial vector of the phase-type distribution to check
10% A : matrix, shape (M,M)
11% Transient generator of the phase-type distribution to
13% prec : double, optional
14% Numerical precision. The
default value
is 1e-14.
19% True,
if vector alpha
is a probability vector and matrix
20% A
is a transient generator, and they have the same size.
22function r = CheckPHRepresentation (alpha, A, prec)
24 global BuToolsVerbose;
25 global BuToolsCheckPrecision;
26 if isempty(BuToolsCheckPrecision)
27 BuToolsCheckPrecision = 1e-14;
30 if ~exist(
'prec',
'var')
31 prec = BuToolsCheckPrecision;
34 if length(alpha)~=size(A,1)
36 fprintf ('CheckPHRepresentation:the vector and the matrix have different sizes!\n');
42 if ~CheckGenerator(A,true,prec) || ~CheckProbVector(alpha,true,prec)