


convert hC-vectors to lambda-vectors Syntax: lamMatrix = convertHcToLamFromDec(hcMatrix, dec) The hC-vectors in the columns of hcMatrix are converted to the scalar coefficients of a minkowski sum of the structuring elements such that lamMatrix has dec.nS rows and the same number of columns like hcMatrix. See also: obtainDec


0001 function lamMatrix = convertHcToLamFromDec(hcMatrix, dec) 0002 % convert hC-vectors to lambda-vectors 0003 % 0004 % Syntax: lamMatrix = convertHcToLamFromDec(hcMatrix, dec) 0005 % 0006 % The hC-vectors in the columns of hcMatrix are converted to the scalar 0007 % coefficients of a minkowski sum of the structuring elements such that 0008 % lamMatrix has dec.nS rows and the same number of columns like hcMatrix. 0009 % 0010 % See also: obtainDec 0011 0012 % The elk-library: convex geometry applied to crystallization modeling. 0013 % Copyright (C) 2013 Alexander Reinhold 0014 % 0015 % This program is free software: you can redistribute it and/or modify it 0016 % under the terms of the GNU General Public License as published by the 0017 % Free Software Foundation, either version 3 of the License, or (at your 0018 % option) any later version. 0019 % 0020 % This program is distributed in the hope that it will be useful, but 0021 % WITHOUT ANY WARRANTY; without even the implied warranty of 0022 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0023 % General Public License for more details. 0024 % 0025 % You should have received a copy of the GNU General Public License along 0026 % with this program. If not, see <http://www.gnu.org/licenses/>. 0027 0028 zerotol = elkZerotol; 0029 0030 %! Dev: Invalid vectors are not yet covered! 0031 %/ 0032 0033 lamMatrix = zeros(size(dec.se, 1), size(hcMatrix, 2)); 0034 for iSimplex = 1:length(dec.simplexPartition) 0035 thisFilterMatrix = dec.simplexPartition{iSimplex}.A*hcMatrix; 0036 thisFilterVector = sum(thisFilterMatrix < zerotol, 1) == dec.nC; 0037 0038 lamMatrix(dec.simplexPartition{iSimplex}.seIndexVector, ... 0039 thisFilterVector) = ... 0040 dec.simplexPartition{iSimplex}.mappingHcToLam * ... 0041 hcMatrix(:, thisFilterVector); 0042 end