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