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

Improve performance of NormalizerViaRadical #2924

Merged
merged 4 commits into from
Oct 19, 2018

Conversation

hulpke
Copy link
Contributor

@hulpke hulpke commented Oct 16, 2018

  • Avoid unnecessary membership test that would be expensive
  • Clean up commented-out debugging code
  • Improve action on cohomology by going to factor modules first

lib/norad.gi Outdated Show resolved Hide resolved
lib/norad.gi Outdated
@@ -562,6 +552,7 @@ local sus,ser,len,factorhom,uf,n,d,up,mran,nran,mpcgs,pcgs,pcisom,nf,ng,np,sub,
# work in quotient modules first
module:=GModuleByMats(Concatenation(ngm,npm),f);
sumos:=Reversed(MTX.BasesCompositionSeries(module));
Info(InfoFitFree,2,"module layers ",List(sumos,Length));
Copy link
Member

Choose a reason for hiding this comment

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

nitpick (can be ignored): odd indentation (perhaps spaces vs tabs?)

ranges:=List([1..Length(part)],
x->[(x-1)*Length(lfamo)+1..x*Length(lfamo)]);

sub:=Concatenation(List(part,a->List(lfamo,x->Zero(f))));
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this just creating a matrix equal to NullMat(Length(part), Length(lfamo), f)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. It is ListWithIdenticalEntries(Length(part)*Length(lfamo),Zero(f)). The Concatenation makes it clear that this is cohomology liosted as module entries associated to the generators in part.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, somehow I (rather stupidly) missed the Concatenation bit.

lib/norad.gi Outdated
l:=Concatenation(l);
l:=SiftedVector(bound,l);
ConvertToVectorRep(l,Size(f));
MakeImmutable(l);
Copy link
Member

Choose a reason for hiding this comment

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

you could also replace these two lines by l := ImmutableVector(f, l);, which may have advantages as the work on MatrixObj proceeds (but you can also leave it, and we'll convert this then).

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. (Code predated ImmutableVector and the change here was indent or similar.)

lib/norad.gi Outdated
return l;
end;

# as corrections involve only pcgs parts, the images inthe
Copy link
Member

Choose a reason for hiding this comment

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

inthe -> in the

@codecov
Copy link

codecov bot commented Oct 19, 2018

Codecov Report

Merging #2924 into master will increase coverage by <.01%.
The diff coverage is 68.04%.

@@            Coverage Diff             @@
##           master    #2924      +/-   ##
==========================================
+ Coverage    78.9%   78.91%   +<.01%     
==========================================
  Files         681      681              
  Lines      346670   346684      +14     
==========================================
+ Hits       273555   273576      +21     
+ Misses      73115    73108       -7
Impacted Files Coverage Δ
lib/norad.gi 46.76% <68.04%> (+1.68%) ⬆️
lib/read5.g 100% <0%> (ø) ⬆️
lib/pcgsmodu.gi 84.24% <0%> (+0.44%) ⬆️

@hulpke hulpke merged commit 0672c46 into gap-system:master Oct 19, 2018
@PaulaHaehndel PaulaHaehndel added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes topic: library labels Apr 15, 2019
@fingolfin fingolfin changed the title ENHANCE: Performance improvements to NormalizerViaRadical Improve performance of NormalizerViaRadical Aug 22, 2019
@fingolfin fingolfin added release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Aug 22, 2019
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.11.0 milestone Aug 26, 2019
@hulpke hulpke deleted the ah/strategery branch August 30, 2019 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: added PRs introducing changes that have since been mentioned in the release notes topic: library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants