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

Add LTermNP, LTermsNP and LMonNP; also add FactorOutGcdNP #32

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

cdwensley
Copy link
Contributor

GBNP originally had LMonsNP, returning a list of leading monomials.
The planned IBNP package will requite the leading term, rather than the leading monomial, of a polynomial.
So it seemed sensible to add LTermNP, LTermsNP and LMonNP.
When adding an example to the manual the corresponding test file, tst/test-functions.tst, was changed: this file has been renamed in the PR nmo-tst, which may cause a problem?

@codecov
Copy link

codecov bot commented Sep 7, 2023

Codecov Report

Attention: Patch coverage is 92.68293% with 3 lines in your changes missing coverage. Please review.

Project coverage is 84.65%. Comparing base (1c0d51b) to head (ae83731).

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #32   +/-   ##
=======================================
  Coverage   84.64%   84.65%           
=======================================
  Files          31       31           
  Lines        4167     4189   +22     
=======================================
+ Hits         3527     3546   +19     
- Misses        640      643    +3     
Files Coverage Δ
lib/nparith.gd 100.00% <100.00%> (ø)
lib/nparith.gi 90.57% <91.89%> (-0.58%) ⬇️

@cdwensley
Copy link
Contributor Author

Now using this branch/PR to add any more NP-arithmetical functions that might be needed for the proposed IBNP package. In this case, have now added FactorOutGcdNP

@fingolfin
Copy link
Member

This now has conflicts and so can't be merged :-(

@cdwensley
Copy link
Contributor Author

After merging master, with the 4 merged PRs, the only remaining conflict required the removal of the no longer needed tst/test-functions.g.

doc/examples/functions.g Outdated Show resolved Hide resolved
doc/gbnp_doc.xml Outdated Show resolved Hide resolved
lib/nparith.gi Outdated Show resolved Hide resolved
lib/nparith.gi Outdated
Comment on lines 470 to 471
if pol=[[],[]] then return(pol); fi;
g := Gcd( pol[2] );
return([pol[1],pol[2]/g]);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if pol=[[],[]] then return(pol); fi;
g := Gcd( pol[2] );
return([pol[1],pol[2]/g]);
if pol=[[],[]] then
return pol;
fi;
g := Gcd( pol[2] );
return [pol[1],pol[2]/g];

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, but not done yet. There are lots of lines "if ... then ... fi;" in these files.

lib/nparith.gi Outdated
end);

InstallGlobalFunction(
LTermsNP,function(lst) local i;
Copy link
Member

Choose a reason for hiding this comment

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

Note that in the distant past, LMonsNP used to be called LTermsNP ... but I guess it doesn't matter now :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was not aware of that. But these names make mathematical sense.

lib/nparith.gi Outdated
Comment on lines 333 to 336
InstallGlobalFunction(
LTermsNP,function(lst) local i;
return(List(lst,p->LTermNP(p)));
end);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
InstallGlobalFunction(
LTermsNP,function(lst) local i;
return(List(lst,p->LTermNP(p)));
end);
InstallGlobalFunction(LTermsNP, lst -> List(lst,LTermNP));

In general I would question the usefulness of such a trivial helper. I guess it can be justified here by arguing this is "for symmetry" with LMonNP / LMonsNP

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed.

lib/nparith.gi Outdated
Comment on lines 270 to 273
InstallGlobalFunction(
LMonsNP,function(lst) local i;
return(List(lst,i->LMonNP(i)));
end);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
InstallGlobalFunction(
LMonsNP,function(lst) local i;
return(List(lst,i->LMonNP(i)));
end);
InstallGlobalFunction(LMonsNP, lst -> List(lst,LMonNP));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

doc/gbnp_doc.xml Outdated Show resolved Hide resolved
lib/nparith.gi Outdated
@@ -250,8 +259,80 @@ end);;
###

InstallGlobalFunction(
LMonsNP,function(pol) local i;
return(List(pol,i->i[1][1]));
LMonNP,function(pol) local i;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
LMonNP,function(pol) local i;
LMonNP,function(pol)

lib/nparith.gi Outdated
Comment on lines 324 to 325
InstallGlobalFunction(
LTermNP,function(pol) local i;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
InstallGlobalFunction(
LTermNP,function(pol) local i;
InstallGlobalFunction(LTermNP, function(pol)

@cdwensley
Copy link
Contributor Author

I cannot now find your comment about formatting problems (perhaps in another PR?) but, anyway, I have done a complete reformat of grobner.gi, which will no doubt be hard to inspect. Perhaps there are other files in a similar mess? Will have to look at all your recent comments first.

@cdwensley
Copy link
Contributor Author

Dealt with some of your latest comments and reformatted nparith.gi

@cdwensley
Copy link
Contributor Author

All tests pass except codecov/patch. Many of the changes reported as 'missed' are just changes of whitespace when tabs replaced by ' ', etc.

@fingolfin fingolfin changed the title Leadmon Add LTermNP, LTermsNP and LMonNP Jul 4, 2024
doc/gbnp_doc.xml Outdated Show resolved Hide resolved
lib/nparith.gi Outdated Show resolved Hide resolved
lib/grobner.gi Outdated Show resolved Hide resolved
@fingolfin
Copy link
Member

There are over 80 conflicts now after merging your other PR. I strongly recommend to not mix whitespace changes and reformatting with other changes. It just leads to pain and suffering. Do those in separate PRs, and only do them when there are no other changes pending.

Of course that advise comes far too later for this one :/

@fingolfin fingolfin changed the title Add LTermNP, LTermsNP and LMonNP Add LTermNP, LTermsNP and LMonNP; also add FactorOutGcdNP Jul 4, 2024
@fingolfin
Copy link
Member

I tried discarding all formatting changes in this PR and rebase the rest. Let's see if tests pass.

@fingolfin fingolfin merged commit 1938ac9 into gap-packages:master Jul 4, 2024
8 checks passed
@cdwensley cdwensley deleted the leadmon branch July 5, 2024 08:12
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.

2 participants