1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
function [ result ] = tsgUsingConstruction(lGrid)
%
% tsgUsingConstruction(lGrid)
%
% return 0/1 indicating whether dynamic construction is enabled
% corresponds to TasmanianSparseGrid::isUsingConstruction()
%
% INPUT:
%
% lGrid: a grid list created by tsgMakeXXX(...)
%
% OUTPUT:
%
% result will be either 1 if the dynamic construction has been enabled
% or 0 if not enabled
% Note: lGrid is NOT modified by this command
%
[sFiles, sTasGrid] = tsgGetPaths();
[sFileG, sFileX, sFileV, sFileO, sFileW, sFileC] = tsgMakeFilenames(lGrid);
sCommand = [sTasGrid,' -using-construct'];
sCommand = [sCommand, ' -gridfile ', sFileG];
[status, cmdout] = system(sCommand);
if (max(size(strfind(cmdout, 'ERROR'))) ~= 0)
disp(cmdout);
error('The tasgrid execurable returned an error, see above');
return;
else
result = (norm( size(strfind(cmdout, 'enabled')) ) > 0);
end
end
|