メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

cosets

R2026a

ガロア体の円周等分剰余の作成

構文

cst = cosets(m)

説明

cst = cosets(m) は、円周等分剰余 mod 2^m-1 を生成します。cell 配列 cst の各要素は、1 つの円周等分剰余を表すガロア配列です。

円周等分剰余は、同じ最小多項式を共有する一連の要素です。さらに、円周等分剰余 mod 2^m-1 は、GF(2^m) の非ゼロ要素の集合区画を形成します。円周等分剰余の詳細については、参考文献の文献を参照してください。

例

下記のコマンドは、GF(8) に対する円周等分剰余を求め、表示します。結果の解釈の例として、c{2} は A、A2、A2 + A が同じ最小多項式を共有することを示します。ここで、A は GF(8) の原始元です。

% DOCREFGFOBJ.M  Doc reference examples using Galois Field Object.
% This M-file covers the reference pages for the
% Galois object methods.

% Copyright 2002-2011 The MathWorks, Inc.

%-----------
% CONVMTX
% Should get ck1 = ck2 = 1

% begindocexample convmtx
m = 4;
c = gf([1; 9; 3],m); % Column vector
n = 6;
x = gf(randi([0 2^m-1],n,1),m);
ck1 = isequal(conv(c,x), convmtx(c,n)*x) % True
ck2 = isequal(conv(c',x'),x'*convmtx(c',n)) % True
%   enddocexample convmtx

ck_convmtx = [ck1 ck2]; % Not in doc. For testing purposes only.

%-----------
% DFTMTX
% Should get ck = 1

% begindocexample dftmtx
m = 4;
n = 2^m-1;
a = 3;
alph = gf(a,m);
mp = minpol(alph);
if (mp(1)==1 && isprimitive(mp)) % Check that alph has order n.
    disp('alph is a primitive nth root of unity.')
    dm = dftmtx(alph);
    idm = dftmtx(1/alph);
    x = gf(randi([0 2^m-1],n,1),m);
    y = dm*x; % Transform x.
    z = idm*y; % Recover x.
    ck = isequal(x,z)
end
%   enddocexample dftmtx

ck_dftmtx = ck; % Not in doc. For testing purposes only.

%-----------
% FFT
% Should get ck=1
% begindocexample fft
m = 4;
n = 2^m-1;
x = gf(randi([0 2^m-1],n,1),m); % Random vector
y = fft(x); % Transform of x
z = ifft(y); % Inverse transform of y
ck = isequal(z,x) % Check that ifft(fft(x)) recovers x.
%   enddocexample fft

ck_fft = ck; % Not in doc. For testing purposes only.

%-----------
% ISPRIMITIVE
% Should get a = [11;13], isp1=1, isp2=0
% begindocexample isprimitive
a = primpoly(3,'all','nodisplay'); % All primitive polys for GF(8)

isp1 = isprimitive(13) % 13 represents a primitive polynomial.

isp2 = isprimitive(14) % 14 represents a nonprimitive polynomial.
%   enddocexample isprimitive

%-----------
% LOG (part 1)
% Should get ck = 1
% begindocexample log
m = 4; x = gf([8 1 6; 3 5 7; 4 9 2],m);
y = log(x);
primel = gf(2,m); % Primitive element in the field
z = primel .^ y; % This is now the same as x.
ck = isequal(x,z)
%   enddocexample log

ck_log = ck; % Not in doc. For testing purposes only.

%-----------
% LOG (part 2)
% Should get yy = [0 1]
% begindocexample log2
m = 4; primel = gf(2,m);
yy = log([1, primel])
%   enddocexample log2

%-----------
% MINPOL
% Should get pl =  gf([1 0 0 1 1],1)
% begindocexample minpol
m = 4;
A = gf(2,m)
pl = minpol(A)
%   enddocexample minpol

%-----------
% MLDIVIDE
% Should get ck1 = ck2 = 1
% begindocexample mldivide
m = 4; A = gf([8 1 6; 3 5 7; 4 9 2],m);
Id = gf(eye(size(A)),m);
X = A \ Id;
ck1 = isequal(X*A, Id)
ck2 = isequal(A*X, Id)
%   enddocexample mldivide

ck_mldivide = [ck1 ck2]; % Not in doc. For testing purposes only.

出力は以下のようになります。

ans = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)
 
Array elements = 
 
     1


 
ans = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)
 
Array elements = 
 
     2     4     6


 
ans = GF(2^3) array. Primitive polynomial = D^3+D+1 (11 decimal)
 
Array elements = 
 
     3     5     7

参考文献

[1] Blahut, Richard E., Theory and Practice of Error Control Codes, Reading, MA, Addison-Wesley, 1983, p. 105.

[2] Lin, Shu, and Daniel J. Costello, Jr., Error Control Coding: Fundamentals and Applications, Englewood Cliffs, NJ, Prentice-Hall, 1983.

バージョン履歴

R2006a より前に導入

参考

|