9 const std::size_t sz = points.size();
11 std::vector<Triple>
tmp(points);
12 std::sort(tmp.begin(), tmp.end());
16 for (std::size_t
i = 0;
i < sz; ++
i) {
19 values_.push_back(std::get<1>(t));
22 const std::size_t szm1 = sz - 1;
23 for (std::size_t
i = 0;
i < szm1; ++
i)
26 "In HcalCubicInterpolator constructor:"
27 " abscissae must not coincide");
36 const std::size_t szm1 = sz - 1;
43 const std::size_t cellp1 = cell + 1;
45 const double t = (x - abscissae_[cell]) / dx;
46 const double onemt = 1.0 -
t;
47 const double h00 = onemt * onemt * (1.0 + 2.0 *
t);
48 const double h10 = onemt * onemt *
t;
49 const double h01 = t * t * (3.0 - 2.0 *
t);
50 const double h11 = t * t * onemt;
75 const bool monotonous =
79 "In HcalCubicInterpolator::inverse:"
80 " can't invert non-monotonous functor");
82 std::vector<Triple> points;
84 for (std::size_t
i = 0;
i < sz; ++
i) {
88 "In HcalCubicInterpolator::inverse:"
89 " can't invert functor with derivatives of 0");
std::tuple< double, double, double > Triple
double xmax() const override
std::vector< double > abscissae_
__host__ __device__ constexpr RandomIt upper_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
static bool isStrictlyIncreasing(Iter begin, Iter const end)
double xmin() const override
static bool isStrictlyDecreasing(Iter begin, Iter const end)
HcalCubicInterpolator approximateInverse() const
std::vector< double > values_
double operator()(double x) const override
std::vector< double > derivatives_