C_1 = C_2
C_1 < C_2
The equality operator =
evaluates to true
if the codes C_1 and
C_2 are equal, and to false
otherwise. The inequality operator
<
evaluates to true
if the codes C_1 and C_2 are not equal,
and to false
otherwise.
Note that codes are equal if and only if their elements are equal. Codes can also be compared with objects of other types. Of course they are never equal.
gap> M := [ [0, 0], [1, 0], [0, 1], [1, 1] ];; gap> C1 := ElementsCode( M, GF(2) ); a (2,4,1..2)0 user defined unrestricted code over GF(2) gap> M = C1; false gap> C2 := GeneratorMatCode( [ [1, 0], [0, 1] ], GF(2) ); a linear [2,2,1]0 code defined by generator matrix over GF(2) gap> C1 = C2; true gap> ReedMullerCode( 1, 3 ) = HadamardCode( 8 ); true gap> WholeSpaceCode( 5, GF(4) ) = WholeSpaceCode( 5, GF(2) ); false
Another way of comparing codes is IsEquivalent
, which checks if two
codes are equi-valent (see IsEquivalent).
GAP 3.4.4