Skip to content
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

De-duplicate three or more duplicate variables #3262

Merged
merged 2 commits into from
May 25, 2024

Conversation

d-torrance
Copy link
Member

We refactor the dedupSymbols helper function, which previously only de-duplicated up to two duplicate variables.

Before

i1 : QQ[x,x]

o1 = QQ[x ..x ]
         0   1

o1 : PolynomialRing

i2 : QQ[x,x,x]
stdio:2:1:(3): error: baseName: no base name available

After

i1 : QQ[x,x,x]

o1 = QQ[x ..x ]
         0   2

o1 : PolynomialRing

Closes: #3261

@DanGrayson DanGrayson merged commit be9dcb5 into Macaulay2:development May 25, 2024
6 checks passed
@mahrud
Copy link
Member

mahrud commented May 25, 2024

@DanGrayson I think you should try asking someone to review pull requests before merging them. GitHub even gives you suggestions for reviewers based on who else has touched those lines before.

Comment on lines -480 to -481
counter := new MutableHashTable from applyKeys(mapping,
i -> varlist#i, dups -> makeVars(#dups, first dups));
Copy link
Member

Choose a reason for hiding this comment

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

This could have been fixed with a much simpler patch:

Suggested change
counter := new MutableHashTable from applyKeys(mapping,
i -> varlist#i, dups -> makeVars(#dups, first dups));
i -> varlist#i, dups -> makeVars(#flatten dups, last dups));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants