


add mapping information THIS IS NO USER FUNCTION


0001 function esDec = addUnifyingMappingData(esDec) 0002 % add mapping information 0003 % 0004 % THIS IS NO USER FUNCTION 0005 0006 % The elk-library: convex geometry applied to crystallization modeling. 0007 % Copyright (C) 2013 Alexander Reinhold 0008 % 0009 % This program is free software: you can redistribute it and/or modify it 0010 % under the terms of the GNU General Public License as published by the 0011 % Free Software Foundation, either version 3 of the License, or (at your 0012 % option) any later version. 0013 % 0014 % This program is distributed in the hope that it will be useful, but 0015 % WITHOUT ANY WARRANTY; without even the implied warranty of 0016 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0017 % General Public License for more details. 0018 % 0019 % You should have received a copy of the GNU General Public License along 0020 % with this program. If not, see <http://www.gnu.org/licenses/>. 0021 0022 % this will be the fields: 0023 % .mappingOriginalToNew 0024 % .mappingNewToOriginal 0025 % 0026 % To map an original hC vector to the extended embedding, we would do the 0027 % following: 0028 % 1) Compute the support measures for all facets of the extended 0029 % embedding 0030 % 2) Map to the hE vector via the normal mappingFullToReduced matrix 0031 % Since the computation of the support measures is dependent on the unified 0032 % partition, the overall mapping (mappingOriginalToNew) will also depend 0033 % on the unified partition. Additionally, we can construct the matrix 0034 % that maps from hC to h by the measure computation coefficients. 0035 0036 %% original decomposition with required measures 0037 dec = esDec.originalData; 0038 dec = rmfield(dec, 'measureData'); 0039 dec = addMeasureDataDec(dec, 'support', esDec.A); 0040 0041 %% generate mapping matrices 0042 esDec.originalData.mappingOriginalToNewList = cell(1, dec.nPU); 0043 esDec.originalData.mappingNewToOriginalList = cell(1, dec.nPU); 0044 0045 for iPart = 1:dec.nPU 0046 simplexIndex = esDec.originalData.unifiedToSimplexVector(iPart); 0047 mappingOriginalToFull = zeros(esDec.nH, dec.nC); 0048 for iRow = 1:esDec.nH 0049 mappingOriginalToFull(iRow, :) = ... 0050 dec.measureData.support.tensorHc{iRow}{simplexIndex}; 0051 end 0052 0053 esDec.originalData.mappingOriginalToNewList{iPart} = ... 0054 esDec.mappingFullToReduced * mappingOriginalToFull; 0055 esDec.originalData.mappingNewToOriginalList{iPart} = pinv(... 0056 esDec.originalData.mappingOriginalToNewList{iPart}); 0057 end