-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve transformations code and tests #727
Conversation
Better checking of the arguments, and reduce the degree in case the defining lists contain trailing fixed points.
Make functions more robust by checking their args, remove randomness from test files, and ensure 100% code coverage.
Remove trailing whitespace and use uniform code formatting.
Make functions more robust by checking their args, remove randomness from test files, and ensure 100% code coverage.
The new method has lower complexity than the old method, which was rubbish.
To avoid duplicate code.
Remove trailing whitespace and use uniform code formatting.
Make functions more robust by checking their args, remove randomness from test files, and ensure 100% code coverage.
Remove trailing whitespace and use uniform code formatting.
To keep the compiler happy
The new method is a bit faster and uses less memory.
And tests for COMPONENTS_TRANS and NR_COMPONENTS_TRANS. Also update NR_COMPONENTS_TRANS to give an error if the arg is not a transformation.
The output of the previous code was not well-defined, or used, so I removed it.
and add tests for these.
So that functions with related functionality are next to each other, in clearly marked sections. Rename: * IMAGE_TRANS -> IMAGE_LIST_TRANS_INT * PERM_LEFT_QUO_TRANS_NC -> PermLeftQuoTransformationNC * INV_TRANS -> InverseOfTransformation Remove the GAP versions of the last two, and update the tests.
Namely those of the identity, and a permutation.
Remove unnecessary GAP level versions of C functions, and rename the C function for: * RESTRICTED_TRANS -> RestrictedTransformationNC * PERM_IMG_TRANS -> PermutationOfImage * IS_INJECTIVE_LIST_TRANS -> IsInjectiveListTrans * INDEX_PERIOD_TRANS -> IndexPeriodOfTransformation
and properly check their arguments.
Remove now redundant code, declarations, fix minor problems, and add checks.
and rename RestrictedTransformationNC -> RestrictedTransformation, since the C function anyway checks its args fully.
Running
runs into many instances of |
Also, at the risk of sounding too optimistic: How far are we away from consolidating |
@markuspf the old There are actually not as many functions in |
I had a look through this pull request, and generally speaking it all looks good (obviously there are many things). There could probably be more tests (although the tests are as good as they've ever been before). |
There are 3020 lines of new tests, testing 95.4 % of the lines in
in I'm going to interpret "as good as they've ever been" as "better than before" :) Joking aside: I think I know what you mean, the tests for any given function could probably include more complicated/different transformations. If you have any specific suggestions for further tests, then I'd be happy to add them. |
I think we'll have to remove the |
This file contains the old tests for transformations.
I've removed the old test file. |
@james-d-mitchell besides the problem with 32-bit builds mentioned by me earlier today, namely
there is a problem with loading all packages, for example:
Should I wait for the new version of |
Another strange thing happening in the test of manual examples (
|
Thanks for the reports, I'll investigate. I think I know what the problem is with the 32 bit build, but I can't get |
I've looked at the "bad bag" issue, and I don't think this is related to the changes I made in the transformations code. If I go back to changeset e948e84 (in master before PR #727 was merged), and do:
Maybe this is a different issue, not what triggers the "bad bag" messages when you do make |
@alex-konovalov I have fixed the issue with |
@james-d-mitchell: thanks. With respect to "bad bags", @ChrisJefferson was going to look into it. |
Great thanks! |
This pull requests contains many minor improvements in the transformations code and its tests. It does not contain any changes in functionality except where this involved fixing a bug.
This came out of wanting to remove the randomness in the test file trans/testinstall/trans.tst, and to get trans/testinstall/trans.tst to run in a more reasonable amount of time (as mentioned in Issue #573). In the process of doing this I rewrote some of the C functions for transformations to improve their complexity, reduce the length of the code, and to make them more robust (by checking their arguments more thoroughly). I also removed several C/GAP functions that weren't used or documented, cleaned up the whitespace is src/trans.c, lib/trans.gi, and lib/trans.gd, reorganised src/trans.c and added more comments, and fixed some bugs and inconsistencies.
The file trans/testinstall/trans.tst now runs in about 600ms (on my laptop), and tests almost all of the code in src/trans.c and lib/trans.gi, and doesn't contain any randomness, except to test the function RandomTransformation.
The whitespace changes are separate from the other changes. I realise that there are a large number of commits in this PR, I'm happy to rebase this to whatever anyone wants.