CMS 3D CMS Logo

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 ()=delete
 
 Polynomial (const std::vector< double > &coeffs)
 
 ~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.

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() [2/2]

fftjetcms::Polynomial::Polynomial ( )
delete

◆ ~Polynomial()

fftjetcms::Polynomial::~Polynomial ( )
inlineoverride

Definition at line 213 of file ScaleCalculators.h.

213 { delete[] coeffs_; }

References coeffs_.

Member Function Documentation

◆ operator()()

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

Definition at line 215 of file ScaleCalculators.h.

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  }

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:428
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
DDAxes::x
fftjetcms::Polynomial::nCoeffs
const unsigned nCoeffs
Definition: ScaleCalculators.h:227
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
fftjetcms::Polynomial::coeffs_
double * coeffs_
Definition: ScaleCalculators.h:226