Opened 11 years ago

Closed 10 years ago

#10617 closed enhancement (fixed)

Make polynomial over ZZ call FLINT for composition and evaluation

Reported by: spancratz Owned by: AlexGhitza
Priority: major Milestone: sage-5.1
Component: basic arithmetic Keywords: polynomial arithmetic
Cc: mhansen Merged in: sage-5.1.beta5
Authors: Sebastian Pancratz Reviewers: Tom Boothby, Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by mhansen)

In Sage 4.6.0,

sage: R.<x> = ZZ[]
sage: f = R.random_element(200)
sage: g = R.random_element(200)
sage: %time _ = f(g)
CPU times: user 102.61 s, sys: 4.47 s, total: 107.08 s
Wall time: 107.27 s

Apply only trac_10617.patch

Attachments (1)

trac_10617.patch (4.6 KB) - added by mhansen 10 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 11 years ago by spancratz

With the ticket applied,

sage: R.<x> = ZZ[]
sage: f = R.random_element(200)
sage: g = R.random_element(200)
sage: %time _ = f(g)
CPU times: user 4.19 s, sys: 0.16 s, total: 4.35 s
Wall time: 4.37 s

We also note the change in runtime taken for evaluating a polynomial at an integer. With a vanilla 4.6.0,

sage: R.<x> = ZZ[]
sage: f = R.random_element(degree=2048, x=2**1024)
sage: a = ZZ.random_element(x = 2**1024)
sage: %time _ = f(a)
CPU times: user 4.35 s, sys: 0.00 s, total: 4.35 s
Wall time: 4.36 s
sage: R.<x> = ZZ[]
sage: f = R.random_element(degree=2048, x=2**1024)
sage: a = ZZ.random_element(x = 2**1024)
sage: %time _ = f(a)
CPU times: user 0.22 s, sys: 0.00 s, total: 0.22 s
Wall time: 0.23 s

comment:2 Changed 11 years ago by spancratz

Apply only trac-10617.2.patch --- I forgot to mark the "replace" box. Sebastian

comment:3 Changed 11 years ago by spancratz

Actually, I just had to re-upload the patch and this time I did remember to tick the "replace" box, so it's now

trac-10617.patch

again. Sebastian

comment:4 Changed 11 years ago by boothby

  • Status changed from new to needs_review

comment:5 Changed 11 years ago by boothby

  • Status changed from needs_review to positive_review

Works for me.

comment:6 Changed 11 years ago by jdemeyer

  • Status changed from positive_review to needs_work
  1. Please fill in your real names as Author/Reviewer?
  2. The patch should be a proper hg changeset, i.e. created with hg export tip instead of hg diff.
  3. The patch should be rebased to sage-4.6.2.alpha1.

comment:7 Changed 10 years ago by mhansen

  • Authors changed from spancratz to Sebastian Pancratz
  • Cc mhansen added

We should update this quickly after updating FLINT in Sage.

Changed 10 years ago by mhansen

comment:8 Changed 10 years ago by mhansen

  • Reviewers set to Mike Hansen
  • Status changed from needs_work to needs_review

Apply only trac_10617.patch

comment:9 Changed 10 years ago by mhansen

  • Description modified (diff)
  • Reviewers changed from Mike Hansen to Tom Boothby, Mike Hansen
  • Status changed from needs_review to positive_review

I've rebased the patch, and everything looks good.

comment:10 Changed 10 years ago by jdemeyer

  • Merged in set to sage-5.1.beta5
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.