21 #ifndef EVT_PDF_SUM_HH 22 #define EVT_PDF_SUM_HH 56 inline double c(
int i )
const {
return _c[i]; }
66 double pdf(
const T& p )
const override;
75 for (
size_t i = 0; i <
other.nTerms(); i++ ) {
84 for (
size_t i = 0; i < _c.size(); i++ ) {
93 for (
size_t i = 0; i < _c.size(); i++ ) {
94 ret += _c[i] * _term[i]->evaluate( p );
107 for (
size_t i = 0; i < nTerms(); i++ ) {
108 itg += _c[i] * _term[i]->getItg();
117 for (
size_t i = 0; i < nTerms(); i++ )
118 itg += _c[i] * _term[i]->getItg( N );
131 if ( !this->_itg.valueKnown() )
132 this->_itg = compute_integral();
134 double max = this->_itg.value();
139 for ( i = 0; i < nTerms(); i++ ) {
140 double itg = _term[i]->getItg().value();
146 return _term[i]->randomPoint();
EvtPdfSum * clone() const override
vector< EvtPdf< T > * > _term
void addOwnedTerm(double c, std::unique_ptr< EvtPdf< T >> pdf)
EvtValError compute_integral() const override
void addTerm(double c, const EvtPdf< T > &pdf)
EvtPdf< T > * getPdf(int i) const
double pdf(const T &p) const override
Index other(Index i, Index j)