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

Enhance DirectFactorsOfGroup for faster StructureDescription #379

Merged
merged 26 commits into from
Jan 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
ea04de9
Enhance DirectFactorsOfGroup for faster StructureDescription
hungaborhorvath Nov 28, 2015
420d92b
Add documentation to DirectFactorsOfGroup
hungaborhorvath Dec 5, 2015
b7549fd
Apply some changes suggested by @fingolfin
hungaborhorvath Dec 5, 2015
5db1121
Comply with fingolfin's requests on IsTrivialNormalIntersection*
hungaborhorvath Dec 5, 2015
953651d
Slightly improve DirectFactorsOfGroup code
hungaborhorvath Dec 5, 2015
d0ed28a
Replace filtered lists by loop, throw away trivial generators
hungaborhorvath Dec 6, 2015
31bb3b4
Replace another filtered lists by loop, throw away trivial generators
hungaborhorvath Dec 6, 2015
5b72f66
Slightly improve DirectFactorsOfGroup for nonsolvable groups
hungaborhorvath Dec 6, 2015
4f646a6
Enhance DirectFactorsOfGroup and DirectFactorsOfGroupKN
hungaborhorvath Dec 10, 2015
deee1a4
Declare IsTrivialIntersectionInList as function
hungaborhorvath Dec 11, 2015
1046e59
Break double loop in DirectFactorsOfGroupKN
hungaborhorvath Dec 11, 2015
3c0e44a
Add global function UnionIfCanEasilySortElements
hungaborhorvath Dec 11, 2015
371acb4
Correct typo
hungaborhorvath Dec 12, 2015
2846bc6
Slightly improve DirectFactorsOfGroup
hungaborhorvath Dec 12, 2015
38b0b20
Enhance ComplementNormalSubgroup if G/N is abelian
hungaborhorvath Dec 19, 2015
af31b58
Slightly enhance DirectFactorsOfGroup
hungaborhorvath Dec 19, 2015
cad5ecd
Clean code a bit
hungaborhorvath Dec 19, 2015
5298879
Change rank increments to 0
hungaborhorvath Jan 27, 2016
c47602c
Add a check for CanComputeSize
hungaborhorvath Jan 27, 2016
d30b92c
Use Representative for RationalClasses
hungaborhorvath Jan 27, 2016
ab73a3d
Replace Partitions with IteratorOfCombinations
hungaborhorvath Jan 27, 2016
cf6e03f
Make DirectFactorsOfGroupKN a function and call it by an option
hungaborhorvath Jan 27, 2016
efff11e
Remove TryNextMethod from functions
hungaborhorvath Jan 27, 2016
6b11f51
Add testinstall file
hungaborhorvath Jan 27, 2016
7e8f811
Enhance ComplementNormalSubgroup
hungaborhorvath Jan 30, 2016
aa77167
Rename ComplementNormalSubgroup to NormalComplement
hungaborhorvath Jan 30, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 145 additions & 4 deletions lib/grpnames.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,136 @@
## Markus Püschel and Sebastian Egner.
##

#############################################################################
##
#O IsTrivialNormalIntersection( <G>, <U>, <V> ) . . . . . . . generic method
##
## <ManSection>
## <Oper Name="IsTrivialNormalIntersection" Arg="G, U, V"/>
##
## <Description>
## For normal subgroups <A>U</A> and <A>V</A> of <A>G</A>,
## IsTrivialNormalIntersection returns
## true if <A>U</A> and <A>V</A> intersect trivially, and false otherwise.
## The result is undefined if either <A>U</A> or <A>V</A> is not a normal
## subgroup of G.
## </Description>
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps change the last sentence to something like The result is undefined if U and V are not normal subgroups of 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.

Sure.

## </ManSection>
##
DeclareOperation( "IsTrivialNormalIntersection",
[ IsGroup, IsGroup, IsGroup ] );

#############################################################################
##
#F IsTrivialNormalIntersectionInList( <MinNs>, <U>, <V> ) . . generic method
##
## <ManSection>
## <Func Name="IsTrivialNormalIntersectionInList" Arg="MinNs, U, V"/>
##
## <Description>
## For groups <A>U</A> and <A>V</A>, IsTrivialNormalIntersection returns
## false if for any group H in list <A>MinNs</A> both <A>U</A> and
## <A>V</A> contains the first nontrivial generator of H. Otherwise, the
## result is true.
## This operation is useful if it is already known that the intersection
## of <A>U</A> and <A>V</A> is either trivial, or contains at least one
## group from <A>MinNs</A>.
## For example if <A>U</A> and <A>V</A> are normal subgroups of a group
## G and <A>MinNs</A>=MinimalNormalSubgroups(G).
## </Description>
## </ManSection>
##
DeclareGlobalFunction( "IsTrivialNormalIntersectionInList",
[ IsList, IsGroup, IsGroup ] );

#############################################################################
##
#F UnionIfCanEasilySortElements( <L1>[, <L2>, ... ] ) . . . . generic method
##
## <ManSection>
## <Func Name="UnionIfCanEasilySortElements" Arg="L1[, L2, ... ]"/>
##
## <Description>
## Return the union of <A>Li</A> if CanEasilySortElements is true for all
## elements of all <A>Li</A>, and the concatenation of them, otherwise.
## </Description>
## </ManSection>
##
DeclareGlobalFunction( "UnionIfCanEasilySortElements", IsList );

