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

◆ Polynomial() [1/2]

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

Definition at line 206 of file ScaleCalculators.h.

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

References coeffs_, filterCSVwithJSON::copy, and nCoeffs.

◆ ~Polynomial()

fftjetcms::Polynomial::~Polynomial ( )
inlineoverride

Definition at line 212 of file ScaleCalculators.h.

212 { delete[] coeffs_; }

References coeffs_.

◆ Polynomial() [2/2]

fftjetcms::Polynomial::Polynomial ( )
privatedelete

Member Function Documentation

◆ operator()()

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

Definition at line 214 of file ScaleCalculators.h.

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  }

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

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().

mps_fire.i
i
Definition: mps_fire.py:355
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
DDAxes::x
fftjetcms::Polynomial::nCoeffs
const unsigned nCoeffs
Definition: ScaleCalculators.h:227
fftjetcms::Polynomial::coeffs_
double * coeffs_
Definition: ScaleCalculators.h:226