|
|
|
|
Quelle chap3_mj.html
Sprache: HTML
|
|
| products/Sources/formale Sprachen/GAP/pkg/guava/doc/chap3_mj.html |
 |
< GAPpromptgt< span class=GAPinput "</pan>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
< html xmlns= "http://www.w3.org/1999/xhtml" xml:lang= "en">
< head>
< script type= "text/javascript"
src= "https://cdn.jsdelivr.net/npm/mathjax@2/MathJax<pan "APprompt>gt;/pan < "> java.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 88
</ script>
< title>GAP (guava) - Chapter 3: Codewords</ title>
< meta http-equiv= "content-type" content= "text/html; charset=UTF-8" />
< meta name= "generator" content= "<span class="GAPprompt">></span> <span class="GAPprompt "&;/span> span class="APinput "> n:= CharacterTable( Concatenation( Identifier( tblS ), "N ",</span>
< link rel= "stylesheet" type= "text/css" href= "manual.css" />
< script src= "manual.js" type= "text/javascript"></ script>
< script type= "text/javascript">overwriteStyle();</ script>
</ head>
< body class= "chap3" onload= "jscontent()">
< div class= "chlinktop">< span class= "chlink1">Goto Chapter: </ span>< a href= "chap0_mj.html">Top< /a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mj.html">4</a> <a href="chap5_mj.html">5</a> <a href="chap6_mj.html">6</a> <a href="chap7_mj.html">7</a> <a href="chap8_mj.html">8</a> <a href="chap9_mj.html">9</a> <a href="chapBib_mj.html">Bib</a> <a href="chapInd_mj.html">Ind</a> </div>
<div class="chlinkprevnexttop"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap2_mj.html">[Previous Chapter]</a> <a href="chap4_mj.html">[Next Chapter]</a> </div>
<p id="mathjaxlink" class="pcenter"><a href="chap3.html">[MathJax off]</a></p>
<p><a id="X836BAA9A7EBD08B1" name="X836BAA9A7EBD08B1"></a></p>
<div class="ChapSects"><a href="chap3_mj.html#X836BAA9A7EBD08B1">3 <span class="Heading">Codewords</span></a>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X81B73ABB87DA8E49">3.1 <span class="Heading">Construction of Codewords</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><pan class=="GAPprompt"><span><span class="APinput"> elif p = 2 then</span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7E7ED91C79BF3EF3">3.1-2 CodewordNr</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7F25479781E6E109">3.1-3 IsCodeword</a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="pan ="GAPprompt"&;/span><span class="GAPinput"> N_S: ppart normindices.(Identifier(tblS ) );</span>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X82D4BC7380741DAE"><code>3.2-1 \=</code></a></span>
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7ADE7E95867A14E1">3.3 <span
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X84BD38C87F3956FB"><code>3.3-1 \+</code></a></span>
<span class="ContSS"><br /<panclass=Gjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 136
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X86DC36217EC11723"><code>3.3-3 \+</code></a></span>
<></java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X7BBA5DCD7A8BD60D">3.4 <span class="Heading">
Functions that Convert Codewords to Vectors or Polynomials
</span</>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X87C8B0B178496F6A">3.4-1 VectorCodeword</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 87
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X81D3230A797FE6E3">3.5 <span class="Heading">
Functions that Change the Display Form of a Codeword
</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7E3E174B7954AA6B">3.5-1 TreatAsVector</a></span>
<span class="ContSS"><br /><span class="nocss"> </span><a <spanclass=""gt;/>spanclass="java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 106
</div></div>
<div class="ContSect"><span class="tocline"><span class="nocss"> </span><a href="chap3_mj.html#X805BF7147C68CACD">3.6 <span class="Heading">
OtherCodewordFunctions
</span></a>
</span>
<div class="ContSSBlock">
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X8000B6597EF0282F">3.6-1 NullWord</a></span>
<span class="< java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 67
<span class="ContSS"><br /><span class="nocss"> </span><a href="chap3_mj.html#X7B689C0284AC4296">3.6-3 Support</a></span>
<span class="ContSS"><br /><span class="nocss"> span ">gt/ span=java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 88
</div></div>
</div>
<h3>3 <span class="Heading">Codewords</span></h3>
<p>Let <span class="SimpleMath">\(GF(q)\)</span> denote a finite field with <span class="SimpleMath">\(q\span ">gt;/<class=> java.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 90
<p>In <strong class="pkg">GUAVA</strong>, a `codeword' is a GAP record, with one of its components being an element in <span class="SimpleMath">\(V\)</span>. Likewise, a `code' is a GAP record, with one of its components being a subset (or subspace with given java.lang.StringIndexOutOfBoundsException: Range [0, 265) out of bounds for length 109
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">C:=RandomLinearCode(20,10,GF(4));<span class=GAPprompt">span><spanclass=GAPinput>ClassPositionsOfPCore(tblM,p )})=ppart then/pan
a [20,10,?] randomly generated code over GF(4)
<span class="GAPprompt">gap></span> <span class="GAPinput">c:=Random(C);</span>
[ 1 a 0 0 0 1 1 a^2 0 0 a<span class="GAPprompt">></> <java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 90
<span class="GAPprompt">gap></span> <span class="GAPinput">Set(NamesOfComponents(C));</span>
[ "Basis", "Dimension", "GeneratorMat",
"GeneratorsOfLeftOperatorAdditiveGroup", "LeftActingDomain",
"NiceFreeLeftModule", "Representative", "WordLength", "ZeroImmutable",
]
<span class="GAPprompt">gap></span> <span class="GAPinput">Set(NamesOfComponents(c));</span>
[ "VectorCodeword", "WordLength", "treatAsPoly" ]
<span class="GAPprompt">gap></span> <span class="GAPinput">c!.VectorCodeword;</span>
< immutable compressed vector lengthspan =GAPprompt">></span> <span class="GAPinput"> fi;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">Display(last);</span>
[ Z(2^2), Z(2^2), Z(2^2), Z(2)^0, Z(2^2), Z(2^2)^2, 0*Z(2), Z(2^2), Z(2^2),
Z(2)^0, Z(2^2)^2, 0*Z(2), 0*Z(2), Z(2^2), 0*Z(2), 0*Z(2), 0*Z(2), Z(2
Z(2)^0, 0*Z(2) ]
<span class="GAPprompt">gap></span> <span class="<pan class="GAPprompt"&;/span><span class=GAPinput"#Inspect character tables ofsubgroups of M./span>
10
</pre></div>
<p>Mathematically, a `codeword' is an element of a code <span class="SimpleMath">\(C\)</span>, but in <strong class="pkg">GUAVA</strong> the <code class="code">Codeword</code> and <code class="code"<span =">gt;/>span class="GAPinput" f:=N_S /ppart;/span>
<p>A codeword <span class="SimpleMath">\(c\)</span> in a linear code <span class="SimpleMath">\(C\)</span> arises in practice by an initial encoding of a 'block' message <span class="SimpleMath">\(m\)</span>, adding enough redundancy to recover <span class="SimpleMath">\(m\)</span> after <span< class=GAPprompt">/span><pan class"GAPinput" for subname in NamesOfFusionSources( )do</>
<p>Many operations are available on codewords themselves, although codewords also work together with codes (see chapter <a href="chap4_mj.html#X85FDDF0B7B7D87FB"><span class="RefLink">4.</span></a> on Codes).</p>
<p>The first section describes how codewords are constructed (see <code<panclass"GAPprompt"><span><class"APinput" ClassPositionsOfKernel GetFusionMap(utblM /pan>
<p><a id="X81B73ABB87DA8E49" name="X81B73ABB87DA8E49"></a></p>
<h4>3.1 <span class="Heading">Construction of Codewords</span></h4>
<p><a id="X7B9E353D852851AA" name="X7B9E353D852851AAspan class=">;/ <class"> Sum( )<span>
<h5>3.1-1 Codeword</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; Codeword</code>( <var class="Arg">obj</var>[, <var class="Arg">n</var>][, <var class="Arg">F</var>] )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="code">Codeword</code> returns a codeword or a list of codewords constructed from <var class="Arg">obj</var>. The object <var class="Arg"> class=GAPprompt">< java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 107
<p>If a number <varspan "APprompt">></span> <span class="GAPinput"> fi;</span>
<p>If a Galois field <var class="Arg">F</var> is specified, all codewords are constructed over this field. This is the only way to make sure that all elements of <var class="Arg">obj</var> are converted to the same field <var class="Arg">F</var> (otherwise they are converted one by one). Note that all elements of <var class="Arg">obj</var> must have elements over <var class="Arg">F</var> or over `Integers'. Converting from one Galois field to another is not allowed. If no <var class="Arg">F</var> is specified, vectors or stringsspan class="GAPprompt">></span> <span class="GAPinput"> od;</span>
<p>Note that a significant speed increase is achieved if <var class="Arg">F</var> is specified, even when all elements of <var class="Arg">obj</var> already have elements over <var class="Arg">F</var>.</p>
<p>Every vector in <var class="Arg">obj</var> can be a finite field vector over <var class="Arg">F</var> or a vector over `Integers'. In the last case, it is converted to <var class="Arg">F</var> or, if omitted, to the smallest Galois field possible.</p>
<p>Every string in <var class="Arg"<span "APprompt>gt;/>span java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 72
<p>Every polynomial in <var class="Arg">obj</var> is converted to a codeword of length <var class="Arg">n</var> or, if omitted, of a length dictated by the <pre/>
<p>Every element of <var class="Arg">obj</var> that is already a codeword is changed to a codeword of length <var class="Arg">n</var>. If no <var class="Arg">n</var> was specified, the codeword doesn't change. If <var class="Arg">F</var> is specified, the codeword must have base field <var class="Arg">F</var>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">c := Codeword([0,1,1,1,0]);</span>
[ 01 1 0]
<span class="GAPprompt">gap></span> <span class="GAPinput">VectorCodeword( c ); </span>
[ 0*Z(2), Z(2)^0, Z(2)^0, Z(2)^0, 0*Z(2) ]
<span class="GAPprompt">gap></span> <span class="GAPinput">c2 := Codeword([0,1,1,1,0], GF(3));</span>
[ 0 1 1 1 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">VectorCodeword( c2 );</span>
[ 0*Z(3), Z(3)^0, Z(3)^0, Z(3)^0, 0*Z(3) ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Codeword([c,< class="center"\
[ [ 0 1 1 1 0 ], [ 0 1 1 1 0 ], [ 0 1 1 0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">p := UnivariatePolynomial(GF(2), [Z(2)^0, 0*Z(2), Z(2)^0]);</span>
x_1^2+Z(2)^0
<span class="GAPprompt">gap></span> <span class="GAPinput">Codeword(p);</span>
x^2 + 1
</pre></div>
<p>This command can also be called using the syntax <code class="code">Codeword(obj,C)</code>. In this format, the elements of
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">C := WholeSpaceCode(7,GF(5));</span>
a cyclic [7,7,1]0 whole space code over presentatives < java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 333
spanclass=GAPprompt">ap><span><class="APinput">Codeword(["0220110, [1,1,]], );/span>
[ [ 0 2 2 0 1 1 0 ], [ 1 1 1 0 0 0 0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Codeword(["0220110", [1,1,1]], 7, GF(5));</span>
[ [ 0 2 2 0 1 1 0 ], [ 1 1 1 0 0 0 0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">C:=RandomLinearCode(10,5,GF(3));</span>
a [10,5,?] randomly generated code over GF(3)
<span class="GAPprompt">gap<Forthe of a ="html#biBBG21">BG,Theorem 7.1]/a> we can discard all those entries from the list of <q>bad</q> <span class="SimpleMath">\(p\)</span> and <span class="SimpleMath">\(x\)</span> where <span class="SimpleMath">\(x\)</span> is not a <span class="SimpleMath">\(q\)</span>-element, for some prime <span class="SimpleMath">\(q\)</span>, or where another nonidentity <span class="SimpleMath">\(q\)</span>-element exists that does not occur in the list. This is done by collecting a second list <code class="code">badcases_thm</code> of the remaining <q>bad</q> cases.</p>
[ 0 0 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
<span class="GAPprompt">gap></span> <span class="GAPinput">Codeword("1000000000",10,GF(3));</span>
[ 1 0 0 0 0 0 0 0 0 0 ]
</pre></div>
<p><a id="X7E7ED91C79BF3EF3" name="X7E7ED91C79BF3EF3"></a></p>
<h5>3.1-2 CodewordNr</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; CodewordNr</code>( <var class="Arg">C</var>, <var class="Arg">list</var> )</td><td class="tdright">( function&java.lang.StringIndexOutOfBoundsException: Range [0, 220) out of bounds for length 0
<p><code class="code">CodewordNr</code> returns a list of codewords of <var class="Arg">C</var>. <var class="Arg">list</var> may be a list of integers or a single integer. For each integer of <var class="Arg"><divclass=">pre>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class=span class"GAPprompt"gapg;/pan>spanclass="GAPinput"badcases_thm:=[;<span>
a cyclic [23,12,7]3 binary Golay code over GF(2)
<span class="GAPprompt">gap></span> <span class="GAPinput">c := CodewordNr(B, 4);</span>
x^22 + x^20 + x^17 + x^14 + x^13 + x^12 + x^11 + x^10
<span class="GAPprompt">gap></span> <span class="GAPinput">R := ReedSolomonCode(2,2);</span>
a cyclic [2,1,2]1 Reed-Solomon code over GF(3)
<span class="GAPprompt">gap></span> <span class="GAPinput">AsSSortedList(R);</span>
[ [ 0 0] [1 ] 22 ]]
<span class="GAPprompt">gap></span> <span class="GAPinput">CodewordNr(R, [1,3]);</span>
[ [ 0 0 ], [ 2 2 ] ]
</pre></div>
<p><a id="X7F25479781E6E109" name="X7F25479781E6E109"></a></p>
<h5>3.1-3 IsCodeword</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code <span class="GAPprompt">gap></span> <span class="GAPinput">for name in Filtered( n&;x lt;gt;"" <span>
<p><code class="code">IsCodeword</code> returns `true' if <var class="Arg">obj</var>, which can be an object of arbitrary type, is < "gt;/span classGAPinput t:= );<>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCodeword(1);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">span class="GAPprompt">></span> <span class="GAPinput"> orders:=(t );/span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCodeword("11111");</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">IsCodeword(Codeword("11111"));</span>
true
</pre></div>
<< id=" =XB475B6>/a>/p>
<h4>3.2 <span class="Heading">Comparisons of Codewords</span></h4>
<p><a id="X82D4BC7380741DAE" name="X82D4BC7380741DAE"></a></p>
<h5><code>3.2-1 \=</code></h5>
< class"func "100"<>td"><java.lang.StringIndexOutOfBoundsException: Range [85, 79) out of bounds for length 235
<p>The equality operator <code class="code">c1 = c2</code> evaluates to `true' if the codewords <var class="Arg">c1</var> and <var class="Arg">c2</var> are equal, and to `false' otherwise. Note that codewords are equal if and only if their base vectors are equal. Whether they are represented as a vector or polynomial has nothing to do with the comparison.</p>
<p>Comparing codewords with objects of other types is not recommended, although it is possible. If <var class="Arg">c2</var> is the codeword, the other object <var class="Arg">c1</var> is first converted to a codeword, after which comparison is possible. This way, a codeword can be compared with a vector, polynomial, or string. If <var class="Arg">c1</var> is the codeword, then problems may arise if <var class="Arg">c2</var> is a polynomial. In that case, the comparison always yields a `false', because the spanclass==GAPprompt"&t<span><class>=java.lang.StringIndexOutOfBoundsException: Range [82, 81) out of bounds for length 147
<p>The equality operator span class"GAPprompt"&t;/java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 89
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">P := UnivariatePolynomialspan class="APprompt"&<span<class=">if , l& then</span>
x_1^3+Z(2)^0
<span class="GAPprompt">gap></span> <span class="GAPinput">c := Codeword(P, GF(2));</span>
x^3 + 1
<span class="GAPprompt">gap></span> <span class="GAPinput">P = c; # codeword operation</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">c2 := Codeword("1001", GF(2));</span>
[ 1 0 0 1 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">c = c2;</span>
true
<panclass"java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 87
a linear [7,4,3]1 Hamming (3,2) code over GF(2)
<span class="GAPprompt">gap></span> <span class="GAPinput">c1:=Random(C);</span>
[ 1 0 0 1 1 0 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">c2:=Random(C);</span>
[ 0 1 0 0 1 0 1 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">EQ(c1,c2);</span>
false
<spanclass==""&<>classjava.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 137
true
</pre></div>
<p><a id="X7ADE7E95867A14E1" name="X7ADE7E95867A14E1"></a></p>
<h4>3.3 <span class="Heading">Arithmetic Operations for Codewords</span></h4>
<p><a id="X84BD38C87F3956FB" name="X84BD38C87F3956FB"></a></p>
<h5><code>3.3-1 \+</code></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; \+</code>( <var class="Arg">c1</var>, <var class="Arg">c2</var> )</td><td class="tdright">( method )</td></tr<pan class="GAPprompt">></span> <span class="GAPinput"> if Length( ind ) <> 1 then</span>
<>following operations are java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 181
<p>The operator <code class="code">+</code> evaluates to the sum of the codewords <var class="Arg">c1</var> and <var class="Arg">c2</var>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">C:=RandomLinearCode(10,5,GF(3));</span>
a [10,5,?] randomly generated code over GF(3)
<span class="GAPprompt">gap></span> <span class="GAPinput">c:=Random(C);</span>
[ 1 0 2 2 2 2 1 0 2 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Codeword(c+"2000000000"spanclass="APprompt">&<span> span ="java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 101
[ 0 0 2 2 2 2 1 0 2 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Codeword(c+"1000000000spanclass="APprompt"&;/pan><span class"APinput" ;/java.lang.StringIndexOutOfBoundsException: Range [78, 77) out of bounds for length 78
Error, <x> and <y> have different characteristic
</pre></div>
<p>The last command returns a GAP ERROR since the `codeword' which <strong class="pkg">GUAVA</strong> associates to "1000000000" belongs to <span class="SimpleMath">\(GF(2)\)</span> and not <span class="SimpleMath">\(GF(3)\)</span>.</p>
<p><a id="X8692958781AF6CA8" name="X8692958781AF6CA8"></a></p>
<h5><code>3.3-2 \-</code></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; \-</code>( <var class="Arg">c1</var>, <var class="Arg">c2</var> )</td><td class="tdright">( method )</td></tr></table></div>
<p>Similar to addition: the operator <code class="code">-</code> evaluates to the difference of the codewords <var class="Arg">c1</var> and <var class="Arg">c2</var>.</p>
<p><a id="X86DC36217EC11723" name="X86DC36217EC11723"></a></p>
<h5><code>3.3-3 \+</code></h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; \+</code>( <var class="Arg">v</var>, <var class="Arg">C</var> )</td><td class="tdright">( method )</td></tr></table></div>
<> < ="+<code>evaluatesto coset <var class="Arg>/> after adding a`odeword'<varclass=Arg"v</ all java.lang.StringIndexOutOfBoundsException: Range [175, 174) out of bounds for length 529
<p>Note that the command <code class="code">C+v</code> returns the same output as the command <code class="code">v+C</code>.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">C:=RandomLinearCode(10,5);</span>
a [10,5,?] randomly generated code over GF(2)
<span class="GAPprompt">gap></span> <span class="span ="GAPprompt">></span> <span class="GAPinput"> badpos:= Filtered( [ 2 .. Length( sum ) ], i -> sum[i] >= 1 );</span>
[ 0 0 0 0 0 0 0 0 0 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">c+C;</span>
<add. coset of a [10,5,?] randomly generated code over GF(2)>
<span class="GAPprompt">gap></span> <span class="GAPinput">c+C=C;</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">IsLinearCode(c+C);</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">v:=Codeword("100000000");</span>
[ 1 0 0 0 0 0 0 0 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">v+C;</span>
<add. coset of a [10,5,?] randomly generated code over GF(span java.lang.StringIndexOutOfBoundsException: Range [13, 11) out of bounds for length 134
<span class="GAPprompt">gap></span> <span class="GAPinput">C=v+C;</span>
false
<span class="GAPprompt">gap></span> <span class="GAPinput">C := GeneratorMatCode( [ [1, 0,0,0], [0, 1,0,0] ], GF(2) );</span>
a linear [4,2,1]1..2 code defined by generator matrix over GF(2)
<span class="GAPprompt">gap></span> <span class="GAPinput">Elements(C);</span>
[ [ 0 0 0 0 ], [ 0 1 0 0 ], [ 1 0 0 0 ], [ 1 1 0 0 ] ]
<span class="GAPprompt">gap></span> <span class="GAPinput">v:=Codeword("0011");</span>
[ 0 0 1 1 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">C+v;</span>
l;dd.cosetofa[4241code matrixover 2&;
<span class="GAPprompt">gap></span> <span class="GAPinput">Elements(C+v);</span>
[ [ 0 0 1 1 ], [ 0 1 1 1 ], [ 1 0 1 1 ], [ 1 1 1 1 ] ]
</pre></div>
<p>In general, the operations just described can also be performed on codewords expressed as vectors, strings or polynomials, although this is not recommended. The vector, string or polynomial is first converted to a codeword, after which the normal operation is performed. For this to go right, make sure that at least one of the operands is a codeword. Further more, it will not work when the right operand is a polynomial. In that case, the polynomial operations (<code class="code">FiniteFieldPolynomialOps</code>) are called, instead of the codeword operations (<code class="code">CodewordOps</code>).</p>
<p>Some other code-<p>Some other code-orientedspan> < =GAPinput" andnot java.lang.StringIndexOutOfBoundsException: Range [101, 100) out of bounds for length 121
<p><a id="X7BBA5DCD7A8BD60D" name="X7BBA5DCD7A8BD60D"></a></p>
<h4>3.4 <span class="Heading">
Functions that Convert Codewords to Vectors or Polynomials
</span></h4>
<p><a id="X87C8B0B178496F6A" name="X87C8B0B178496F6A"></a></p>
<h5>3.4-1 VectorCodeword</h5>
"GAPinput ;/java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 82
<p>Here <var class="Arg">obj</var> can be a code word or a list of code words. This function returns the corresponding vectors over a finite field.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">a := Codeword("011011");; </span>
<span class="GAPprompt"><span class="GAPprompt">></span> <span class="GAPinput"> od;</span>
[ 0*Z(2), Z(2)^0, Z(2)^0, 0*Z(2), Z(2)^0, Z(2)^0 ]
</pre></div>
<p><a id="X822465E884D0F484" name="X822465E884D0F484"></a></p>
<h5>3.4-2 PolyCodeword</h5>
<div class="func"><table class="func" width="100%"><tr><td if not IsEmpty( badpos ) then</span>
<p><code class="code">PolyCodeword</code> returns a polynomial or a list of polynomials over a Galois field, converted from <var class="Arg">obj</var>. The object <var class="Arg">obj</var> can be a codeword, or a list of codewords.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">a := Codeword("011011");; </span>
<span class="GAPprompt">gap></span> <span class="GAPinput">PolyCodeword(a);</span>
x_1^5+x_1^4+span class="GAPpromp>gt;<span>><span class=fi;/
</pre></div>
<p><a id="X81D3230A797FE6E3" name="X81D3230A797FE6E3"></a></p>
<h4>3.5 <span class="Heading">
Functions that Change thespan =G>&<span><spanclass="APinput">fi;span>
</span></h4>
<p><a id="X7E3E174B7954AA6B" name="X7E3E174B7954AA6B"></a></p>
<h5>3.5-1 TreatAsVector</h5>
<div<span class=GAPprompt>gt;<span>< class="APinput"od;/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
<p><code class="code">TreatAsVector</code> adapts the codewords in <var class="Arg">obj</var> to make sure they are printed as vectors. <var class="Arg">obj</var> may be a codeword or a list of codewords. Elements of <var class="Arg">obj</var> that are not codewords are ignored. After this function is called, the codewords will be treated asspanclass="GAPprompt">></span> <span class="GAPinput"> od;</span>
<p>Note that this <em>only</em> changes the way a codeword is <em>printed</em>. <code class="code">TreatAsVector</code> returns nothing, it is called only for its side effect. The function <code class="code">java.lang.StringIndexOutOfBoundsException: Index 214 out of bounds for length 82
<div class="example"><pre>
<span class="[ [ "M23", 3, [ 3 ] ], H, 3,[4 11 ]]]
a cyclic [23,12,7]3 binary Golay code over GF(2)
<span class="GAPprompt">gap></span> <span class="GAPinput">c := CodewordNr(B, 4);</span>
x^22 + x^20 + x^17 + x^14 + x^13 + x^<span class"APprompt">ap&<span> span class"APinput"badcases_strong/span
<span class="GAPprompt">gap></span> <span class="GAPinput">TreatAsVector(c);</span>
<class="GAPprompt"gt<java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 71
[ 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 1 0 0 1 0 1 ]
</pre></div>
<p><a id="X7A6828148490BD2E" name="X7A6828148490BD2E"></a></p>
<eatAsPoly<h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; TreatAsPoly</code>( <var class="Arg">obj</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="code">TreatAsPoly</code> adapts the codewords in <var class="Arg">obj</var> to make sure they are printed as polynomials. <var class="Arg">obj</var> may be a codeword or a list of codewords. Elements of <var class="Arg">obj</var> that are not codewords are ignored. After this function is called, the codewords will be treated as polynomials. The finite field vector that["HS" ,[2 3 4,,6,7,9 ]],["",5 [,3,5] ]
<p>Note that this <em>only</em> changes the way a codeword is <em>printed</em>. <code class="code">TreatAsPoly</code> returns nothing, it is called only for its side effect. The function <code class="code">PolyCodeword</code>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">a := Codeword("00001",GF(2));</span>
java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 13
<span class="GAPprompt">gap></span> <span class="GAPinput">TreatAsPoly(a); a;</span>
x^4
<span class="GAPprompt">gap></span> <span class="GAPinput">b := NullWord(6,GF(4));</span>
[ 0 0 0 0 0 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">TreatAsPoly(b); b;</span>
0
</pre></div>
<p><a id="X805BF7147C68CACD" name="X805BF7147C68CACD"></a></p>
<h4>3.6 <span class="Heading">
Other Codeword Functions
</span></h4>
<p><a id="X8000B6597EF0282F" name="X8000B6597EF0282F"></a></p>
<h5>3.6-1 NullWord</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; NullWord</code>( <var class="Arg">n</var>, <var class="Arg">F</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p>Other uses: <code class="code">NullWord( n )</code> (default <span class="SimpleMath">\(F=GF(2)\)</span>) and <code class="code">NullWord( C )</code>. <code class="code">java.lang.StringIndexOutOfBoundsException: Index 181 out of bounds for length 0
<div class="example"><pre>
<span "APprompt"gapg</span><class=GAPinput">ullWord(8;/
[ 0 0 0 0 0 0 0 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Codeword("0000") = NullWord(4);</span>
true
<span class="GAPprompt">gap></span> <span class="GAPinput">NullWord(5,GF(16));</span>
[ 0 0 0 0 0 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">NullWord(ExtendedTernaryGolayCode());</span>
[ 0 0 0 0 0 0 0 0 0 0 0 0 ]
<re>/ivjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
<p><a id="X7CDA1B547D55E6FB" name="X7CDA1B547D55E6FB"></a></p>
<h5>3.6-2 DistanceCodeword</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; DistanceCodeword</code>( <var class="Arg">c1</var>, <var class="Arg">c2</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="code">DistanceCodeword</code> returns the Hamming distance from <var class="Arg">c1</var> to <var class="Arg">c2</var>. Both variables must be codewords with equal word length over the same Galois field. The Hamming distance between two words is the number of places in which they differ. As a result, <code class="code">DistanceCodeword</code> always returns an integer between zero and the word length of the codewords.</p>
< class
<span class="GAPprompt">gap></span> <span class="GAPinput">a := Codeword([0, 1, 2, 0, 1, 2]);; b := NullWord(6, GF(3));;</span>
<span class="GAPprompt">gap></span> <span class="GAPinput">DistanceCodeword(a, b);</span>
4
<span class="GAPprompt">gap></span> <span class="GAPinput">DistanceCodeword(b, a);</span>
4
<span class="GAPprompt"><spanclass="GAPprompt">< <java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 66
0
</pre></div>
<p><a id="X7B689C0284AC4296" name="X7B689C0284AC4296"></span="APprompt"><span<java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 107
<h5>3.6-3 Support</h5>
<div class="func"><table class="func" width="100%"><tr><td class="tdleft"><code class="func">an style='color: green'>8227; Support</code>( <var class="Arg">c</var> )</td><td class="tdright">( function )</td></tr></table></div>
<p><code class="code">Support</code> returns a set of integers indicating the positions of the non-zero entries in a codeword <var class="Arg">c</var>.</p>
<div class="example"><pre>
span class="GAPprompt">gap></span> <span class="GAPinput">a := Codeword("012320023002");; Support(a);</span>
[ 2, 3, 4, 5, 8, 9, 12 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Support(NullWord(7));</span>
[ ]
</pre></div>
<p>The support of a list with codewords can be calculated by taking the union of the individual supports. The weight of the support is the length of the set.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">L := Codeword(["000000", "101010", "222000"], GF(3));;</span>
<span=GAPprompt>gt;</ span class="GAPinput">S := Union(List(L i- );/span
[ 1, 2, 3, 5 ]
<span class="GAPprompt">gap></span> <span class="GAPinput">Length(S);</span>
4
</pre></ass="GAPprompt">></span> <span class="GAPinput"> S:= AtlasGroup( name );</span>
<p><a id="X7AD61C237D8D3849" name="X7AD61C237D8D3849"></a></p>
<h5>3.6-4 WeightCodeword</h5>
<div class="<span =">g;/ <java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 95
<p><code class="code">WeightCodeword</code> returns the weight of a codeword <span class="SimpleMath">\(c\)</span>, the number of non-zero entries in <var class="Arg">c</var>. As a result, <code class="code">WeightCodeword</code> always returns an integer between zero and the word length of the codeword.</p>
<div class="example"><pre>
<span class="GAPprompt">gap></span> <span class="GAPinput">WeightCodeword(Codeword("22222"));</span>
5
<span class="GAPprompt">gap></span> <span class="GAPinput">WeightCodeword(NullWord(3));</span>
0
<span class="GAPprompt">gap></span> <span class="GAPinput">C := HammingCode(3);</span>
a linear [7,4,3]1 Hamming (3,2) code over GF(2)
<span class="GAPprompt">gap></span> <span class="GAPinput">Minimum(List(AsSSortedList(C){[2..Size(C)]}, WeightCodeword ) );</span>
3
</pre></div>
<div class="chlinkprevnextbot"> <a href="chap0_mj.html">[Top of Book]</a> <a href="chap0_mj.html#contents">[Contents]</a> <a href="chap2_mj.html">[Previous Chapter]</a> <a href="chap4_mj.html">[Next Chapter]</a> </div>
<div class="chlinkbot"><span class="chlink1">Goto Chapter: </span><a href="chap0_mj.html">Top</a> <a href="chap1_mj.html">1</a> <a href="chap2_mj.html">2</a> <a href="chap3_mj.html">3</a> <a href="chap4_mjspan "java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 89
<hr />
<p class="foot">generated by <a href="https://www.math.rwth-aachen.de/~Frank.Luebeck/GAPDoc">GAPDoc2HTML</a></p>
</body>
</html>
¤ Dauer der Verarbeitung: 0.21 Sekunden
¤
*© Formatika GbR, Deutschland
|
|
2026-11-04
|
|
|
|
|
Neuigkeiten |
| Aktuelles |
| Motto des Tages |
|
Open Source Software |
|
|
|
Jenseits des Üblichen ....
|
|
Besucherstatistik |
|
|
| Statistik |
| #Sources=1104857 |
| #Domains=438801 |
|
|