-
Notifications
You must be signed in to change notification settings - Fork 12
Support for non-static dimensionality? #53
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
Comments
That sounds doable. Currently the spheres are hardcoded to be julia> using DomainSets
julia> b = 0..1.0
0.0..1.0
julia> domains = [b for i in 1:10]
10-element Array{Interval{:closed,:closed,Float64},1}:
0.0..1.0
0.0..1.0
0.0..1.0
0.0..1.0
0.0..1.0
0.0..1.0
0.0..1.0
0.0..1.0
0.0..1.0
0.0..1.0
julia> p = DomainSets.ProductDomain{typeof(domains),Vector{Float64},Vector{Float64}}(domains)
0.0..1.0 x 0.0..1.0 x 0.0..1.0 x 0.0..1.0 x 0.0..1.0 x 0.0..1.0 x 0.0..1.0 x 0.0..1.0 x 0.0..1.0 x 0.0..1.0
julia> rand(10) ∈ p
true
julia> 2*rand(10) ∈ p
false (The final test will succeed with some probability.) It is similar with the spheres: there could be an |
Maybe, yes. I have something similar in BAT.jl, for boundaries for likelihoods and priors and I was looking for a solution that's more generic. DomainSets may be a great fit. |
Cool, I hope using |
Great, thanks! I think this could be a valuable building block for statistics/fitting/optimization/etc. applications, to avoid redundant functionality across packages. |
Thanks, @daanhb! I'l try to pitch in at some point, I'll try to get a clearer idea on requirements - and how to represent them more cleanly than I do at the moment - first, for such applications (statistics/fitting/optimization/...). |
The changes have been merged into version 0.3. The README is updated with a few examples of basic usage. Issues are to be expected - please report! :-) |
Thanks a lot - will do! |
For higher-dimensional problems it would be great to have support for non-static dimensionality and argument types like
Vector
in addition toSVector
. E.g. aProductDomain
based onAbstractVector{IntervalSet}
should allow forin(x::AbstractVector, d::ProductDomain)
. N-dimensional hyper-spheres with N not fixed at compile time would also come on very handy.The text was updated successfully, but these errors were encountered: