Re: [sage-devel] Re: problem/ possible bug with picewise constant functions

2016-04-22 Thread David Joyner
On Thu, Apr 21, 2016 at 11:50 PM, Ralf Stephan wrote: > Please review > http://trac.sagemath.org/ticket/14801 > I love this!! You and Volker have done such great work on this and I really am very much looking forward to this being put into Sage. Also, I don't see any examples

Re: [sage-devel] Re: problem/ possible bug with picewise constant functions

2016-04-21 Thread Ralf Stephan
Please review http://trac.sagemath.org/ticket/14801 Regards, -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to

Re: [sage-devel] Re: problem/ possible bug with picewise constant functions

2016-04-21 Thread Ralf Stephan
Please review http://trac.sagemath.org/ticket/14801 Regards, -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to

Re: [sage-devel] Re: problem/ possible bug with picewise constant functions

2016-04-21 Thread David Joyner
On Tue, Feb 17, 2015 at 7:14 AM, Pablo De Napoli wrote: > Many thanks Nils for your help. > > I think that is important that sage has consistent and easy to use > interfaces, that functions do what most people would expect them to do > at every place. Specially if we want it to

[sage-devel] Re: problem/ possible bug with picewise constant functions

2016-04-21 Thread Nils Bruin
On Thursday, April 21, 2016 at 10:44:19 AM UTC-7, Francisco Pena wrote: > > Hi, > > I believe the solution of Nils using SR(0) is very elegant, but it cannot > be applied in every case. For example, when the piecewise is created by > another method (trapezoid): > > f = Piecewise([[(-1,1),

[sage-devel] Re: problem/ possible bug with picewise constant functions

2016-04-21 Thread Francisco Pena
Hi, I believe the solution of Nils using SR(0) is very elegant, but it cannot be applied in every case. For example, when the piecewise is created by another method (trapezoid): f = Piecewise([[(-1,1), sin(x^2)]]) t = f.trapezoid(3) Here t has a constant part in (-1/3,1/3): Piecewise

Re: [sage-devel] Re: problem/ possible bug with picewise constant functions

2015-02-17 Thread Pablo De Napoli
Many thanks Nils for your help. I think that is important that sage has consistent and easy to use interfaces, that functions do what most people would expect them to do at every place. Specially if we want it to be used in calculus classes, etc. Writing something like SR(0).function(x)

[sage-devel] Re: problem/ possible bug with picewise constant functions

2015-02-16 Thread Nils Bruin
On Monday, February 16, 2015 at 8:33:49 AM UTC-8, Nils Bruin wrote: f3=Piecewise([([0,1],SR(0).function(x)),([1,2],(1-x).function(x))]) Incidentally, the Piecewise documentation, which you can get with Piecewise? , has a nice shortcut form: sage: f3 = Piecewise([([0,1],SR(0)), ([1,2],1-x)],

[sage-devel] Re: problem/ possible bug with picewise constant functions

2015-02-16 Thread Nils Bruin
On Monday, February 16, 2015 at 5:46:06 AM UTC-8, pdenapo wrote: Hi, I'm having trouble with some piecewise constant functions. Suppose that I define f=Piecewise ([([0,1],0),([1,2],x-1)]) Then f.integral() works as expected, but f.derivative() will fail with TypeError:

[sage-devel] Re: problem/ possible bug with picewise constant functions

2015-02-16 Thread Pablo De Napoli
Hi, Another strange behavoir: sage: f=Piecewise([[(1/3,1/2),x]]) sage: f.extend_by_zero_to(0,1) Piecewise defined function with 3 parts, [[(0, 1/3), 0], [(1/3, 1/2), x], [(1/2, 1), 0]] sage: f.domain() (1/3, 1/2) extend_by_zero shouldn't have changed the domain to (0,1) ? sage: f.integral()