1 #ifndef NPSTAT_LINEARMAPPER1D_HH_ 2 #define NPSTAT_LINEARMAPPER1D_HH_ 30 const double x1,
const double y1)
32 const double dx = x1 - x0;
34 "In npstat::LinearMapper1d constructor: " 35 "invalid arguments (x0 == x1)");
37 b_ = ((y0 + y1) -
a_*(x0 + x1))/2.0;
48 inline double a()
const {
return a_;}
51 inline double b()
const {
return b_;}
57 "In npstat::LinearMapper1d::inverse: " 58 "mapping is not invertible");
74 #endif // NPSTAT_LINEARMAPPER1D_HH_
double operator()(const double &x) const
LinearMapper1d operator*(const LinearMapper1d &r) const
LinearMapper1d inverse() const
Exceptions for the npstat namespace.
LinearMapper1d(const double ca, const double cb)
LinearMapper1d(const double x0, const double y0, const double x1, const double y1)