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 212 of file ScaleCalculators.h.

Constructor & Destructor Documentation

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

Definition at line 215 of file ScaleCalculators.h.

References popcon2dropbox::copy().

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

Definition at line 224 of file ScaleCalculators.h.

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

Member Function Documentation

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

Definition at line 226 of file ScaleCalculators.h.

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

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

Member Data Documentation

double* fftjetcms::Polynomial::coeffs_
private

Definition at line 240 of file ScaleCalculators.h.

const unsigned fftjetcms::Polynomial::nCoeffs
private

Definition at line 241 of file ScaleCalculators.h.