Opened 7 years ago
Closed 7 years ago
#18420 closed enhancement (fixed)
Uniformize truncated multiplication for polynomials
Reported by:  Vincent Delecroix  Owned by:  

Priority:  major  Milestone:  sage6.7 
Component:  algebra  Keywords:  
Cc:  Merged in:  
Authors:  Vincent Delecroix  Reviewers:  Mario Pernici 
Report Upstream:  N/A  Work issues:  
Branch:  063516e (Commits, GitHub, GitLab)  Commit:  063516e84406367fdce86bdc7bf5e19cd9ec14ae 
Dependencies:  Stopgaps: 
Description (last modified by )
The operation _mul_trunc
on polynomials is currently only implemented in specialized classes with custom declaration. We define a global one in Polynomial with signature
class Polynomial: cpdef Polynomial _mul_trunc_(self, Polynomial right, long n)
(and deprecate the former _mul_trunc).
We also add specialized implentation for integer polynomials (relying on fmpz_poly_mullow
) and rational polynomials (relying on fmpq_poly_mullow
).
Such method would be really helpful for multiplication of power series.
Change History (17)
comment:1 Changed 7 years ago by
Description:  modified (diff) 

comment:2 Changed 7 years ago by
Branch:  → u/vdelecroix/18420 

Commit:  → 446b952f32665697ee168f7fc61649f540a82e73 
Status:  new → needs_review 
comment:3 Changed 7 years ago by
Commit:  446b952f32665697ee168f7fc61649f540a82e73 → 4e96421ff4be51ed7ff188281a0764f7c1a6ba7c 

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
4e96421  Trac 18420: _mul_trunc_ for all polynomials

comment:4 Changed 7 years ago by
Commit:  4e96421ff4be51ed7ff188281a0764f7c1a6ba7c → b73a8404319fc0f7542989c340376c43610bc1e0 

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
b73a840  Trac 18420: _mul_trunc_ for all polynomials

comment:6 Changed 7 years ago by
Description:  modified (diff) 

comment:7 Changed 7 years ago by
Commit:  b73a8404319fc0f7542989c340376c43610bc1e0 → 12d6361f7dc92fd0054da2b83bab60c59a3ad201 

Branch pushed to git repo; I updated commit sha1. New commits:
12d6361  Trac #18420: fix declaration im polynomial_template.pxi

comment:8 Changed 7 years ago by
Polynomial._mul_trunc_
doctest example should have _mul_trunc_
, not _mul_trunc
comment:9 Changed 7 years ago by
Commit:  12d6361f7dc92fd0054da2b83bab60c59a3ad201 → febe298b5c00d5a5ed521a859e828bbbf2db5421 

Branch pushed to git repo; I updated commit sha1. New commits:
febe298  Trac #18420: _mul_trunc > _mul_trunc_ in doctest

comment:10 Changed 7 years ago by
Why did you add the comment in
cpdef ModuleElement _rmul_(self, RingElement c) # ??!?
comment:11 Changed 7 years ago by
Status:  needs_review → needs_info 

comment:12 Changed 7 years ago by
Because this has nothing to do in sage/rings/polynomial/polynomial_modn_dense_ntl.pxd
. Moreover, it seems to be never used.
It is a good idea to introduce special rule for multiplication by constants. But this should be done globally. I will make the comment clearer.
Vincent
comment:13 Changed 7 years ago by
All right, I can just get rid of the declaration in the pxd file and everything is fine. Let me do it.
comment:14 Changed 7 years ago by
Commit:  febe298b5c00d5a5ed521a859e828bbbf2db5421 → 063516e84406367fdce86bdc7bf5e19cd9ec14ae 

Branch pushed to git repo; I updated commit sha1. New commits:
063516e  Trac #18420: remove redundant declaration of _lmul_, _rmul_

comment:15 Changed 7 years ago by
Reviewers:  → Mario Pernici 

Status:  needs_info → needs_review 
comment:16 Changed 7 years ago by
Status:  needs_review → positive_review 

comment:17 Changed 7 years ago by
Branch:  u/vdelecroix/18420 → 063516e84406367fdce86bdc7bf5e19cd9ec14ae 

Resolution:  → fixed 
Status:  positive_review → closed 
New commits:
Trac 18420: _mul_trunc_ for all polynomials