#14801: Piecewise functions done right
-------------------------------------+-------------------------------------
Reporter: vbraun | Owner: burcin
Type: defect | Status: needs_work
Priority: major | Milestone: sage-6.4
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: Volker Braun, | Reviewers:
Ralf Stephan | Work issues:
Report Upstream: N/A | Commit:
Branch: public/piecewise | 262b01e0de35a35d46fedda5e99255a26b9b36fa
Dependencies: #14800, #14780, | Stopgaps:
#9556, #13125, #14802, #16397 |
-------------------------------------+-------------------------------------
Comment (by rws):
Replying to [comment:30 jdemeyer]:
> Given that
> {{{
> f(x) = foo
> }}}
> is preprocessor syntactic sugar for
> {{{
> f = foo.function(x)
> }}}
> the simplest solution might be to override the `.function()` method to
also change the variable name of the piecewise function.
As far as I understand it, the only time `symbolic_expr.function(..)`
recurses into the expression is when converting into the
`CallableSymbolicExpressionRing` which calls
`SymbolicRing._element_constructor_()`. I don't think I can easily hand
`var` down to that machinery, recognize when a `piecewise` get converted,
and call a member func then.
IOW, the `piecewise` on the r.h.s. of `f(x) = piecewise([((0,2), y^3)])`
may be buried within an expression, and I find it not the "simplest
solution" to handle its `var` via `.function()`. But that's from a first
look at parts of the code I have never worked with, so I would appreciate
any hint.
--
Ticket URL: <http://trac.sagemath.org/ticket/14801#comment:31>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.