0001 function [isFeasible isOptimal]=checkSolution(res)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 if res.rcode==1001
0017 throw(MException('','The Mosek licence has expired'));
0018 end
0019 if res.rcode==1008
0020 throw(MException('','The Mosek licence file is missing'));
0021 end
0022 if res.rcode==1010
0023 throw(MException('','The Mosek licence used only supports small problems (up to 300 variables). Have you requested the correct licence?'));
0024 end
0025 isFeasible=false;
0026 isOptimal=false;
0027 if isfield(res,'sol')
0028 if isfield(res.sol,'bas')
0029
0030
0031 if isempty(strfind(res.sol.bas.prosta,'INFEASIBLE'))
0032 isFeasible=true;
0033 end
0034
0035
0036 if any(strfind(res.sol.bas.solsta,'OPTIMAL'))
0037 isOptimal=true;
0038 end
0039 else
0040 if isfield(res.sol,'int')
0041
0042
0043 if isempty(strfind(res.sol.int.prosta,'INFEASIBLE'))
0044 isFeasible=true;
0045 end
0046
0047
0048 if any(strfind(res.sol.int.solsta,'OPTIMAL'))
0049 isOptimal=true;
0050 end
0051 else
0052
0053
0054 return;
0055 end
0056 end
0057 end
0058 end