isConfinedDec

PURPOSE ^

determine confinement for a matrix of hC-vectors

SYNOPSIS ^

function isConfinedVector = isConfinedDec(hcMatrix, dec, zerotol)

DESCRIPTION ^

 determine confinement for a matrix of hC-vectors

 Syntax: isValidVecor = isValidDec(hcMatrix, dec)

 See also: obtainDec, isValidDec, mapToConfinementCone

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function isConfinedVector = isConfinedDec(hcMatrix, dec, zerotol)
0002 % determine confinement for a matrix of hC-vectors
0003 %
0004 % Syntax: isValidVecor = isValidDec(hcMatrix, dec)
0005 %
0006 % See also: obtainDec, isValidDec, mapToConfinementCone
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 %% 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 be a matrix '...
0037         ' of column hC-vectors']);
0038 end
0039 
0040 %% Operation
0041 if dec.isOrdinary
0042     isConfinedVector = all(dec.confinementCone.A * hcMatrix < zerotol, 1);
0043 else
0044     isConfinedVector = false(1, size(hcMatrix, 2));
0045     for iPart = 1:dec.nPU
0046         thisFilter = all(dec.unifiedPartition{iPart}.A * hcMatrix < zerotol, 1);
0047         isConfinedVector(thisFilter) = true;
0048     end
0049 end

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