40static inline double fast_fma(
41 const double x,
const double y,
const double z)
noexcept
43#if defined(FP_FAST_FMA)
44 return std::fma(
x,
y, z);
48#pragma STDC FP_CONTRACT ON
55enum class Kind :
int { First = 1, Second = 2 };
62template <
typename T, Kind KIND>
63class ChebychevIterator {
71 constexpr ChebychevIterator() =
default;
73 ChebychevIterator(
const ChebychevIterator &) =
default;
75 ChebychevIterator(ChebychevIterator &&) =
default;
77 constexpr ChebychevIterator(
const T &
x)
78 : _curr(static_cast<
int>(KIND) *
x), _twox(2 *
x)
82 ChebychevIterator &
operator=(
const ChebychevIterator &) =
default;
84 ChebychevIterator &
operator=(ChebychevIterator &&) =
default;
87 constexpr inline T operator*() const noexcept {
return _last; }
89 constexpr inline T lookahead() const noexcept {
return _curr; }
91 inline ChebychevIterator &operator++() noexcept
94 T newval = _twox*_curr -_last;
100 inline ChebychevIterator operator++(
int)
noexcept
102 ChebychevIterator retVal(*
this);
121 _x(
"x",
"Dependent", this,
x),
122 _coefList(
"coefficients",
"List of coefficients",this),
125 for (
const auto coef : coefList) {
127 coutE(InputArguments) <<
"RooChebychev::ctor(" <<
GetName() <<
128 ") ERROR: coefficient " << coef->
GetName() <<
129 " is not of type RooAbsReal" << std::endl ;
130 throw std::invalid_argument(
"Wrong input arguments for RooChebychev");
140 _x(
"x", this, other._x),
141 _coefList(
"coefList",this,other._coefList),
142 _refRangeName(other._refRangeName)
170 using size_type =
typename RooListProxy::Storage_t::size_type;
174 ChebychevIterator<double, Kind::First> chit(
x);
176 for (size_type i = 0; iend != i; ++i, ++chit) {
190 size_t batchSize = xData.
size();
196 std::vector<double> coef(nCoef);
197 for (
size_t i=0; i<nCoef; i++) {
217 assert(1 == code); (
void)code;
240 using size_type =
typename RooListProxy::Storage_t::size_type;
249 ChebychevIterator<double, Kind::First> bit(
b), ait(
a);
252 for (size_type i = 1; iend != i; ++i) {
255 const double term2 = (*bit - *ait) / nminus1;
256 ++bit, ++ait, ++nminus1;
257 const double term1 = (bit.lookahead() - ait.lookahead()) / (nminus1 + 1.);
258 const double intTn = 0.5 * (term1 - term2);
Binding & operator=(OUT(*fun)(void))
typedef void((*Func_t)())
TTime operator*(const TTime &t1, const TTime &t2)
Storage_t::size_type size() const
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
virtual RooSpan< const double > getValues(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet=nullptr) const
by this change, please consult the release notes for ROOT 6.24 for guidance on how to make this trans...
Bool_t matchArgs(const RooArgSet &allDeps, RooArgSet &numDeps, const RooArgProxy &a) const
Utility function for use in getAnalyticalIntegral().
Double_t getVal(const RooArgSet *normalisationSet=nullptr) const
Evaluate object.
RooArgList is a container object that can hold multiple RooAbsArg objects.
RooArgSet is a container object that can hold multiple RooAbsArg objects.
virtual void computeChebychev(size_t batchSize, double *__restrict output, const double *__restrict const xData, double xmin, double xmax, std::vector< double > coef)=0
Chebychev polynomial p.d.f.
RooSpan< double > evaluateSpan(RooBatchCompute::RunContext &evalData, const RooArgSet *normSet) const
Compute multiple values of Chebychev.
virtual void selectNormalizationRange(const char *rangeName=0, Bool_t force=kFALSE)
Interface function to force use of a given normalization range to interpret function value.
Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
Interface function getAnalyticalIntergral advertises the analytical integrals that are supported.
Double_t evaluate() const
Evaluate this PDF / function / constant. Needs to be overridden by all derived classes.
Double_t evalAnaInt(const Double_t a, const Double_t b) const
Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const
Implements the actual analytical integral(s) advertised by getAnalyticalIntegral.
virtual Bool_t add(const RooAbsArg &var, Bool_t silent=kFALSE) override
Reimplementation of standard RooArgList::add()
const TNamed * constPtr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
static RooNameReg & instance()
Return reference to singleton instance.
A simple container to hold a batch of data values.
constexpr std::span< T >::pointer data() const
constexpr std::span< T >::index_type size() const noexcept
double min(const char *rname=0) const
Query lower limit of range. This requires the payload to be RooAbsRealLValue or derived.
double max(const char *rname=0) const
Query upper limit of range. This requires the payload to be RooAbsRealLValue or derived.
The TNamed class is the base class for all named ROOT classes.
virtual const char * GetName() const
Returns name of object.
R__EXTERN RooBatchComputeInterface * dispatch
This dispatch pointer points to an implementation of the compute library, provided one has been loade...
This struct enables passing computation data around between elements of a computation graph.
RooSpan< double > makeBatch(const RooAbsReal *owner, std::size_t size)
Create a writable batch.
static uint64_t sum(uint64_t i)
static void output(int code)