Opened 12 years ago

Closed 12 years ago

#1391 closed defect (fixed)

[with patch, with positive review] bug in unit part of factorizations of multivariate polynomials

Reported by: was Owned by: malb
Priority: major Milestone: sage-2.10.1
Component: commutative algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

Behold this behavior:

sage: R.<a,b,c,d> = QQ[]
sage: f =  (-1) * (a - d) * (-a + b) * (b - d) * (a - c) * (b - c) * (c - d)
sage: f.factor()
(-1) * (a - d) * (-a + b) * (b - d) * (a - c) * (b - c) * (c - d)
sage: F = f.factor()
sage: F[0][0]
-1
sage: F.unit_part ()
1

However it should be that F.unit_part() is -1 and F[0][0] is a-d.

Attachments (2)

trac_1391.patch (3.0 KB) - added by malb 12 years ago.
trac-1391-apply_after_patch_rej_from_other_patch.patch (2.1 KB) - added by was 12 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 12 years ago by mabshoff

  • Milestone changed from sage-2.10 to sage-2.9.2

Bug Day material?

Cheers,

Michael

Changed 12 years ago by malb

comment:2 Changed 12 years ago by malb

  • Summary changed from bug in unit part of factorizations of multivariate polynomials to [with patch, needs review] bug in unit part of factorizations of multivariate polynomials

The attached patch fixes the issue

comment:3 Changed 12 years ago by ncalexan

  • Summary changed from [with patch, needs review] bug in unit part of factorizations of multivariate polynomials to [with patch, with positive review] bug in unit part of factorizations of multivariate polynomials

Patch looks reasonable. The parameter to factor() is not standard sage but seems appropriate. I say apply!

comment:4 Changed 12 years ago by mabshoff

  • Summary changed from [with patch, with positive review] bug in unit part of factorizations of multivariate polynomials to [with patch, needs rebase] bug in unit part of factorizations of multivariate polynomials

The patch no longer applies to me in 2.10.1.alpha0, so it probably needs just a rebase:

sage-2.10.1.alpha0/devel/sage$ patch -p1 --dry-run < trac_1391.patch
patching file sage/rings/polynomial/multi_polynomial_libsingular.pyx
Hunk #1 FAILED at 3096.
Hunk #2 succeeded at 3159 (offset 22 lines).
1 out of 2 hunks FAILED -- saving rejects to file sage/rings/polynomial/multi_polynomial_libsingular.pyx.rej

Cheers,

Michael

comment:5 Changed 12 years ago by mabshoff

  • Resolution set to fixed
  • Status changed from new to closed
  • Summary changed from [with patch, needs rebase] bug in unit part of factorizations of multivariate polynomials to [with patch, with positive review] bug in unit part of factorizations of multivariate polynomials

Merged in Sage 2.10.1.alpha0

Note: See TracTickets for help on using tickets.