


map hC-vector to the correspondent in embedding proper representation Syntax: heMatrix = convertToProperEmbedding(hcMatrix, dec) The resulting hE-vector is always valid. See also: obtainDec, mapFromProperEmbedding


0001 function heMatrix = mapToProperEmbedding(hcMatrix, dec, zerotol, ... 0002 partitionVector) 0003 % map hC-vector to the correspondent in embedding proper representation 0004 % 0005 % Syntax: heMatrix = convertToProperEmbedding(hcMatrix, dec) 0006 % 0007 % The resulting hE-vector is always valid. 0008 % 0009 % See also: obtainDec, mapFromProperEmbedding 0010 0011 % The elk-library: convex geometry applied to crystallization modeling. 0012 % Copyright (C) 2014 Alexander Reinhold 0013 % 0014 % This program is free software: you can redistribute it and/or modify it 0015 % under the terms of the GNU General Public License as published by the 0016 % Free Software Foundation, either version 3 of the License, or (at your 0017 % option) any later version. 0018 % 0019 % This program is distributed in the hope that it will be useful, but 0020 % WITHOUT ANY WARRANTY; without even the implied warranty of 0021 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0022 % General Public License for more details. 0023 % 0024 % You should have received a copy of the GNU General Public License along 0025 % with this program. If not, see <http://www.gnu.org/licenses/>. 0026 0027 if ~exist('zerotol', 'var') || isempty(zerotol) 0028 zerotol = elkZerotol; 0029 end 0030 if ~exist('partitionVector', 'var') || isempty(partitionVector) 0031 partitionVector = computePartitionIndexDec(dec, hcMatrix, zerotol, 1); 0032 end 0033 0034 heMatrix = dec.properData.mappingNewToProper * hcMatrix; 0035 % if decomposition is not complete, we have already finished 0036 if ~dec.isComplete,return;end 0037 0038 for iPart = 1:dec.nPU 0039 thisFilter = partitionVector == iPart; 0040 heMatrix(:, thisFilter) = ... 0041 dec.unifiedPartition{iPart}.projection.validity * ... 0042 heMatrix(:, thisFilter); 0043 end