LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
CheckMMAPRepresentation.m
1% r = CheckMMAPRepresentation(D, prec)
2%
3% Checks if the input matrixes define a continuous time MMAP.
4%
5% All matrices D0...DK must have the same size, D0 must be a
6% transient generator matrix, D1 has only non-negative
7% elements, and the rowsum of D0+D1+...+DK is 0 (up to the
8% numerical precision).
9%
10% Parameters
11% ----------
12% D : list/cell of matrices, length(K)
13% The D0...DK matrices of the MMAP to check
14%
15% Returns
16% -------
17% r : bool
18% The result of the check
19
20function r = CheckMMAPRepresentation(H,prec)
21
22 global BuToolsCheckPrecision;
23 if isempty(BuToolsCheckPrecision)
24 BuToolsCheckPrecision = 1e-12;
25 end
26
27 if ~exist('prec','var')
28 prec = BuToolsCheckPrecision;
29 end
30
31 global BuToolsVerbose;
32
33 if min(min(cell2mat(H(2:end)))) < -prec
34 if BuToolsVerbose
35 fprintf ('CheckMMAPRepresentation: Some of the matrices H1 ... HM have a negative element!\n');
36 end
37 r=false;
38 return;
39 end
40
41 r = CheckMAPRepresentation(H{1},SumMatrixList(H(2:end)),prec);
42end