projectIncompleteDec

PURPOSE ^

project a complete proper representation

SYNOPSIS ^

function dec = projectIncompleteDec(dec, par)

DESCRIPTION ^

 project a complete proper representation

 Initial data is already present (facet normals, mapping, properData).
 
 THIS IS NO USER FUNCTION

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function dec = projectIncompleteDec(dec, par)
0002 % project a complete proper representation
0003 %
0004 % Initial data is already present (facet normals, mapping, properData).
0005 %
0006 % THIS IS NO USER FUNCTION
0007 
0008 % The elk-library: convex geometry applied to crystallization modeling.
0009 %   Copyright (C) 2014 Alexander Reinhold
0010 %
0011 % This program is free software: you can redistribute it and/or modify it
0012 %   under the terms of the GNU General Public License as published by the
0013 %   Free Software Foundation, either version 3 of the License, or (at your
0014 %   option) any later version.
0015 %
0016 % This program is distributed in the hope that it will be useful, but
0017 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0018 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0019 %   General Public License for more details.
0020 %
0021 % You should have received a copy of the GNU General Public License along
0022 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0023 
0024 %% validity cone + facet validity data
0025 % for an incomplete representation, the validity and confinement cone in
0026 %   its original meaning is unknown. Both are artificially set equal to the
0027 %   only known unified partition.
0028 dec.validityCone.A = dec.properData.unifiedPartition{1}.A * ...
0029     dec.properData.mappingNewToProper;
0030 % remove zero-rows and trim
0031 dec.validityCone.A = trimConstraintMatrix(dec.validityCone.A, ...
0032     par.zerotol, 1);
0033 % create unique rows: is done with addValidityCone
0034 
0035 % add validity cone information, which adds the fields: validityCone, se
0036 %   seScaledToClose, nS, centerRay. The following fiels are final:
0037 %   validityCone, centerRay - all other fields will be extended
0038 dec = addValidityCone(dec, dec.validityCone.A, par.zerotol);
0039 
0040 % confinement cone is equal
0041 dec.confinementCone = dec.validityCone;
0042 
0043 %% decomposition
0044 % initialize data
0045 dec = appendUnifiedPartition(dec);
0046 % append the one and only unified parition: it is always valid - if the
0047 %   projection is pointless, this partition is at most empty
0048 
0049 %! DEV: this caused trouble and I presume I don't need it when everything
0050 %    happens in the embedding, anyway.
0051 dec = appendUnifiedPartition(dec, 1:dec.nS, par.zerotol, 1, 1);
0052 
0053 %% Validity (orthogonal) mapping
0054 dec.validityMappingData = generateOrthogonalProjectionDataForCone(...
0055     dec.validityCone.A, ...
0056     dec.seScaledToClose(dec.validityCone.seIndexVector, :), ...
0057     par.zerotol);
0058 %/
0059 
0060 dec.isOrdinary = 0; % we can't know
0061 dec.isProper = 0;
0062 dec.isComplete = 0;
0063 
0064 dec.nPS = length(dec.simplexPartition);
0065 dec.nPU = length(dec.unifiedPartition);
0066 
0067 %% measure information
0068 
0069 % call convert measure tensor that was made for the conversion from the
0070 %   seTensor to the hcTensor:
0071 %     tensorFull - the full "original" tensor
0072 %     indexVector - the entries that are required from this full tensor; in
0073 %       this application, these are ALL entries
0074 %     mapping - the mapping matrix from hC to lam coordinates; here this is
0075 %       the mapping from hA to hE
0076 % Normalization of the tensor is already part of that function
0077 if ~isfield(dec.properData, 'measureData') || isempty(dec.properData.measureData)
0078     return
0079 end
0080 measureList = fieldnames(dec.properData.measureData);
0081 for iMeasure = 1:length(measureList)
0082     copyMeasure = dec.properData.measureData.(measureList{iMeasure});
0083     pasteMeasure.name = copyMeasure.name;
0084     pasteMeasure.dim = copyMeasure.dim;
0085     pasteMeasure.isPar = copyMeasure.isPar;
0086     pasteMeasure.par = copyMeasure.par;
0087     if ~pasteMeasure.isPar
0088         pasteMeasure.tensorHc = cell(1, dec.nPS);
0089         for iPart = 1:dec.nPS
0090             pasteMeasure.tensorHc{iPart} = convertMeasureTensorSe(...
0091                 copyMeasure.tensorHc{1}, ...
0092                 1:dec.properData.nC, ...
0093                 dec.properData.mappingNewToProper, ...
0094                 pasteMeasure.dim);
0095         end
0096     else
0097         pasteMeasure.tensorHc = cell(1, size(pasteMeasure.par, 1));
0098         for iPar = 1:size(pasteMeasure.par, 1)
0099         pasteMeasure.tensorHc{iPar} = cell(1, dec.nPS);
0100         for iPart = 1:dec.nPS
0101             pasteMeasure.tensorHc{iPar}{iPart} = convertMeasureTensorSe(...
0102                 copyMeasure.tensorHc{iPar}{1}, ...
0103                 1:dec.properData.nC, ...
0104                 dec.properData.mappingNewToProper, ...
0105                 pasteMeasure.dim);
0106         end
0107         end
0108     end
0109     dec.measureData.(measureList{iMeasure}) = pasteMeasure;
0110 end

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