Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piecewise cannot typecasted into number even if all conditions are evaluated. #393

Closed
nkanazawa1989 opened this issue Mar 3, 2022 · 1 comment · Fixed by symengine/symengine#1890

Comments

@nkanazawa1989
Copy link

This is feature request for Piecewise to be automatically simplified when all conditions are evaluated.

Currently this code doesn't work due to NotImplemented error.

t = Symbol("t")
f = Piecewise((1j, t > 1), (1, True))
complex(f.subs(t, 0))

We always need to write

complex(f.subs(t, 0).simplify())

This looks like bit redundant and may cause performance issue (especially when this code is written in a function taking arbitrary f, i.e. unnecessary simplify is always called).

version: 0.8.1

@isuruf
Copy link
Member

isuruf commented Mar 3, 2022

See symengine/symengine#1890

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants