Skip to content

Bug in convolution in old Piecewise #12123

@kcrisman

Description

@kcrisman

The old Piecewise (pre #14801; now deprecated) has this bug:


sage: x = PolynomialRing(QQ,'x').gen()
sage: f = Piecewise([[(-2, 2), 2 * x^0]])
sage: g = Piecewise([[(0, 2), 3/4 * x^0]])
sage: n = f.convolution(g)

sage: n
Piecewise defined function with 3 parts, [[(-2, 0), 3/2*x + 3], [(0, 2), 6], [(2, 4), -3/2*x + 6]]

But the middle piece should be 3, not 6, apparently.

See the original report at this ask.sagemath.org question.

Note this is fixed in the new piecewise (lowercase p, from #14801).

sage: x = PolynomialRing(QQ,'x').gen()
sage: f = piecewise([[(-2, 2), 2 * x^0]])
sage: g = piecewise([[(0, 2), 3/4 * x^0]])
sage: n = f.convolution(g)
sage: n
piecewise(x|-->3/2*x + 3 on (-2, 0], x|-->3 on (0, 2], x|-->-3/2*x + 6 on (2, 4]; x)

Can close this bug when the old Piecewise is removed completely.

CC: @wdjoyner @kcrisman @jondo @vbraun @slel @mkoeppe @eviatarbach @rwst

Component: calculus

Keywords: piecewise

Stopgaps: todo

Reviewer: Travis Scrimshaw

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions