#4533: [with patch; needs work] divisors function slow for integers
----------------------+-----------------------------------------------------
Reporter: robertwb | Owner: tbd
Type: defect | Status: new
Priority: major | Milestone: sage-3.2.1
Component: algebra | Resolution:
Keywords: |
----------------------+-----------------------------------------------------
Changes (by mabshoff):
* summary: [with patch; with positive review] divisors function slow for
integers => [with patch; needs work] divisors
function slow for integers
Comment:
Another oops:
{{{
sage -t -long devel/sage/sage/combinat/species/species.py
**********************************************************************
File "/scratch/mabshoff/release-cycle/sage-3.2.1.alpha0/devel/sage-
main/sage/combinat/species/species.py", line 292:
sage: G.isotype_generating_series().coefficients(5)
Exception raised:
Traceback (most recent call last):
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/bin/ncadoctest.py", line 1231, in
run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/bin/sagedoctest.py", line 38, in
run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/bin/ncadoctest.py", line 1172, in
run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_12[7]>", line 1, in <module>
G.isotype_generating_series().coefficients(Integer(5))###line 292:
sage: G.isotype_generating_series().coefficients(5)
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/series.py", line 668, in coefficients
return [self.coefficient(i) for i in range(n)]
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/series.py", line 830, in coefficient
return self._stream[n]
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/stream.py", line 311, in __getitem__
self._list.append(self._gen.next())
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/generating_series.py", line 428, in
_ogs_gen
yield sum( self.coefficient(i).coefficients() )
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/series.py", line 830, in coefficient
return self._stream[n]
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/stream.py", line 311, in __getitem__
self._list.append(self._gen.next())
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/generating_series.py", line 506, in
_functorial_compose_gen
t = g._cycle_type(s)
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/combinat/species/generating_series.py", line 530, in
_cycle_type
for d in divisors(k):
File "/scratch/mabshoff/release-
cycle/sage-3.2.1.alpha0/local/lib/python2.5/site-
packages/sage/rings/arith.py", line 924, in divisors
n = integer_ring.ZZ(n) # we have specalized code for this case,
make sure it gets used
NameError: global name 'integer_ring' is not defined
**********************************************************************
}}}
The problem pops up in a lot of places.
Cheers,
Michael
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4533#comment:17>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---