


obtain facet validity cone from decomposition Syntax: hrep = obtainFacetValidityCone(dec, iFacet) obtainFacetValidityCone returns the facet validity cone for the given facet index as a H-representation. Use iFacet = 0 oder (nH+1) to obtain the cone for non-empty polytopes. See also: obtainDec, obtainCrystalDec


0001 function hrep = obtainFacetValidityCone(dec, iFacet) 0002 % obtain facet validity cone from decomposition 0003 % 0004 % Syntax: hrep = obtainFacetValidityCone(dec, iFacet) 0005 % 0006 % obtainFacetValidityCone returns the facet validity cone for the given 0007 % facet index as a H-representation. Use iFacet = 0 oder (nH+1) to obtain 0008 % the cone for non-empty polytopes. 0009 % 0010 % See also: obtainDec, obtainCrystalDec 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 if ~exist('iFacet', 'var') || isempty(iFacet) || iFacet == 0 0029 iFacet = dec.nH + 1; 0030 end 0031 0032 % index vector of constraints belonging to that facet 0033 constraintIdxVector = dec.facetValidityData.responsibleMatrix(... 0034 dec.facetValidityData.responsibleMatrix(:, 2) == iFacet, 1); 0035 hrep.A = dec.facetValidityData.A(constraintIdxVector, :); 0036 hrep.h = constraintIdxVector(:)*0;