Comments (8)
That sounds doable. Currently the spheres are hardcoded to be EuclideanDomain
, but ProductDomain already mostly works more generically. If you comment out the two checks in the inner constructor here, then you get this behaviour:
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.)
I've invoked the constructor explicitly here. It would be a matter of modifying the computation of the element types, plus finding a nicer way of invoking the constructor. Perhaps when invoked with an array of domains, a ProductDomain
could use array's as type. When invoked with an argument list of domains, it could be a tuple.
It is similar with the spheres: there could be an AbstractHyperSphere{T} <: Domain{T}
and an AbstractEuclideanHyperSphere{N,T} <: AbstractHyperSphere{SVector{N,T}}
. And some syntax for constructing them. Care to look at it?
from domainsets.jl.
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.
from domainsets.jl.
Cool, I hope using DomainSets
works out. You suggested an interesting generalization that fits well in the package, because the whole aim is to be general and avoid repetition in other packages. I will try to get to this particular issue soon, and update here.
from domainsets.jl.
Great, thanks! I think this could be a valuable building block for statistics/fitting/optimization/etc. applications, to avoid redundant functionality across packages.
from domainsets.jl.
Working on it in #55. It motivated working on some other issues as well, and #55 will perhaps take some time and additional effort before we can merge it I'm afraid.
from domainsets.jl.
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/...).
from domainsets.jl.
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! :-)
from domainsets.jl.
Thanks a lot - will do!
from domainsets.jl.
Related Issues (20)
- More Spaces HOT 18
- Center for HyperRectangle? HOT 4
- Should boundary(::Rectangle) use simpler types? HOT 2
- Failure on julia master `Method overwriting is not permitted during Module precompile.` HOT 1
- Precompiling ParameterEstimation fails HOT 2
- Hashes of domains should be consistent with equality HOT 3
- Getting the domain/support of objects, and domain type hierarchy HOT 61
- Support constructors along with `convert` HOT 3
- arithmetic operations with broadcasting
- package extensions and interoperability with different domain types HOT 1
- Roadmap for future development of DomainSets HOT 3
- A confusing bug HOT 9
- VcatDomain(ℝ, ℕ) causes MethodError HOT 2
- Removing points from interval HOT 3
- Depend on EltypeExtensions.jl? HOT 6
- Triangles? HOT 1
- Add Makie extension? HOT 3
- Fix codecov
- `RealNumbers` vs `RealLine` HOT 3
- Allow Makie v0.21 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from domainsets.jl.