At the moment I am working on a differential equation solving method called basis-spline collocation. What I am having trouble with is building a method to build an arbitrary order spline, with the relationship $$B^{k+1}_{i}(x)= \frac{x-x_i}{x_{k+i}-x_i}B^k_i + \frac{x_{k+i+1}-x}{x_{k+i+1}-x_{i+1}}B^k_{i+1}(x) $$with the initial condition$$B^1_i(x)=\begin{cases}            1 & \; \text{for } \; x_i \leq x < x_{i+1} \\            0 & \; \text{otherwise}        \end{cases}$$and I am having trouble even starting with this problem, as it is recursive on could start from either the top or the bottom, and I am running into a general writers block type of thing, where I can't get my mind around what I'm needing to do.
How to build a recursive spline function in C++
c++;b spline