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 Display method for pc groups #3621

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

flyingapfopenguin
Copy link
Member

Description / Text for release notes

Add Display method for pc groups, refering #3538.

@flyingapfopenguin flyingapfopenguin added gapdays2019-spring Issues and PRs that arose at https://www.gapdays.de/gapdays2019-spring kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements labels Aug 23, 2019
@stevelinton
Copy link
Contributor

Is there anything to be said for omitting relations of the form g17^g15 = g17 from the printout and instead appending all other pairs of generators commute. It is quite common to have presentations which are "sparse" in the sense that most pairs of generators commute.

@codecov
Copy link

codecov bot commented Aug 23, 2019

Codecov Report

Merging #3621 into master will increase coverage by 0.07%.
The diff coverage is 96.61%.

@@            Coverage Diff             @@
##           master    #3621      +/-   ##
==========================================
+ Coverage   84.58%   84.65%   +0.07%     
==========================================
  Files         698      698              
  Lines      345626   345685      +59     
==========================================
+ Hits       292341   292637     +296     
+ Misses      53285    53048     -237
Impacted Files Coverage Δ
lib/grppc.gd 100% <100%> (ø) ⬆️
lib/grppc.gi 81.27% <96.55%> (+0.55%) ⬆️
src/weakptr.c 96.44% <0%> (-0.4%) ⬇️
src/opers.c 94.79% <0%> (-0.07%) ⬇️
lib/groebner.gi 85.72% <0%> (+0.1%) ⬆️
lib/streams.gi 74.28% <0%> (+0.1%) ⬆️
lib/combinat.gi 77.18% <0%> (+0.12%) ⬆️
lib/matrix.gi 87.74% <0%> (+0.29%) ⬆️
lib/grp.gi 89.51% <0%> (+0.31%) ⬆️
lib/vec8bit.gi 80.39% <0%> (+0.42%) ⬆️
... and 19 more

@flyingapfopenguin
Copy link
Member Author

@stevelinton Thanks for the reply. I added the message to the output of the Display function.

@wilfwilson
Copy link
Member

The tests need to be updated to account for the new line that you added.

Also, I think that the line All other pairs of generators commute. should only be shown if there are actually such pairs of generators that commute. (I don't know anything about pc groups really, so perhaps it is possible that there are always some generators that commute).

@fingolfin
Copy link
Member

@flyingapfopenguin you added the message, but did not update the tests (which you can do by running Test("tst/PATH/TO/TEST.tst", rec(rewriteToFile:=true));

lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
tst/testinstall/grppc.tst Outdated Show resolved Hide resolved
lib/grppc.gi Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
@flyingapfopenguin
Copy link
Member Author

@wilfwilson @fingolfin Thanks for your constructive response. I applied (most of) your suggestions.

lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated Show resolved Hide resolved
lib/grppc.gi Outdated
gens := GeneratorsOfGroup( F );
pis := RelativeOrders( pcgs );

# the power
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you maybe improve this comment so it says more about the following code?

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried to improve it a little. Do you want more?

@DominikBernhardt
Copy link
Contributor

One general remark: You print the message All other pairs of generators commute but the user never sees the generators. Should one maybe print the number of generators for the pc group as well?

@coveralls
Copy link

coveralls commented Aug 29, 2019

Coverage Status

Coverage increased (+0.01%) to 84.419% when pulling 5d4c5fc on flyingapfopenguin:jb/DisplayPCGroup into df36d37 on gap-system:master.

lib/grppc.gd Outdated Show resolved Hide resolved
local pcgs, n, F, gens, i, pis, exp, t, h, rel, commPower, j, trivialCommutators;

pcgs:=Pcgs(G);
n:=Length(pcgs);
Copy link
Member

Choose a reason for hiding this comment

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

This is not a request for change, just wanted to point something out: the above two lines clearly come from another source than the following three lines, based on their formatting... Overall, this function mixes several code formatting styles (e.g. Foo( arg ) vs. Foo(arg))

Copy link
Member Author

Choose a reason for hiding this comment

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

@fingolfin What is the GAP coding style? As I didn't knew I copied code without changing its formating and coded the rest like it seems to make sense to me.

Copy link
Member

Choose a reason for hiding this comment

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

There is no official coding style (and trying to set one is one of these things were I expect a lot of pain and blood for little gain). Many people seem to take the formatting which GAP itself uses when printing a function as reference, but usually with some adjustments (e.g. aligning some things across multiple lines, as below).

Anyway, I am not asking for a specific style to be followed -- just that the code within a given function be self-consistent. That's note the case here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to fix this tomorrow by adding a new commit, so that you can do a reintegration merge afterwards.

Copy link
Member

Choose a reason for hiding this comment

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

I already merged this PR, didn't want to hold it hostage over some whitespace differences :-) I only pointed this formatting bit out again to make you aware of it; as it is, lots of GAP code is less well formatted than what is in this PR...

lib/grppc.gi Outdated
fi;
n := Size(Pcgs(G));
if IsOne(n) then
Print("cyclic pc-group with one pc-generator and the relation:\n");
Copy link
Member

Choose a reason for hiding this comment

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

Unimportant nitpick: So you print "one pc-generator" but "2 pc-generators" ? maybe "one" -> "1" for consistency?

I am not sure I see the importance of adding cyclic. It might even be misleading, because many cyclic pc-groups won't get it (e.g. C_4 or C_6 if the pcgs is refined).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm going to change "one" to "1" for consistency.

About "cyclic": I don't think this is important in any way but i'm going to leave this.

fi;
trivialCommutators := PrintPcPresentation( G, false );
if IsAbelian(G) then
Print("all generators commute, the groups is abelian\n");
Copy link
Member

Choose a reason for hiding this comment

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

Again unimportant, but: If you handle the 1 generator case separately above, you might want to consider doing so here as well, as "all generators" then refers to just 1 generator.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's right, but all is one in this case.

Copy link
Member

@fingolfin fingolfin left a comment

Choose a reason for hiding this comment

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

Overall seems fine to me now, though I had some further minor nitpicks. The PR should also be squashed.

@flyingapfopenguin
Copy link
Member Author

Overall seems fine to me now, though I had some further minor nitpicks. The PR should also be squashed.

Should I simply squash all commits together and do a force push or how is this usually done?
If I anyhow do a force push, should I also rebase on the current master?

@fingolfin
Copy link
Member

@flyingapfopenguin yes, please squash, rebase on latest master and then force push.

@flyingapfopenguin
Copy link
Member Author

@flyingapfopenguin yes, please squash, rebase on latest master and then force push.

done

@DominikBernhardt
Copy link
Contributor

One test failed due to a download error, I restarted it.

@fingolfin fingolfin merged commit e745d3c into gap-system:master Sep 3, 2019
@fingolfin fingolfin added the release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes label Sep 3, 2019
@wucas
Copy link
Contributor

wucas commented Sep 10, 2019

Is there a reason why this PR does not close Issue #3538?

@DominikBernhardt
Copy link
Contributor

Is refering maybe not the right keyword? Could be that one has to write resolves or fixes? I can close the original issue manually this time.

@olexandr-konovalov olexandr-konovalov added this to the GAP 4.11.0 milestone Nov 17, 2019
@dimpase dimpase 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 Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gapdays2019-spring Issues and PRs that arose at https://www.gapdays.de/gapdays2019-spring 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.

9 participants