7 const double x0,
const double x1,
const double y0,
const double y1,
const double x) {
8 return y0 + (
y1 - y0) * ((
x - x0) / (
x1 - x0));
12 : leftExtrapolationLinear_(
false), rightExtrapolationLinear_(
false) {}
18 const std::size_t sz = points.size();
20 std::vector<std::pair<double, double> >
tmp(points);
24 for (std::size_t
i = 0;
i < sz; ++
i) {
30 "In HcalPiecewiseLinearFunctor constructor:" 31 " abscissae must not coincide");
40 const std::size_t szm1 = sz - 1;
68 "In HcalPiecewiseLinearFunctor::inverse:" 69 " can't invert non-monotonous functor");
71 std::vector<std::pair<double, double> > points;
73 for (std::size_t
i = 0;
i < sz; ++
i)
double operator()(double x) const override
bool leftExtrapolationLinear_
std::vector< double > abscissae_
HcalPiecewiseLinearFunctor inverse() const
static bool isStrictlyIncreasing(Iter begin, Iter const end)
void swap(Association< C > &lhs, Association< C > &rhs)
U second(std::pair< T, U > const &p)
HcalPiecewiseLinearFunctor()
static bool isStrictlyDecreasing(Iter begin, Iter const end)
bool rightExtrapolationLinear_
static double interpolateSimple(const double x0, const double x1, const double y0, const double y1, const double x)
bool isStrictlyMonotonous() const
std::vector< double > values_
double xmin() const override
double xmax() const override