让给
1 0 1
0 1 1
1 1 1
和
1
0
1
如何找到解决方案在哪里{}?
解决方案:基于 Wiedemann 算法,我们有. 我在Step2中感到困惑。怎么找? 难道只是列作为或者它是从 Krylov 序列创建的? 请帮我找到 M_s 和最小多项式?
Matlab代码:
%% Input Generation Matrix M, b and index ith
%% Output single symbol x
M=[1 0 1;0 1 1;1 1 1];
b=[1; 0; 1];
index=2;
[K N]=size(M);
Mt=M';
Imatrix=eye(K,K);
x=[];
for index=1:K
u_i=Imatrix(:,index);
se_Krylov=[];
se_Krylov(:,1)=u_i;
for i=2:(2*K) % due to i=1 is u_i
se_Krylov(:,i)=mod((Mt^i)*u_i,2);
end
%% M_s is the operator Mt retricted to S
M_s=se_Krylov(index,:);
%% Compute the polynominal using Berlekmap Massey
[f, LCP] = Berlekamp_Massey2(M_s);
d=size(f,2)-1; %deg of f: x^d+x^(d-1)+....
x_comma=zeros(K,1);
for i=d:-1:1
x_comma=mod(x_comma+f(d).*(Mt)^(i-1)*u_i,2);
end
x_single=mod(x_comma'*b,2) ;%Inner product
x(index)=x_single;
end