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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
function tsgLoadConstructedPoints(lGrid, mX, mY)
%
% tsgLoadConstructedPoints(lGrid, mX, mY)
%
% loads the combination of inputs (mX) and outputs (mY) into the grid
% the points don't need to be in any particular order, but
% the i-th row of mX has to correspond to the i-th row of mY
% the points must be aligned to the gird, but may come from
% any level, e.g., grid level 3 can accept points from level 4 or up
% see loadConstructedPoints() in the on-line manual
%
% NOTE: this will call the C++ method beginConstruction() which will
% clear any currently set refinement
%
% INPUT:
%
% lGrid: a grid list created by tsgMakeXXX(...)
%
% mX : matrix of size N by number of dimensions
%
% mY : matrix of size N by number of outputs
%
[sFiles, sTasGrid] = tsgGetPaths();
[sFileG, sFileX, sFileV, sFileO, sFileW, sFileC, sFileL] = tsgMakeFilenames(lGrid);
sCommand = [sTasGrid,' -loadconstructed'];
sCommand = [sCommand, ' -gridfile ', sFileG];
tsgWriteMatrix(sFileX, mX);
sCommand = [sCommand, ' -xf ', sFileX];
lClean.sFileX = 1;
tsgWriteMatrix(sFileV, mY);
sCommand = [sCommand, ' -vf ', sFileV];
lClean.sFileV = 1;
[status, cmdout] = system(sCommand);
if (max(size(strfind(cmdout, 'ERROR'))) ~= 0)
disp(cmdout);
error('The tasgrid execurable returned an error, see above');
return;
else
if (~ isempty(cmdout))
fprintf(1,['Warning: Command had non-empty output:\n']);
disp(cmdout);
end
end
if (exist('lClean'))
tsgCleanTempFiles(lGrid, lClean);
end
end
|