addMinkowskiPartitionData

PURPOSE ^

add acucmulated data to decomposition structure

SYNOPSIS ^

function dec = addMinkowskiPartitionData(dec, partitionData, zerotol)

DESCRIPTION ^

 add acucmulated data to decomposition structure

 the data was generated by generateMinkowskiPartition during
   decomposeCone.

 THIS IS NO USER FUNCTION

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dec = addMinkowskiPartitionData(dec, partitionData, zerotol)
0002 % add acucmulated data to decomposition structure
0003 %
0004 % the data was generated by generateMinkowskiPartition during
0005 %   decomposeCone.
0006 %
0007 % THIS IS NO USER FUNCTION
0008 
0009 % The elk-library: convex geometry applied to crystallization modeling.
0010 %   Copyright (C) 2012 Alexander Reinhold
0011 %
0012 % This program is free software: you can redistribute it and/or modify it
0013 %   under the terms of the GNU General Public License as published by the
0014 %   Free Software Foundation, either version 3 of the License, or (at your
0015 %   option) any later version.
0016 %
0017 % This program is distributed in the hope that it will be useful, but
0018 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0019 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0020 %   General Public License for more details.
0021 %
0022 % You should have received a copy of the GNU General Public License along
0023 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0024 
0025 %% initialize additional data
0026 dec.simplexPartition = cell(0);
0027 dec.unifiedPartition = cell(0);
0028 dec.simplexToUnifiedVector = [];
0029 dec.seIncidenceMatrix = eye(dec.nS, dec.nS);
0030 
0031 for iPart = 1:length(partitionData)
0032     % eliminate summands, which are existing SE's
0033     [thisSeMatrix decomposedSeIndexVector] = ...
0034         eliminateRows(partitionData(iPart).seMatrix, ...
0035                       dec.seScaledToClose, zerotol);
0036                   
0037     % store new SE's
0038     for iS = 1:size(thisSeMatrix, 1)
0039         dec.nS = dec.nS + 1;
0040         dec.seScaledToClose = [dec.seScaledToClose; ...
0041                                thisSeMatrix(iS,:)];
0042         dec.se = [dec.se; ...
0043                   scaleToReal(thisSeMatrix(iS, :), dec, zerotol)];
0044         decomposedSeIndexVector(end+1) = dec.nS;
0045         % structuring element can be added with itself without creating new
0046         %   facets
0047         dec.seIncidenceMatrix(dec.nS, dec.nS) = 1;
0048     end
0049                   
0050                   
0051     % save partition
0052     dec = appendUnifiedPartition(dec, decomposedSeIndexVector, zerotol, 1, 1);
0053 end
0054 
0055 dec.nPU = length(dec.unifiedPartition);
0056 dec.nPS = length(dec.simplexPartition);

Generated on Sat 18-Jul-2015 16:45:31 by m2html © 2005