#############################################################################
##
#O NormalComplement( <G>, <N> ) . . . . . . . . . . . generic method
##
## <#GAPDoc Label="NormalComplement">
## <ManSection>
## <Oper Name="NormalComplement" Arg="G, N"/>
##
## <Description>
## Gives a normal complement to the normal subgroup <A>N</A> in <A>G</A>
## if exists, fail otherwise.
## In theory it finds the normal complement for infinite <A>G</A>,
## but can have an infinite loop if <A>G/N</A> is abelian and <A>N</A> is
## infinite.
## NormalComplementsNC does not check if <A>N</A> is a normal
## subgroup of <A>G</A>.
## </Description>
## </ManSection>
## <#/GAPDoc>
##
## This is the implementation of the algorithm described in
## Neeraj Kayal and Timur Nezhmetdinov, Factoring Groups Efficiently,
## in International Colloquium on Automata, Languages and Programming
## (ICALP), Lecture Notes in Computer Science 5555, 585-596,
## Springer Verlag, Berlin Heidelberg 2009.
##
DeclareOperation( "NormalComplement", [IsGroup, IsGroup]);
DeclareOperation( "NormalComplementNC", [IsGroup, IsGroup]);

Copy link
Member

Choose a reason for hiding this comment

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

I do not understand the documentation comment. Is this a function that is supposed to be used by end users? If so, it should be properly documented. If not, I'd say it shouldn't be declared as an operation.
Also, the formatting is off here, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is no proper documentation at all, yet. I am not sure if I really want end users to use this function. In any case, if the arguments are [L, U, V], then the algorithm will check if any of L is contained in both U and V. (Actually it only checks whether a nontrivial generator is in them.) One should use this operation (or should it be function?) when knows a priori that the intersection of U and V should contain an element of L unless the intersection is trivial. The typical example is MinimalNormalSubgroups, but e.g. DirectFactorsOfGroupFromList uses this when calling itself on a direct factor.

In any case, I am planning to document it after reading the proper material, and it probably will not really be useful for end users. Should it be something else than an operation?

#############################################################################
##
#A DirectFactorsOfGroup( <G> ) . . . . . decomposition into a direct product
##
## <#GAPDoc Label="DirectFactorsOfGroup">
## <ManSection>
## <Attr Name="DirectFactorsOfGroup" Arg="G"/>
##
## <Description>
## A sorted list of factors [<A>G1</A>, .., <A>Gr</A>] such that
## <A>G</A> = <A>G1</A> x .. x <A>Gr</A> and none of the <A>Gi</A>
## A (sorted if possible) list of factors [<A>G1</A>, .., <A>Gr</A>] such
## that <A>G</A> = <A>G1</A> x .. x <A>Gr</A> and none of the <A>Gi</A>
## is a direct product.
## If <A>G</A> is an infinite abelian group, then it returns an unsorted
## list of the factors. DirectFactorsOfGroup currently cannot compute the
## direct factors of a nonabelian infinite group.
##
## The option <Q>useKN</Q> forces to use the function
## DirectFactorsOfGroupKN based on
## Neeraj Kayal and Timur Nezhmetdinov, Factoring Groups Efficiently,
## in International Colloquium on Automata, Languages and Programming
## (ICALP), Lecture Notes in Computer Science 5555, 585-596,
## Springer Verlag, Berlin Heidelberg 2009.
## This algorithm never computes normal subgroups, and performs slower in
## practice than the default method.
## </Description>
## </ManSection>
## <#/GAPDoc>
##
DeclareAttribute( "DirectFactorsOfGroup", IsGroup );

#############################################################################
##
#F DirectFactorsOfGroupFromList( <G>, <Ns>, <MinNs> )
##
## <ManSection>
## <Func Name="DirectFactorsOfGroup" Arg="G, Ns, MinNs"/>
##
## <Description>
## A (sorted if possible) list of factors [<A>G1</A>, .., <A>Gr</A>] such
## that <A>G</A> = <A>G1</A> x .. x <A>Gr</A> and none of the <A>Gi</A>
## is a direct product, and all the factors <A>Gi</A> are from the list
## <A>Ns</A>. The list <A>MinNs</A> is supposed to be a list such that the
## intersection of any two groups from <A>Ns</A> is either trivial or
## contains a group from <A>MinNs</A>.
## </Description>
## </ManSection>
##
Expand Down Expand Up @@ -119,10 +238,32 @@
## This is done by merging the two sequences into
## a single increasing sequence of pairs <c_i, which_i>
## where which_i indicates where c_i is in the a-sequence
## and where it is in the b-sequence if any. The the
## and where it is in the b-sequence if any. Then the
## linear algorithm above may be used.
##
DeclareAttribute( "DirectFactorsOfGroup", IsGroup );
DeclareGlobalFunction( "DirectFactorsOfGroupFromList",
[ IsGroup, IsList, IsList ] );

#############################################################################
##
#A DirectFactorsOfGroupKN( <G> ) . . . . decomposition into a direct product
##
## <ManSection>
## <Func Name="DirectFactorsOfGroupKN" Arg="G"/>
##
## <Description>
## A (sorted if possible) list of factors [<A>G1</A>, .., <A>Gr</A>] such
## that <A>G</A> = <A>G1</A> x .. x <A>Gr</A> and none of the <A>Gi</A>
## is a direct product.
## This is the implementation of the algorithm described in
## Neeraj Kayal and Timur Nezhmetdinov, Factoring Groups Efficiently,
## in International Colloquium on Automata, Languages and Programming
## (ICALP), Lecture Notes in Computer Science 5555, 585-596,
## Springer Verlag, Berlin Heidelberg 2009.
## </Description>
## </ManSection>
##
DeclareGlobalFunction( "DirectFactorsOfGroupKN", IsGroup );

#############################################################################
##
Expand Down
Loading