1function special_values(varargin)
3 % check workspace info from arguments
5 wsInfo = gams.control.WorkspaceInfo();
6 wsInfo.systemDirectory = varargin{1};
7 ws = gams.control.Workspace(wsInfo);
9 ws = gams.control.Workspace();
25 '$gdxIn %gdxincname% '
26 '$load matlabUndef matlabNA matlabPInf matlabMInf matlabEps '
32 'abort$(GUndef <> matlabUndef) ''matlabUndef not as expected'', GUndef, matlabUndef;'
33 'abort$(GNA <> matlabNA ) ''matlabNA not as expected'', GNA, matlabNA; '
34 'abort$(GPInf <> matlabPInf ) ''matlabPInf not as expected'', GPInf, matlabPInf; '
35 'abort$(GMInf <> matlabMInf ) ''matlabMInf not as expected'', GMInf, matlabMInf; '
36 'abort$(GEps <> matlabEps ) ''matlabEps not as expected'', GEps, matlabEps '};
37 model = sprintf(
'%s\n', model{:});
39 dbIn = ws.addDatabase(
'myDB');
40 rec = dbIn.addParameter(
'matlabUndef', 0).addRecord();
42 rec = dbIn.addParameter(
'matlabNA', 0).addRecord();
44 rec = dbIn.addParameter(
'matlabPInf', 0).addRecord();
46 rec = dbIn.addParameter(
'matlabMInf', 0).addRecord();
48 rec = dbIn.addParameter(
'matlabEps', 0).addRecord();
49 rec.value = 4.94066E-324;
51 gj = ws.addJobFromString(model);
52 opt = ws.addOptions();
53 opt.defines(
'gdxincname', dbIn.name);
57 GUndef = dbOut.getParameter(
'GUndef').record.value;
59 error(
'GUndef not as expected: %f', GUndef);
61 GNA = dbOut.getParameter(
'GNA').record.value;
63 error(
'GNA not as expected: %f', GNA);
65 GPInf = dbOut.getParameter(
'GPInf').record.value;
67 error(
'GPInf not as expected: %f', GPInf);
69 GMInf = dbOut.getParameter(
'GMInf').record.value;
70 if ~isinf(GMInf) && GMInf < 0
71 error(
'GMInf not as expected: %f', GMInf);
73 GEps = dbOut.getParameter(
'GEps').record.value;
74 if GEps ~= 4.94066E-324
75 error('GEps not as expected: %f', GEps);
78 % clear option and database
82 %
remove working directory
83 rmdir(ws.workingDirectory,
's');