1 #ifndef NPSTAT_ABSDISTRIBUTIONTRANSFORM1D_HH_
2 #define NPSTAT_ABSDISTRIBUTIONTRANSFORM1D_HH_
20 #include "geners/ClassId.hh"
39 inline unsigned nParameters()
const {
return npara_;}
41 inline void setParameter(
const unsigned which,
const double value)
43 if (which >= npara_)
throw std::invalid_argument(
44 "In npstat::AbsDistributionTransform1D::setParameter: "
45 "parameter number out of range");
46 this->setParameterChecked(which, value);
49 inline void setAllParameters(
const double* p,
const unsigned len)
51 if (len != npara_)
throw std::invalid_argument(
52 "In npstat::AbsDistributionTransform1D::setAllParameters: "
53 "wrong number of parameters");
56 this->setAllParametersChecked(p);
59 inline double getParameter(
const unsigned which)
const
61 if (which >= npara_)
throw std::invalid_argument(
62 "In npstat::AbsDistributionTransform1D::getParameter: "
63 "parameter number out of range");
64 return this->getParameterChecked(which);
70 virtual double transformBack(
double y)
const = 0;
81 return (
typeid(*
this) ==
typeid(r)) &&
82 npara_ == r.npara_ && this->
isEqual(r);
87 {
return !(*
this == r);}
92 virtual bool write(std::ostream&)
const {
return false;}
95 static inline const char* classname()
96 {
return "npstat::AbsDistributionTransform1D";}
97 static inline unsigned version() {
return 1;}
98 static AbsDistributionTransform1D* read(
99 const gs::ClassId&
id, std::istream& is);
106 virtual void setParameterChecked(
unsigned which,
double value) = 0;
107 virtual void setAllParametersChecked(
const double* p) = 0;
108 virtual double getParameterChecked(
unsigned which)
const = 0;
114 inline double transformForward2(
const double x)
const
120 inline std::pair<double,double> transformWithDerivative(
const double x)
const
124 return std::pair<double,double>(y, dydx);
138 inline virtual double operator()(
const double& x)
const
154 inline virtual double operator()(
const double& x)
const
155 {
return transform_.transformBack(x);}
167 const bool isForward)
168 : transform_(t), fcn_(fcn), isForward_(isForward) {}
172 inline virtual double operator()(
const double& x)
const
178 y = transform_.transformBack(x);
Interface definitions and concrete simple functors for a variety of functor-based calculations.
Definition: AbsArrayProjector.hh:14
Definition: SimpleFunctors.hh:58