kiss.m

来自「Lattice coding and decoding」· M 代码 · 共 55 行

M
55
字号
function varargout = kiss(latt,element)%KISS Lattice kissing number%   TAU = KISS(L,P) counts the kissing number in the particular %   element's P Voronoi region. In order to eliminate the finite lattice%   edge effects is better to use tracelatt function. This function%   counts the Voronoi cell parameters as well as the kissing number%   for all  lattice elements.%%   [TAU,SH] = KISS(L,P) also returns the kissing elements%   coordinates stored in SH matrix.%%   Note: KISS function gives sensible results only for geometrically%         uniform lattices.%%   See also TRACELATT, NBHOOD, SSHELL.%   Copyright 2001-2003 Kamil Anis, anisk@feld.cvut.cz%   Dept. of Radioelectronics, %   Faculty of Electrical Engineering%   Czech Technical University in Prague%   $Revision: 0.2 $  $Date: 2003/09/28 11:31:21 $%   --%   <additional stuff goes here>[npts,foo] = size(latt);ord = 1;thick = 1;coord = latt(element,:);center = repmat(coord,[npts 1]);dist = abs(latt - center);% find n-th smallest non-zero elementq = mapsto(dist,0,100);% row normsnn = dist .^ 2;nn = sum(nn,2);nn = nn .^ (1/2);nn = single(nn);% sort (unique) the shellsuu = unique(nn);rho_lo = uu(1 + ord);rho_hi = uu(ord + thick);pos = find((nn >= rho_lo) & (nn <= rho_hi));sh = latt(pos,:);tau = length(pos);varargout = {tau,sh}; 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?