scaleToReal

PURPOSE ^

scale input matrix of hC-vectors to some real geometry

SYNOPSIS ^

function seMatrix = scaleToReal(seMatrix, dec, zerotol)

DESCRIPTION ^

 scale input matrix of hC-vectors to some real geometry

 THIS FUNCTION IS NO USER FUNCTION.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function seMatrix = scaleToReal(seMatrix, dec, zerotol)
0002 % scale input matrix of hC-vectors to some real geometry
0003 %
0004 % THIS FUNCTION IS NO USER FUNCTION.
0005 
0006 % The elk-library: convex geometry applied to crystallization modeling.
0007 %   Copyright (C) 2012 Alexander Reinhold
0008 %
0009 % This program is free software: you can redistribute it and/or modify it
0010 %   under the terms of the GNU General Public License as published by the
0011 %   Free Software Foundation, either version 3 of the License, or (at your
0012 %   option) any later version.
0013 %
0014 % This program is distributed in the hope that it will be useful, but
0015 %   WITHOUT ANY WARRANTY; without even the implied warranty of
0016 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017 %   General Public License for more details.
0018 %
0019 % You should have received a copy of the GNU General Public License along
0020 %   with this program.  If not, see <http://www.gnu.org/licenses/>.
0021 
0022 %% info
0023 % This scaling preserves the position and scales the polytope to the mean
0024 %   width of 1. This is beneficial for S-representation with these SEs.
0025 %   From the sum of the lambda-vector, one can directly read the mean width
0026 %   and, hence, extrapolate a particle size!
0027 
0028 hrep.A = dec.A;
0029 for iSe = 1:size(seMatrix, 1)
0030     % old scaling
0031     % This scaling preserves the position but ensures that one facet
0032     %   exactly touches the unit sphere while the distance of all other
0033     %   facets to the origin will be smaller than 1 so that they intersect
0034     %   the unit sphere.
0035 
0036 %       seMatrix(iSe, :) = seMatrix(iSe, :) / ...
0037 %           max(seMatrix(iSe, :)*dec.mappingReducedToFull');
0038 
0039     % mean width scaling:
0040     hrep.h = dec.mappingReducedToFull*seMatrix(iSe, :)';
0041     %! DEV: the following line is not according to the intentions for
0042     %       zerotol but is necessary to get results for the decomposition.
0043     %       Even though, this solution is not nice it is quite valid scince
0044     %       crystal poloytopes are always centered at x0=[0 0 0].
0045     hrep.h(abs(hrep.h) < sqrt(zerotol) & hrep.h < 0) = 0;
0046     %/
0047     
0048     seMatrix(iSe, :) = seMatrix(iSe, :) / computeMeanWidthHrep(hrep, zerotol);
0049 end

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