Closed VikingScientist closed 6 years ago
In this line https://github.com/sintefmath/Splipy/blob/master/splipy/basis_eval.pyx#L97
mu is 0, p is 3 and j is 1. Since all types are unsigned ints, the value of k wraps around to 4294967294.
I'm not familiar enough with the algorithm to say which of these values are wrong though.
I think line 74 is at fault. The floating point modulus operator wraps the evaluation point into the range [start, end)
, which really should be (start, end]
in the case of left-limit evaluation.
The bug is actually even more frequent than the first code seem to suggest. It happens with no derivatives and no periodicity:
from splipy import BSplineBasis
b = BSplineBasis(3, [0,0,0,1,2,3,4,4,4])
b.evaluate(t=0, d=0, from_right=False)
One should never get to line 97 which you linked to, and mu=0 makes no sense; mu=p
is the lowest allowed value.
Crashes with
Segmentation fault
from cython evaluation call.Correct behavior should wrap this evaluation point to t=4 which causes no crash.