CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public 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 ()=delete
 
 ~Polynomial () override
 

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 coeffs_, filterCSVwithJSON::copy, and nCoeffs.

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 ( )
delete
fftjetcms::Polynomial::~Polynomial ( )
inlineoverride

Definition at line 213 of file ScaleCalculators.h.

References coeffs_.

213 { delete[] coeffs_; }

Member Function Documentation

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

Definition at line 215 of file ScaleCalculators.h.

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

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

Member Data Documentation

double* fftjetcms::Polynomial::coeffs_
private

Definition at line 226 of file ScaleCalculators.h.

Referenced by operator()(), Polynomial(), and ~Polynomial().

const unsigned fftjetcms::Polynomial::nCoeffs
private

Definition at line 227 of file ScaleCalculators.h.

Referenced by operator()(), and Polynomial().