In evaluating s( theta, z ) from its normalized representation, the library currently assumes theta to be periodic. The library can `easily' be made to be more general, ie the library can should allow the user to specify the which variable is periodic or none at all.
The routine eval_Bspline_derivs is an optimized version of the routine BsplineAlgo_c. This was done by folding one of the calls to calculate the derivative into the call to evaluate s( theta, z ). It will require a little work to fold in the other derivative. A 10-15% savings is expected.
The library currently needs three arrays of B-spline coefficients ( scoef->c, scoef->cdifz, scoef->cdift ), a more optimized data structure would be to pass the library an array of structures. Theoretically, this will minimize caching in results since only n number (where n is the order of the B-spline) of elements are needed to evaluate the spline.