Skip to content

Comments

PermuteMultiplicationTable, refactor OnMultiplicationTable, add docs#1054

Merged
james-d-mitchell merged 12 commits intosemigroups:mainfrom
pramothragavan:OnMultiplicationTable
Apr 11, 2025
Merged

PermuteMultiplicationTable, refactor OnMultiplicationTable, add docs#1054
james-d-mitchell merged 12 commits intosemigroups:mainfrom
pramothragavan:OnMultiplicationTable

Conversation

@pramothragavan
Copy link
Contributor

@pramothragavan pramothragavan commented Mar 26, 2025

This PR

  • introduces a new function PermuteMultiplicationTable(temp, table, p), implemented in C, which permutes a multiplication table table and stores the result by changing temp in-place.
  • refactors OnMultiplicationTable to call PermuteMultiplicationTable.

I wasn't sure where to put the function, so I added a new file.

@pramothragavan
Copy link
Contributor Author

Hopefully all addressed now @james-d-mitchell. I've also added some tests.

Copy link
Collaborator

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks generally great, a number of minor things to adjust, and then one major one: I'd suggest implementing PermuteMultiplicationTableNC in the C code which would not do any of the checks at the start of the current PermuteMultiplicationTable, just assume that they hold. Then modify PermuteMultiplicationTable to call that function after doing the checks. You could add assertions to PermuteMultiplicationTableNC to check that the requirements are met, when compiled without --enable-debug these checks will not be performed.

@james-d-mitchell james-d-mitchell added the waiting-for-creator-input A label for issues or PR that are waiting for input from their creator label Apr 10, 2025
@pramothragavan
Copy link
Contributor Author

Not sure I've done exactly what you wanted with the assertions @james-d-mitchell but let me know

@james-d-mitchell
Copy link
Collaborator

Not sure I've done exactly what you wanted with the assertions @james-d-mitchell but let me know

Probably easiest for me to just do it, when you are done, please let me know and I'll add the assertions.

@pramothragavan
Copy link
Contributor Author

Not sure I've done exactly what you wanted with the assertions @james-d-mitchell but let me know

Probably easiest for me to just do it, when you are done, please let me know and I'll add the assertions.

Sounds good, all done now @james-d-mitchell

@james-d-mitchell
Copy link
Collaborator

Ah you did exactly what I was suggesting already, thanks!

@pramothragavan
Copy link
Contributor Author

pramothragavan commented Apr 10, 2025

Just rebased so hopefully CI is all good now

@pramothragavan pramothragavan force-pushed the OnMultiplicationTable branch from af1bee6 to 54ec96f Compare April 10, 2025 15:42
@james-d-mitchell james-d-mitchell merged commit 16370ff into semigroups:main Apr 11, 2025
17 checks passed
@pramothragavan pramothragavan deleted the OnMultiplicationTable branch April 13, 2025 17:20
james-d-mitchell pushed a commit to james-d-mitchell/Semigroups that referenced this pull request Aug 28, 2025
…emigroups#1054)

* PermuteMultiplicationTable, refactor OnMultiplicationTable, add docs

* Addressed comments, added tests

* clang format

* clang-format

* clang-format

* address comments

* Int_ObjInt -> INT_INTOBJ

* more Int_ObjInt -> INT_INTOBJ

* add asserts

* fix ci, add more asserts

* refactor

* error messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-for-creator-input A label for issues or PR that are waiting for input from their creator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants