90void r8vec_bracket3(
int const n,
double const* t,
double const tval,
int* left)
99 cerr << endl <<
"R8VEC_BRACKET3 - Fatal error! N must be at least 2." << endl;
104 if (( * left < 0) || (n - 2 < * left))
106 * left = (n - 1) / 2;
110 if ( tval < t[ * left] )
117 else if ( * left == 1 )
123 else if ( t[ * left - 1] <= tval )
129 else if ( tval <= t[1] )
149 mid = ( low + high + 1 ) / 2;
151 if ( t[mid] <= tval )
167 else if ( t[ * left + 1] < tval )
169 if ( * left == n - 2 )
174 else if ( * left == n - 3 )
180 else if ( tval <= t[ * left + 2] )
186 else if ( t[n - 2] <= tval )
204 mid = ( low + high + 1 ) / 2;
206 if ( t[mid] <= tval )
273void 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)
284 c2 = - ( 2.0 * d1 - 3.0 * df + d2 ) / h;
285 c3 = ( d1 - 2.0 * df + d2 ) / h / h;
287 for (i = 0; i < n; i++)
289 f[i] = f1 + ( x[i] - x1 ) * ( d1
290 + ( x[i] - x1 ) * ( c2
291 + ( x[i] - x1 ) * c3 ) );
292 d[i] = d1 + ( x[i] - x1 ) * ( 2.0 * c2
293 + ( x[i] - x1 ) * 3.0 * c3 );
294 s[i] = 2.0 * c2 + ( x[i] - x1 ) * 6.0 * c3;
354void 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)
358 for (
int i = 0; i < n; i++)
362 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);
This file contains global definitions for CoastalME.
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.