-
Notifications
You must be signed in to change notification settings - Fork 71
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 functions #655
Comments
Ah that's because julia> zero(emptyinterval())
[0.0, 0.0]_com I have an idea for how to make a default 0 value. |
This version works: function (piecewise::Piecewise)(X::Interval)
return reduce(hull, begin
val = intersect_interval(X, region)
isempty_interval(val) ? val : f(val)
end
for (region, f) ∈ piecewise.pieces)
end
H = Piecewise(-Inf..0 => zero, 0..Inf => one)
|
It would probably be worth having a |
We also need to add the decoration of course. |
This was referenced May 26, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a possible implementation for piecewise functions:
Then Heaviside should be definable with
but that is not working for me right now 🤔 E.g. it gives
whereas it should give
[1, 1]
.The text was updated successfully, but these errors were encountered: