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

make polynomial truncation cpdef method #4406

Closed
robertwb opened this issue Oct 30, 2008 · 11 comments
Closed

make polynomial truncation cpdef method #4406

robertwb opened this issue Oct 30, 2008 · 11 comments

Comments

@robertwb
Copy link
Contributor

Currently we have _c variants, some of which call one direction, and some which call the other.

CC: @craigcitro

Component: algebra

Issue created by migration from https://trac.sagemath.org/ticket/4406

@robertwb
Copy link
Contributor Author

comment:1

Attachment: 4406-cpdef-truncate.patch.gz

This wasn't as invasive as I had expected. Apply on top of fix at #2462.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Oct 31, 2008

comment:2

Patch looks good to me, but I will wait on a review #2462 before testing this. Also fixed a spelling mistake in the subject.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-3.2 milestone Oct 31, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin changed the title make polynomail truncation cpdef method make polynomial truncation cpdef method Oct 31, 2008
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Oct 31, 2008

comment:3

This patch causes the following doctest failures:

	sage -t -long devel/sage/sage/schemes/elliptic_curves/padics.py # 1 doctests failed
	sage -t -long devel/sage/sage/rings/power_series_ring_element.pyx # 2 doctests failed
	sage -t -long devel/sage/sage/rings/power_series_poly.pyx # 2 doctests failed
	sage -t -long devel/sage/sage/modular/modform/theta.py # 1 doctests failed
	sage -t -long devel/sage/sage/modular/modform/j_invariant.py # 1 doctests failed
	sage -t -long devel/sage/sage/crypto/lfsr.py # 5 doctests failed

The error seems to always be

Exception raised:
    Traceback (most recent call last):
      File "/scratch/mabshoff/release-cycle/sage-3.2.alpha2/local/lib/python2.5/doctest.py", line 1228, in __run
        compileflags, 1) in test.globs
      File "<doctest __main__.example_11[3]>", line 8, in <module>
        g = Rx(g, len(g))
      File "/scratch/mabshoff/release-cycle/sage-3.2.alpha2/local/lib/python2.5/site-packages/sage/rings/power_series_ring.py", line 326, in __call__
        return self.__power_series_class(self, f, prec, check=check)
      File "power_series_poly.pyx", line 47, in sage.rings.power_series_poly.PowerSeries_poly.__init__ (sage/rings/power_series_poly.c:2073)
      File "polynomial_element.pyx", line 3928, in sage.rings.polynomial.polynomial_element.Polynomial.truncate (sage/rings/polynomial/polynomial_element.c:25338)
      File "polynomial_gf2x.pyx", line 43, in sage.rings.polynomial.polynomial_gf2x.Polynomial_GF2X.__getitem__ (sage/rings/polynomial/polynomial_gf2x.cpp:6652)
    TypeError: an integer is required

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-3.2, sage-3.2.1 Oct 31, 2008
@robertwb
Copy link
Contributor Author

comment:4

Are you sure this is with my patch? I just tried these and they work fine in my branch. Or maybe it's some incompatibility with your alpha.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Oct 31, 2008

comment:5

Replying to @robertwb:

Are you sure this is with my patch? I just tried these and they work fine in my branch. Or maybe it's some incompatibility with your alpha.

Yes, I tried with this and the patch at #2462 and initially suspected #2462, but it turns out to be this patch. Reverting this patch only fixed the issue for me. 3.2.alpha2 is coming today, so there should be a binary for sage.math shortly.

Cheers,

Michael

@robertwb
Copy link
Contributor Author

comment:6

OK, I'll look at it there.

@robertwb
Copy link
Contributor Author

robertwb commented Nov 1, 2008

comment:7

I tried fixing this on sage.math, but I'm having issues with the unpacked tar. I copied over sage-3.2.alpha2-sage.math-only-x86_64-Linux and extracted it, but when I run ./sage I get

sage: sage.all.__file__
 '/scratch/mabshoff/release-cycle/sage-3.2.alpha2/local/lib/python2.5/site-packages/sage/all.pyc'

and I can't figure out how test my changes. However, I'm pretty sure the error is because line 467 of sage/rings/polynomial/polynomial_template.pxi is still def (rather than cpdef). I'm attaching a patch that should fix the problem.

@robertwb
Copy link
Contributor Author

robertwb commented Nov 1, 2008

Attachment: 4406-truncate-fix.patch.gz

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 1, 2008

comment:9

I will test the patch and see if that fixes it. More than likely you are getting bitten by #4317, so following the instructions there you should be able to fix the problem.

Cheers,

Michael

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 2, 2008

comment:10

The second patch Robert posted resolves the issue I found. Positive review.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin modified the milestones: sage-3.2.1, sage-3.2 Nov 2, 2008
@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented Nov 2, 2008

comment:11

Merged in Sage 3.2.alpha3

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed Nov 2, 2008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant