computeSupportValueVrep

PURPOSE ^

calculates the support values for a polytope in V-representation

SYNOPSIS ^

function supportValue = computeSupportValueVrep(vrep, pointMatrix)

DESCRIPTION ^

 calculates the support values for a polytope in V-representation 

 Syntax: supportValue = computeSupportValueVrep(vrep, pointMatrix)

 The support function of a polytope P is defined as:
     h(P, x) = [max over all points y in P] y * x'
   where this function might contain multiple points x simultanously. They
   are given in each row of pointMatrix.

 Given an H-representation with the facet normals a(i) and the 
   corresponding distances h(i), it holds:
     h(P, a(i)) = h(i)

 See also: computeFeretVrep, computeProjectionAreaVrep, computeVolumeVrep,
   computeFacetAreaVrep, computeSupportValueHrep

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function supportValue = computeSupportValueVrep(vrep, pointMatrix)
0002 % calculates the support values for a polytope in V-representation
0003 %
0004 % Syntax: supportValue = computeSupportValueVrep(vrep, pointMatrix)
0005 %
0006 % The support function of a polytope P is defined as:
0007 %     h(P, x) = [max over all points y in P] y * x'
0008 %   where this function might contain multiple points x simultanously. They
0009 %   are given in each row of pointMatrix.
0010 %
0011 % Given an H-representation with the facet normals a(i) and the
0012 %   corresponding distances h(i), it holds:
0013 %     h(P, a(i)) = h(i)
0014 %
0015 % See also: computeFeretVrep, computeProjectionAreaVrep, computeVolumeVrep,
0016 %   computeFacetAreaVrep, computeSupportValueHrep
0017 
0018 % The elk-library: convex geometry applied to crystallization modeling.
0019 %   Copyright (C) 2012 Alexander Reinhold
0020 %
0021 % This program is free software: you can redistribute it and/or modify it
0022 %   under the terms of the GNU General Public License as published by the
0023 %   Free Software Foundation, either version 3 of the License, or (at your
0024 %   option) any later version.
0025 %
0026 % This program is distributed in the hope that it will be useful, but
0027 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0028 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0029 %   General Public License for more details.
0030 %
0031 % You should have received a copy of the GNU General Public License along
0032 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0033 
0034 if size(pointMatrix, 2) ~= size(vrep.V, 2)
0035     error('elk:polytope:wrongType', ...
0036         ['Specify the points in a matrix 1 point per row. Dimension with'...
0037         'V-representation polytope must match.']);
0038 end
0039 
0040 supportValue = -inf(size(pointMatrix, 1), 1);
0041 for iVertex = 1:size(vrep.V, 1)
0042     supportValue(:) = max(supportValue, pointMatrix * vrep.V(iVertex, :)');
0043 end

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