📄 greedysearch.m
字号:
%search a minimum weight parity check matrix for a generic parity check matrix using greedy algorithm
function H_opt=greedysearch(H_org,max_num,dead_upp)
n_k=size(H_org);
code_len=n_k(2);
chk_len=n_k(1);
msg_len=code_len-chk_len;
weight_opt=sum(sum(H_org));
dead_opt=dead_upp;
H_opt = H_org;
row2=1;
for i=1:max_num
H_temp = H_opt;
row1 = row2;
while (row1==row2)
row1 = randint(1,1,[1,chk_len]);
row2 = randint(1,1,[1,chk_len]);
end
tempcol1 = H_temp(row1,:);
tempcol2 = H_temp(row2,:);
tempsum = gfadd(tempcol1,tempcol2);
if sum(tempsum)<=sum(tempcol1)
H_temp(row1,:)=tempsum;
H_opt = H_temp;
elseif sum(tempsum)<=sum(tempcol2)
H_temp(row2,:)=tempsum;
H_opt = H_temp;
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -