-
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
New axis: piecewise_regular #47
Comments
I would like to work on this project. Please explain the further details required to accomplish the task. Thank you. |
Hi, thank you for your interest. you should look into the implementation of boost::histogram::axis::regular to get an idea how this axis would work, also have a look at the Axis concept in the documentation. I gave this axis more thought in the meantime and it should be even more generalized: piecewise is a new axis which pieces several other axis types together.
The It is created by a
Upon construction, |
Are you looking for a new axis that pieces together:
make_piecewise(axis::category, axis::boolean, axis::regular) // 1
make_piecewise(axis::regular<sqrt>, axis:regular, axis::regular<log>) // 2
make_piecewise(axis::variable, axis::regular) // 3 If it's the first one, what is the use case? |
I was originally thinking only of 2) but 3) is a natural generalization. As a further generalization, it would be great to also stitch integer axes together, but then the code needs to ensure that integer axes cannot be mixed with regular or variable axes. This can be achieved with a static_assert on the value_type of the axes, they either need to be all integer or all floating point. We cannot do 1). It only makes sense to stitch continuous unbounded axes together, so we don't need to worry about stitching axis::category or axis::boolean. |
I can see how piecing together floating axis types might give spacing that is difficult to achieve with a simple transformation (e.g., sqrt, log, etc). But, I'm not seeing why one would want to stitch together integer axes. If I understand it correctly, the width of an integer axis is always one. Is there a potential advantage? |
True, it makes no sense if we do not allow gaps between consecutive axes. I had not read the whole issue again to refresh my memory, so I was considering to allow gaps between axes. In that case it might be useful to stitch several integer axes together with gaps between them. You could use a category axis to have gaps in an integer range, but bin lookup for a category axis is more expensive and you need to allocate memory from the heap for a category axis, as opposed to an integer axis. |
A composed axis of several connected regular axis without gaps. Should use regular_axis underneath.
The text was updated successfully, but these errors were encountered: