📄 almostregularpermutation.m
字号:
function I=almostregularpermutation(K)
% c.berrou almost regular permutation
K=408;
P=43;
C=4;
B1=1;
B2=1;
B3=1;
for j=1:K
if mod(j-1,C)==0
Q=0;
I(j)=mod(P*(j-1)+Q,K);
elseif mod(j-1,C)==1
Q=4*B1;
I(j)=mod(P*(j-1)+Q,K);
elseif mod(j-1,C)==2
Q=4*P+4*B2;
I(j)=mod(P*(j-1)+Q,K);
elseif mod(j-1,C)==3
Q=4*P+4*B3;
I(j)=mod(P*(j-1)+Q,K);
end
end
end
end
% flag=0;
% for j=1:K
% for i=1:K
% if I(j)==I(i)& j~=i
% flag=flag+1;
% end
% end
% end
for j=1:K
if mod(j-1,C)==0
Q=0;
E(j)=mod(P*(j-1)+Q,K);
else if mod(j-1,C)==1
Q=4*B1;
F(j)=mod(P*(j-1)+Q,K);
else if mod(j-1,C)==2
Q=4*P+4*B2;
G(j)=mod(P*(j-1)+Q,K);
else if mod(j-1,C)==3
Q=4*P+4*B3;
H(j)=mod(P*(j-1)+Q,K);
end
end
end
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -