diff --git a/ChangeLog b/ChangeLog index 73ca063..d3ae4af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ upcoming - Covering Lemma implementation + Covering Lemma implementation: adding HashMapRelations, 0.9.8 Better constructors for Cascades needed by the upcoming Covering Lemma implementation. Cascades now have a partially implemented List interface. This was needed to be able use them in HashMaps. BREAKING CHANGE: as a consequence, the ^ operation is not registered any more for OnCoordinates. diff --git a/tst/hashmaprel.tst b/tst/hashmaprel.tst new file mode 100644 index 0000000..c34c861 --- /dev/null +++ b/tst/hashmaprel.tst @@ -0,0 +1,19 @@ +gap> START_TEST("Relations represented by HashMaps"); +gap> LoadPackage("sgpdec", false);; +gap> hmr := HashMap([[1,[2,3]],[2,[3]]]); +HashMap([[ 1, [ 2, 3 ] ], [ 2, [ 3 ] ]]) +gap> ImageOfHashMapRelation(hmr); +[ 2, 3 ] +gap> IsInjectiveHashMapRelation(hmr); +false +gap> IsInjectiveHashMapRelation2(hmr); +false +gap> hmr := HashMap([[1,[2,3]],[2,[4,5,6]]]); +HashMap([[ 1, [ 2, 3 ] ], [ 2, [ 4, 5, 6 ] ]]) +gap> IsInjectiveHashMapRelation2(hmr); +true +gap> IsInjectiveHashMapRelation(hmr); +true +gap> InvertHashMapRelation(hmr); +HashMap([[ 2, [ 1 ] ], [ 3, [ 1 ] ], [ 4, [ 2 ] ], [ 5, [ 2 ] ], [ 6, [ 2 ] ]]) +gap> STOP_TEST( "Relations represented by HashMaps"); diff --git a/tst/testall.g b/tst/testall.g index 0ffdb9c..bcbe614 100644 --- a/tst/testall.g +++ b/tst/testall.g @@ -1,26 +1,8 @@ -LoadPackage( "sgpdec" ); +LoadPackage( "sgpdec", false); -# `TestDirectory` provides a convenient way to run collections of tests. -# It also simplifies adding new tests, because it automatically picks -# up all files having extension `.tst` -# -# It also ensures that it will display an information message that is -# needed to detect whether a test passed or failed in a number of automated -# settings. -# -# If you need to run some other tests in addition to `TestDirectory`, -# you code should analyse the outcome of the test, and then -# print an information using the string that looks exactly as shown below: -# -# if testresult -# Print("#I No errors detected while testing"\n"); -# else -# Print("#I Errors detected while testing\n"); -# fi; -# -# -TestDirectory(DirectoriesPackageLibrary( "sgpdec", "tst" ), - rec(exitGAP := true, - testOptions := rec(compareFunction := "uptowhitespace", transformFunction := "removenl") ) ); +TestDirectory(DirectoriesPackageLibrary("sgpdec","tst"), + rec(exitGAP := true, + testOptions := rec(compareFunction := "uptowhitespace", + transformFunction := "removenl") ) ); FORCE_QUIT_GAP(1); # if we ever get here, there was an error diff --git a/tst/testfunctions.g b/tst/testfunctions.g index ffaba4e..091b3fa 100644 --- a/tst/testfunctions.g +++ b/tst/testfunctions.g @@ -1,25 +1,26 @@ SgpDecTestInstall := function() local test; - for test in [ - "lowerbound", - "disjointuniongroup", - "WeakControlWords", - "wreath", - "cascade", - "depfunc", - "fl", - "skeleton", - "holonomy", - "cartesianenum", - "transnot", - "viz", - "straightword", - "manual" - ] do - Test(Concatenation( - PackageInfo("sgpdec")[1]!.InstallationPath, - "/tst/",test, - ".tst"));; + for test in + ["hashmaprel", + "lowerbound", + "disjointuniongroup", + "WeakControlWords", + "wreath", + "cascade", + "depfunc", + "fl", + "skeleton", + "holonomy", + "cartesianenum", + "transnot", + "viz", + "straightword", + "manual" + ] do + Test(Concatenation(PackageInfo("sgpdec")[1]!.InstallationPath, + "/tst/",test, + ".tst"), + rec(compareFunction := "uptowhitespace"));; od; end; MakeReadOnlyGlobal("SgpDecTestInstall");