pi2m1.m

来自「压缩文件中是Error Correction Coding - Mathemat」· M 代码 · 共 37 行

M
37
字号
function M = pi2m1(Pi,s,Lmax,k)% function M = pi2m1(Pi,s,Lmax,k)% The Koetter-Vardy algorithm A for mapping from a % reliability matrix Pi to a multiplicity matrix M% with a total number of s interpolation points% Copyright 2004 by Todd K. Moon% Permission is granted to use this program/data% for educational/research onlyif(nargin==3)  error('if Lmax is specified, k must be also');endif(nargin==4)  lspec = 1;else  lspec = 0;endPistar = Pi;M = zeros(size(Pi));Cost = 0;for i=1:s  [p,istar] = max(Pistar(:));  Pistar(istar) = Pi(istar)/(M(istar)+2);  m = M(istar)+1;  if(lspec)								% see if we want to include this	if( sqrt(2*(Cost+m)/(k-1)) > Lmax) 	% enough -- stop	  break;	end  end  M(istar) = m;  Cost = Cost + M(istar);  degbound = sqrt(2*Cost/(k-1))endCost

⌨️ 快捷键说明

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