CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
fftjetcms::Polynomial Class Reference

#include <ScaleCalculators.h>

Inheritance diagram for fftjetcms::Polynomial:

Public Member Functions

double operator() (const double &x) const override
 
 Polynomial (const std::vector< double > &coeffs)
 
 ~Polynomial () override
 

Private Member Functions

 Polynomial ()=delete
 

Private Attributes

double * coeffs_
 
const unsigned nCoeffs
 

Detailed Description

Definition at line 210 of file ScaleCalculators.h.

Constructor & Destructor Documentation

fftjetcms::Polynomial::Polynomial ( const std::vector< double > &  coeffs)
inline

Definition at line 213 of file ScaleCalculators.h.

References popcon2dropbox::copy().

214  : coeffs_(nullptr), nCoeffs(coeffs.size())
215  {
216  if (nCoeffs)
217  {
218  coeffs_ = new double[nCoeffs];
219  std::copy(coeffs.begin(), coeffs.end(), coeffs_);
220  }
221  }
fftjetcms::Polynomial::~Polynomial ( )
inlineoverride

Definition at line 222 of file ScaleCalculators.h.

222 {delete [] coeffs_;}
fftjetcms::Polynomial::Polynomial ( )
privatedelete

Member Function Documentation

double fftjetcms::Polynomial::operator() ( const double &  x) const
inlineoverride

Definition at line 224 of file ScaleCalculators.h.

References mps_fire::i, and AlCaHLTBitMon_ParallelJobs::p.

225  {
226  double sum = 0.0;
227  const double* p = coeffs_ + nCoeffs - 1;
228  for (unsigned i=0; i<nCoeffs; ++i)
229  {
230  sum *= x;
231  sum += *p--;
232  }
233  return sum;
234  }

Member Data Documentation

double* fftjetcms::Polynomial::coeffs_
private

Definition at line 238 of file ScaleCalculators.h.

const unsigned fftjetcms::Polynomial::nCoeffs
private

Definition at line 239 of file ScaleCalculators.h.