C++ version of cline/renka's spline under tension code