


returns basic information on the list of polytopes THIS FUNCTION IS PUBLISHED BUT TESTED AND MAINTAINED ONLY IN SCOPE OF APPLICATIONS (decomposition case study; technical reports) Syntax: info = identifyiPolytopeList(input) Where info is a structure containing: info.nPoly - number of polytopes in list info.dim - dimension of the polytopes info.rep - the representation of the input (equal for all elements) info.m - vector of number of facets/vertices The representation and the dimension must be consistent throughout the given list. see also: identifyPolytope, triangulatePolytope, subtractPolytope


0001 function info = identifyPolytopeList(input) 0002 % returns basic information on the list of polytopes 0003 % 0004 % THIS FUNCTION IS PUBLISHED BUT TESTED AND MAINTAINED ONLY IN SCOPE 0005 % OF APPLICATIONS (decomposition case study; technical reports) 0006 % 0007 % Syntax: info = identifyiPolytopeList(input) 0008 % 0009 % Where info is a structure containing: 0010 % info.nPoly - number of polytopes in list 0011 % info.dim - dimension of the polytopes 0012 % info.rep - the representation of the input (equal for all elements) 0013 % info.m - vector of number of facets/vertices 0014 % 0015 % The representation and the dimension must be consistent throughout the 0016 % given list. 0017 % 0018 % see also: identifyPolytope, triangulatePolytope, subtractPolytope 0019 0020 % The elk-library: convex geometry applied to crystallization modeling. 0021 % Copyright (C) 2012 Alexander Reinhold 0022 % 0023 % This program is free software: you can redistribute it and/or modify it 0024 % under the terms of the GNU General Public License as published by the 0025 % Free Software Foundation, either version 3 of the License, or (at your 0026 % option) any later version. 0027 % 0028 % This program is distributed in the hope that it will be useful, but 0029 % WITHOUT ANY WARRANTY; without even the implied warranty of 0030 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0031 % General Public License for more details. 0032 % 0033 % You should have received a copy of the GNU General Public License along 0034 % with this program. If not, see <http://www.gnu.org/licenses/>. 0035 0036 %% Input handling 0037 if ~iscell(input) 0038 error('elk:polytope:wrongInput', ... 0039 'Input must be a list (cell array) of either hrep or vrep'); 0040 end 0041 0042 %% Init 0043 info.nPoly = length(input); 0044 info.dim = getfield(identifyPolytope(input{1}), 'dim'); 0045 info.m = nan(1,info.nPoly); 0046 info.rep = getfield(identifyPolytope(input{1}), 'rep'); 0047 0048 for iElement = 1:length(input) 0049 thisInfo = identifyPolytope(input{iElement}); 0050 info.m(iElement) = thisInfo.m; 0051 0052 if thisInfo.dim ~= info.dim 0053 error('polytope:elk:wrongInput', ... 0054 'dimensions of the polytopes in the list are not equal'); 0055 end 0056 0057 if ~strcmpi(thisInfo.rep, info.rep) 0058 error('polytope:elk:wrongInput', ... 0059 'representations of the polytopes in the list not equal'); 0060 end 0061 end 0062 0063 info.rep = [info.rep 'List'];