1 #ifndef _UniformBSpline_Spline_Uniform_h_
2 #define _UniformBSpline_Spline_Uniform_h_
9 #include <utl/AugerException.h>
14 typedef unsigned char dim_t;
17 template <dim_t ADimension,
typename AKnotVector,
typename ABasisFunction>
27 KnotVector(
const size_t n,
const double start,
const double stop) :
49 Locate(
const double x)
102 return (derivative == -1) ? Internal(
fKnotPtr->Locate(x),
GetStop(), -1) : 0;
104 return Internal(
fKnotPtr->Locate(x), x, derivative);
113 Internal(
const size_t i,
const double x,
const char derivative)
118 const double dx = xknot[1] - xknot[0];
119 const double z = (x - xknot[i]) / dx;
154 switch (derivative) {
156 double result = z*(t0 + z*(t1/2 + z*(t2/3 + z*t3/4)))*dx;
189 result += (t0 + (t1/2 + (t2/3 + t3/4)))*dx;
194 return t0 + z*(t1 + z*(t2 + z*
t3));
196 return (t1 + z*(2*t2 + z*3*t3))/
dx;
198 return (2*t2 + z*6*t3)/(dx*
dx);
200 return 6*t3/(dx*dx*
dx);
209 template <dim_t ADimension,
typename AKnotVector,
typename ABasisFunction>
210 friend class ::Spline::Function;
Base class for exceptions arising because configuration data are not valid.