-
Notifications
You must be signed in to change notification settings - Fork 33
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
Interval set type #270
Comments
we can approach this by: treating a real interval as a numeric type, and the no-ops can be defined for scalars. |
It is not clear to me what you mean by numeric type. Do we want to have |
i mean to not add a new set type; just use them as scalars. all the operations of above work out of the box; the no-op is |
But we call |
well, that is a problem of overloading functions names, overapproximate is doing nothing! |
But the result for |
ultimately we'll see if we hit some issue doing #74 |
point taken. let's do one LazySet extension (wrapper) around an existing interval arithmetic element 👍 |
type proposal: @require IntervalArithmetic begin
import IntervalArithmetic.AbstractInterval
"""
IA = IntervalArithmetic
Name alias for the interval arithmetic library.
"""
const IA = IntervalArithmetic
export Interval, IA
struct Interval{N, IN <: AbstractInterval{N}} <: AbstractPointSymmetricPolytope{N}
dat::IN
end
# type-less convenience constructor
Interval{N, IN <: AbstractInterval{N}}(interval::IN) = Interval{N, IN}(interval)
# TODO: adapt show method
end Questions:
|
Looks good. It could also be an |
What does |
yes, and actually
the field name with the data but we could use another name. should be used only internally. |
Is |
Maybe |
think about it as a unidimensional interval over the real line. the definition in the library is: abstract type AbstractInterval{T} <: Real end
struct Interval{T<:Real} <: AbstractInterval{T}
lo :: T
hi :: T
function Interval{T}(a::Real, b::Real) where T<:Real
if validity_check
if is_valid_interval(a, b)
new(a, b)
else
throw(ArgumentError("Interval of form [$a, $b] not allowed. Must have a ≤ b to construct interval(a, b)."))
end
end
new(a, b)
end
end |
Oh, silly me, it is 1D of course 👍 |
i've updated the previous comment within julia> using LazySets, IntervalArithmetic
INFO: Precompiling module LazySets.
julia> x = LazySets.Interval(IA.Interval(0.0, 1.0))
LazySets.Interval{Float64,IntervalArithmetic.Interval{Float64}}([0, 1]) what i dislike is that one needs to use the |
You can define a type alias for each of them. const IN = IA.Interval
const ITV = LazySets.Interval But I agree that this is bogus. |
that's a good idea. |
And while you are at it, one from a vector :) |
We need:
overapproximate
(no-op)decompose
The text was updated successfully, but these errors were encountered: