Closed sbondorf closed 6 years ago
You are correct, this should be possible and benefit a lot more code parts.
For illustration, the NumBackend is a good example. There, we provide Num create{Zero,PositiveInfinity,NegativeInfinity}
as well as Num get{Zero,PositiveInfinity,NegativeInfinity}
. Moreover, there we have the boolean is{Zero,PositiveInfinity,NegativeInfinity}
.
The last alternative is probably the best option for this piece of code as well. However, getting this done properly involves tackling issue #7. I feel this is a bit too much effort to simply patch this bug.
Another aspect to favor this solution is the dependance of the curve on the current NumBackend. If we use a static constant, we need to make sure to not mix NumBackend of curves. This is prevented by newly creating a the curve in this location. This relates to the yet untackled issue #20.
Sometimes nice solutions take time:). Anyway we can do the quick patch for v2.5 and collect tasks for next version for refactoring.
Created task #42 to collect the refactoring tasks for v2.6. Also added the milestone to be able to separate tasks between versions.
plus submodule updates along the way