


determine valid and invalid entries in a matrix of hC-vectors Syntax: isValidVecor = isValidDec(hcMatrix, dec, zerotol) See also: obtainDec, mapToConfinementCone, isConfinedDec


0001 function isValidVector = isValidDec(hcMatrix, dec, zerotol) 0002 % determine valid and invalid entries in a matrix of hC-vectors 0003 % 0004 % Syntax: isValidVecor = isValidDec(hcMatrix, dec, zerotol) 0005 % 0006 % See also: obtainDec, mapToConfinementCone, isConfinedDec 0007 0008 % The elk-library: convex geometry applied to crystallization modeling. 0009 % Copyright (C) 2013 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 %% input handling 0025 % ensure zerotol exists 0026 if ~exist('zerotol', 'var') 0027 zerotol = elkZerotol; 0028 end 0029 0030 % ensure hcMatrix has proper size 0031 if size(hcMatrix, 1) == dec.nC 0032 % everything OK 0033 elseif size(hcMatrix, 2) == dec.nC 0034 hcMatrix = hcMatrix'; 0035 else 0036 error('elk:decomposition:wrongInput', ['hcMatrix must contain '... 0037 'a hC-vectors in each column']); 0038 end 0039 0040 %% Operation 0041 if dec.isComplete 0042 isValidVector = all(dec.validityCone.A * hcMatrix < zerotol, 1); 0043 else 0044 isValidVector = all(dec.validityConePart.A * hcMatrix < zerotol, 1); 0045 end