61    void updatePoints(
const std::vector<Scalar>& x, 
const std::vector<Scalar>& y)
 
   67        numPoints_ = x.size();
 
   69        const auto numSegments = numPoints_-1;
 
   70        coeff_.resize(numSegments*4+2); 
 
   73        Dune::BTDMatrix<Dune::FieldMatrix<double, 1, 1>> matrix(numPoints_);
 
   74        Dune::BlockVector<Dune::FieldVector<double, 1>> rhs(numPoints_);
 
   75        Dune::BlockVector<Dune::FieldVector<double, 1>> d(numPoints_);
 
   80        rhs[0] = 3.0*(y[1] - y[0]);
 
   81        for (
int i = 1; i < numPoints_-1; ++i)
 
   86            rhs[i] = 3.0*(y[i+1] - y[i-1]);
 
   88        matrix[numPoints_-1][numPoints_-1] = 2.0;
 
   89        matrix[numPoints_-1][numPoints_-2] = 1.0;
 
   90        rhs[numPoints_-1] = 3.0*(y[numPoints_-1] - y[numPoints_-2]);
 
   96        std::size_t offset = 0;
 
   97        for (
int i = 0; i < numSegments; ++i, offset += 4)
 
   99            coeff_[offset+0] = y[i];
 
  100            coeff_[offset+1] = d[i];
 
  101            coeff_[offset+2] = 3.0*(y[i+1]-y[i]) - 2.0*d[i] - d[i+1];
 
  102            coeff_[offset+3] = 2.0*(y[i]-y[i+1]) + d[i] + d[i+1];
 
  104        coeff_[offset+0] = y[numPoints_-1];
 
  105        coeff_[offset+1] = d[numPoints_-1];
 
 
  113    Scalar 
eval(
const Scalar x)
 const 
  117        else if (x > x_[numPoints_-1])
 
  118            return coeff_[(numPoints_-1)*4] + 
evalDerivative(x_[numPoints_-1])*(x - x_[numPoints_-1]);
 
  121            const auto lookUpIndex = std::distance(x_.begin(), std::lower_bound(x_.begin(), x_.end(), x));
 
  122            assert(lookUpIndex != 0);
 
  125            const auto* coeff = coeff_.data() + (lookUpIndex-1)*4;
 
  128            const auto t = (x - x_[lookUpIndex-1])/(x_[lookUpIndex] - x_[lookUpIndex-1]);
 
  129            return coeff[0] + t*(coeff[1] + t*coeff[2] + t*t*coeff[3]);
 
 
  141            return coeff_[1]/(x_[1] - x_[0]);
 
  142        else if (x > x_[numPoints_-1])
 
  143            return coeff_[(numPoints_-1)*4 + 1]/(x_[numPoints_-1] - x_[numPoints_-2]);
 
  146            const auto lookUpIndex = std::distance(x_.begin(), std::lower_bound(x_.begin(), x_.end(), x));
 
  147            assert(lookUpIndex != 0);
 
  150            const auto* coeff = coeff_.data() + (lookUpIndex-1)*4;
 
  153            const auto t = (x - x_[lookUpIndex-1])/(x_[lookUpIndex] - x_[lookUpIndex-1]);
 
  154            const auto dtdx = 1.0/(x_[lookUpIndex] - x_[lookUpIndex-1]);
 
  155            return dtdx*(coeff[1] + t*(2.0*coeff[2] + t*3.0*coeff[3]));