LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_isfeasible.m
1function [TF] = mmap_isfeasible(MMAP,TOL)
2% Checks whether a MMAP is feasible up to the given tolerance.
3% If the tolerance is not specified, the default tolerance mapqntbx_feastol
4% is used.
5
6if (nargin == 1)
7 TOL = 10^(-mapqntbx_feastol);
8end
9
10for i = 1:length(MMAP)
11 if max(max(abs(imag(MMAP{1})))) > TOL
12 TF = 0;
13 return;
14 end
15end
16
17% rows of D0 + D1 sum to zero
18% diagonal elements of D0 are < 0
19% non-diagonal elements of D0 are >= 0
20% elements of D1 are >= 0
21TF = map_isfeasible(MMAP);
22if TF == 0
23 return;
24end
25
26C = length(MMAP)-2;
27
28% elements of D1c are >= 0
29for c = 1:C
30 smallest = min(min(MMAP{2+c}));
31 if (smallest < -TOL)
32 TF = 0;
33 return;
34 end
35end
36
37% D1 = D11 + D12 + ... + D1C
38S = MMAP{2};
39for c = 1:C
40 S = S - MMAP{2+c};
41end
42if max(max(abs(S))) > TOL
43 TF = 0;
44 return;
45end
46
47end