CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

fftjetcms::Polynomial Class Reference

#include <ScaleCalculators.h>

List of all members.

Public Member Functions

double operator() (const double &x) const
 Polynomial (const std::vector< double > &coeffs)
 ~Polynomial ()

Private Member Functions

 Polynomial ()

Private Attributes

double * coeffs_
const unsigned nCoeffs

Detailed Description

Definition at line 210 of file ScaleCalculators.h.


Constructor & Destructor Documentation

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

Definition at line 213 of file ScaleCalculators.h.

References coeffs_, filterCSVwithJSON::copy, and nCoeffs.

            : coeffs_(0), nCoeffs(coeffs.size())
        {
            if (nCoeffs)
            {
                coeffs_ = new double[nCoeffs];
                std::copy(coeffs.begin(), coeffs.end(), coeffs_);
            }
        }
fftjetcms::Polynomial::~Polynomial ( ) [inline]

Definition at line 222 of file ScaleCalculators.h.

References coeffs_.

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

Member Function Documentation

double fftjetcms::Polynomial::operator() ( const double &  x) const [inline]

Definition at line 224 of file ScaleCalculators.h.

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

        {
            double sum = 0.0;
            const double* p = coeffs_ + nCoeffs - 1;
            for (unsigned i=0; i<nCoeffs; ++i)
            {
                sum *= x;
                sum += *p--;
            }
            return sum;
        }

Member Data Documentation

double* fftjetcms::Polynomial::coeffs_ [private]

Definition at line 238 of file ScaleCalculators.h.

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

const unsigned fftjetcms::Polynomial::nCoeffs [private]

Definition at line 239 of file ScaleCalculators.h.

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