Closed philip-stuckey closed 1 year ago
Thanks for the suggestion. I think it may make sense to define it for any product domain. Care to have a go at it?
Sure, I'll take a swing at it, I'll just need a moment to familiarize myself with the code a bit.
Hmm, I'm afraid the ProductDomain
code is a bit overly complicated at the moment. It should be like the one-liner you write, but for a ProductDomain
and perhaps with factors
instead of components
for clarity. If it isn't, then don't spend too much time and just go for the HyperRectangle
like above.
I just added a function to src/generic/productdomain.jl
, what I'm not sure about is where to put tests.
edit: specifically center(d::ProductDomain) = hcat(map(center, factors(d))...)
to line 54
Would it make sense to define the center of a hyper-rectangle as
center(rectangle::HyperRectangle)=center.(components(rectangle))
? Either way, I would findcenter(::Rectangle)
useful.