CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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

◆ Polynomial() [1/2]

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  }

◆ Polynomial() [2/2]

fftjetcms::Polynomial::Polynomial ( )
delete

◆ ~Polynomial()

fftjetcms::Polynomial::~Polynomial ( )
inlineoverride

Definition at line 213 of file ScaleCalculators.h.

References coeffs_.

213 { delete[] coeffs_; }

Member Function Documentation

◆ operator()()

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

Definition at line 215 of file ScaleCalculators.h.

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

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

◆ coeffs_

double* fftjetcms::Polynomial::coeffs_
private

Definition at line 226 of file ScaleCalculators.h.

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

◆ nCoeffs

const unsigned fftjetcms::Polynomial::nCoeffs
private

Definition at line 227 of file ScaleCalculators.h.

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