File: tsgUsingConstruction.m

package info (click to toggle)
tasmanian 8.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,852 kB
  • sloc: cpp: 34,523; python: 7,039; f90: 5,080; makefile: 224; sh: 64; ansic: 8
file content (36 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (3)
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