/* * call-seq: * Dvector.create_pm_cubic_interpolant(xs, ys) -> interpolant * * Uses Dvectors _xs_ and _ys_ to create a cubic pm_cubic interpolant. The _xs_ must be given in ascending order. * The interpolant is an array of Dvectors: [Xs, Ys, As, Bs, Cs]. * For x between Xs[j] and Xs[j+1], let dx = x - Xs[j], and find interpolated y for x by * y = As[j]*dx^3 + Bs[j]*dx^2 + Cs[j]*dx + Ys[j]. * pm_cubic algorithms derived from Steffen, M., "A simple method for monotonic interpolation in one dimension", * Astron. Astrophys., (239) 1990, 443-450. * */ VALUE dvector_create_pm_cubic_interpolant(int argc, VALUE *argv, VALUE klass) {