-
Notifications
You must be signed in to change notification settings - Fork 160
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
FactorsInt in library #2087
Comments
The library method in lib/grp.gi:631 does so: InstallMethod( AbelianInvariants,
"generic method for groups",
[ IsGroup ],
function ( G )
...
# the parent of this will be G
cmm := DerivedSubgroup(G);
for p in Set( FactorsInt( Size( G ) ) ) do
...
if r <> 1 then
Add( ranks, Length(FactorsInt(r)) );
fi;
... Many other functions also do, e.g. this one for InstallMethod( Exponent,
"generic method for finite groups",
[ IsGroup and IsFinite ],
function(G)
local exp, primes, p;
exp := 1;
primes := Set(FactorsInt(Size(G)));
for p in primes do
exp := exp * Exponent(SylowSubgroup(G, p));
od;
return exp;
end); |
Also note that there used to be (and perhaps still are) places in our that called |
This is of course somewhat off-topic, but I just confirmed that there is still library code computing a full prime factorization of an integer, when it just needs one prime divisor. We have a function for that, though ( |
@fingolfin |
Yes, sorry, I am in favor |
This way better factorizations methods in packages will get used. (Calls to FactInt with options, or in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. This addresses gap-system#2087
Changing calls like |
@fingolfin Looking at your examples above, is there a case for an attribute |
@stevelinton ironically, the manual contains |
fun: I just learned from issue #2099 that the |
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
As far as it concerns overheads when factoring small integers -- the following is what I observe (with FactInt loaded):
|
This issues was actually resolved by PR #2057, we almost always use |
This way better factorizations methods in packages will get used. (Calls in the recursive implementation of FactInt are kept.) Also replace some calls by `PrimePGroup` etc. (This is a revised version of earlier as there was already a merge with PrimePGroup.) This addresses gap-system#2087
This is prompted by a forum question which claimed that
AbelianInvariants
can be held back by usingFactorsInt
instead ofFactors
.[BTW: I have not found where
AbelianInvariants
callsFactorsInt
, only calls toFactors
, but that is not a disproof.]There are about 2 dozen places in the library in which
FactorsInt
is called. This being a global function, it cannot be overridden by a package.While there might be borderline cases that really need the Rho factorization, it seems to me that the main difference is a minor speedup in that
FactorsInt
does not need to construct the default ring and redispatch (asFactors(n)
would), but that could be resolved by another method installation for conditionIsInt
.Is this really time critical? Is there any reason to not replace the
FactorsInt
calls in the library (short of the factorization routine) withFactors
? (I can do so)The text was updated successfully, but these errors were encountered: