90void r8vec_bracket3(
int const n,
double const* t,
double const tval,
int* left)
100 <<
"R8VEC_BRACKET3 - Fatal error! N must be at least 2." << endl;
105 if ((*left < 0) || (n - 2 < *left))
124 else if (t[*left - 1] <= tval)
130 else if (tval <= t[1])
150 mid = (low + high + 1) / 2;
168 else if (t[*left + 1] < tval)
175 else if (*left == n - 3)
181 else if (tval <= t[*left + 2])
187 else if (t[n - 2] <= tval)
205 mid = (low + high + 1) / 2;
274void hermite_cubic_value(
double const x1,
double const f1,
double const d1,
double const x2,
double const f2,
double const d2,
int const n,
double const* x,
double* f,
double* d,
double* s,
double* t)
285 c2 = -(2.0 * d1 - 3.0 * df + d2) / h;
286 c3 = (d1 - 2.0 * df + d2) / h / h;
288 for (i = 0; i < n; i++)
290 f[i] = f1 + (x[i] - x1) * (d1 + (x[i] - x1) * (c2 + (x[i] - x1) * c3));
291 d[i] = d1 + (x[i] - x1) * (2.0 * c2 + (x[i] - x1) * 3.0 * c3);
292 s[i] = 2.0 * c2 + (x[i] - x1) * 6.0 * c3;
352void hermite_cubic_spline_value(
int const nn,
double*
const xn,
double*
const fn,
double*
const dn,
int const n,
double*
const x,
double* f,
double* d,
double* s,
double* t)
356 for (
int i = 0; i < n; i++)
360 hermite_cubic_value(xn[left], fn[left], dn[left], xn[left + 1], fn[left + 1], dn[left + 1], 1, x + i, f + i, d + i, s + i, t + i);
void hermite_cubic_value(double const x1, double const f1, double const d1, double const x2, double const f2, double const d2, int const n, double const *x, double *f, double *d, double *s, double *t)
This is part of a C++ library from http://people.sc.fsu.edu/~jburkardt/cpp_src/hermite_cubic/hermite_...
void r8vec_bracket3(int const n, double const *t, double const tval, int *left)
This is part of a C++ library from http://people.sc.fsu.edu/~jburkardt/cpp_src/hermite_cubic/hermite_...
void hermite_cubic_spline_value(int const nn, double *const xn, double *const fn, double *const dn, int const n, double *const x, double *f, double *d, double *s, double *t)
This is part of a C++ library from http://people.sc.fsu.edu/~jburkardt/cpp_src/hermite_cubic/hermite_...
Definitions of some routines from the hermite_cubic library.