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))
110 if ( tval < t[*left] )
116 else if ( *left == 1 )
121 else if ( t[*left-1] <= tval )
126 else if ( tval <= t[1] )
145 mid = ( low + high + 1 ) / 2;
147 if ( t[mid] <= tval )
161 else if ( t[*left+1] < tval )
163 if ( *left == n - 2 )
167 else if ( *left == n - 3 )
172 else if ( tval <= t[*left+2] )
177 else if ( t[n-2] <= tval )
195 mid = ( low + high + 1 ) / 2;
197 if ( t[mid] <= tval )
263void 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)
274 c2 = - ( 2.0 * d1 - 3.0 * df + d2 ) / h;
275 c3 = ( d1 - 2.0 * df + d2 ) / h / h;
277 for (i = 0; i < n; i++)
279 f[i] = f1 + ( x[i] - x1 ) * ( d1
280 + ( x[i] - x1 ) * ( c2
281 + ( x[i] - x1 ) * c3 ) );
282 d[i] = d1 + ( x[i] - x1 ) * ( 2.0 * c2
283 + ( x[i] - x1 ) * 3.0 * c3 );
284 s[i] = 2.0 * c2 + ( x[i] - x1 ) * 6.0 * c3;
343void 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)
347 for (
int i = 0; i < n; i++)
351 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.