1 #ifndef NPSTAT_EXPMAPPER1D_HH_
2 #define NPSTAT_EXPMAPPER1D_HH_
32 const double x1,
const double y1)
34 if (!(y0 > 0.0 && y1 > 0.0))
throw std::invalid_argument(
35 "In npstat::ExpMapper1d constructor: "
36 "both ordinates must be positive");
37 const double lny1 = log(y1);
38 const double lny0 = log(y0);
39 const double dx = x1 - x0;
40 if (!dx)
throw std::invalid_argument(
41 "In npstat::ExpMapper1d constructor: "
42 "invalid arguments (x0 == x1)");
43 a_ = (lny1 - lny0)/dx;
44 b_ = ((lny0 + lny1) - a_*(x0 + x1))/2.0;
48 inline ExpMapper1d(
const double ca,
const double cb) : a_(ca), b_(cb) {}
51 inline double operator()(
const double& x)
const {
return exp(a_*x+b_);}
54 inline double a()
const {
return a_;}
57 inline double b()
const {
return b_;}
Definition: ExpMapper1d.hh:20
ExpMapper1d()
Definition: ExpMapper1d.hh:23
double a() const
Definition: ExpMapper1d.hh:54
ExpMapper1d(const double ca, const double cb)
Definition: ExpMapper1d.hh:48
ExpMapper1d(const double x0, const double y0, const double x1, const double y1)
Definition: ExpMapper1d.hh:31
double b() const
Definition: ExpMapper1d.hh:57
double operator()(const double &x) const
Definition: ExpMapper1d.hh:51
Definition: AbsArrayProjector.hh:14