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

Constructor & Destructor Documentation

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

Definition at line 206 of file ScaleCalculators.h.

References filterCSVwithJSON::copy.

206  : coeffs_(nullptr), nCoeffs(coeffs.size()) {
207  if (nCoeffs) {
208  coeffs_ = new double[nCoeffs];
209  std::copy(coeffs.begin(), coeffs.end(), coeffs_);
210  }
211  }
fftjetcms::Polynomial::~Polynomial ( )
inlineoverride

Definition at line 212 of file ScaleCalculators.h.

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

Member Function Documentation

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

Definition at line 214 of file ScaleCalculators.h.

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

214  {
215  double sum = 0.0;
216  const double* p = coeffs_ + nCoeffs - 1;
217  for (unsigned i = 0; i < nCoeffs; ++i) {
218  sum *= x;
219  sum += *p--;
220  }
221  return sum;
222  }

Member Data Documentation

double* fftjetcms::Polynomial::coeffs_
private

Definition at line 226 of file ScaleCalculators.h.

const unsigned fftjetcms::Polynomial::nCoeffs
private

Definition at line 227 of file ScaleCalculators.h.