Skip to content

Commit

Permalink
fix: Fix missing local-variable (#6)
Browse files Browse the repository at this point in the history
* fix: Fix missing local-variable

* feat: Add more tests and transposed method
  • Loading branch information
limakzi authored Apr 2, 2024
1 parent d386d7d commit a99471f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/utils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ DeclareGlobalFunction( "IsMagmaIsomorphic" );
#! are anti-isomorphic.
DeclareGlobalFunction( "IsMagmaAntiisomorphic" );

#! @Arguments [M]
#! @Description
#! generates transposed magma <A>M</A> (a string)
DeclareGlobalFunction( "TransposedMagma" );


#! @Arguments [M]
#! @Description
Expand Down
7 changes: 6 additions & 1 deletion lib/utils.gi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ InstallGlobalFunction(IsAntiassociative,
return true;
end);

InstallGlobalFunction(TransposedMagma,
function(M)
return MagmaByMultiplicationTable(TransposedMat(MultiplicationTable(M)));
end);

InstallGlobalFunction(MagmaIsomorphism,
function(M, N)
local psi, n, p, m, elms;
Expand Down Expand Up @@ -71,7 +76,7 @@ end);

InstallGlobalFunction(HasPropertyA3,
function(M)
local partitions, s, p, ns, rows_cartesian, bool_across_values;
local partitions, s, p, ns, rows_cartesian, bool_across_values, bool_across_partitions;
ns := GeneratorsOfMagma(M);
for s in [ 2 .. Size(M) ] do
partitions := PartitionsSet(ns, s);
Expand Down
13 changes: 13 additions & 0 deletions tst/test_utils_hasproperty_a3.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
gap> START_TEST("smallantimagmas: test_utils_hasproperty_a3.tst");

gap> ForAll(AllSmallAntimagmas(2), M -> HasPropertyA3(M) or HasPropertyA3( TransposedMagma(M) ) );
true

gap> ForAll(AllSmallAntimagmas(3), M -> HasPropertyA3(M) or HasPropertyA3( TransposedMagma(M) ) );
true

gap> ForAny(AllSmallAntimagmas(4), M -> not (HasPropertyA3(M) or HasPropertyA3( TransposedMagma(M) ) ) );
true

gap> STOP_TEST( "test_utils_hasproperty_a3.tst" );

0 comments on commit a99471f

Please sign in to comment.