% -*- texinfo -*- % @deftypefn {Function File} {@var{h} = } hammgen (@var{m}) % @deftypefnx {Function File} {@var{h} = } hammgen (@var{m},@var{p}) % @deftypefnx {Function File} {[@var{h},@var{g}] = } hammgen (@var{...}) % @deftypefnx {Function File} {[@var{h},@var{g},@var{n},@var{k}] = } hammgen (@var{...}) % % Produce the parity check and generator matrices of a Hamming code. The % variable @var{m} defines the [@var{n},@var{k}] Hamming code where % @code{@var{n} = 2 ^ @var{m} - 1} and @code{@var{k} = @var{n} - @var{m}}. % @var{m} must be between 3 and 16. % % The parity check matrix is generated relative to the primitive polynomial % of GF(2^@var{m}). If @var{p} is specified the default primitive polynomial % of GF(2^@var{m}) is overridden. @var{p} must be a valid primitive % polynomial of the correct order for GF(2^@var{m}). % % The parity check matrix is returned in the @var{m} by @var{n} matrix % @var{h}, and if requested the generator matrix is returned in the @var{k} % by @var{n} matrix @var{g}. % % @end deftypefn % @seealso{gen2par}