CMS 3D CMS Logo

Public Member Functions | Private Attributes

GsfBetheHeitlerUpdator::Polynomial Class Reference

List of all members.

Public Member Functions

double operator() (const double &x) const
 Evaluation of the polynomial.
 Polynomial ()
 Default constructor (needed for construction of a vector)
 Polynomial (const std::vector< double > &coefficients)

Private Attributes

std::vector< double > theCoeffs

Detailed Description

Helper class for construction & evaluation of a polynomial

Definition at line 24 of file GsfBetheHeitlerUpdator.h.


Constructor & Destructor Documentation

GsfBetheHeitlerUpdator::Polynomial::Polynomial ( ) [inline]

Default constructor (needed for construction of a vector)

Definition at line 27 of file GsfBetheHeitlerUpdator.h.

{}
GsfBetheHeitlerUpdator::Polynomial::Polynomial ( const std::vector< double > &  coefficients) [inline]

Constructor from a vector of coefficients (in decreasing order of powers of x)

Definition at line 31 of file GsfBetheHeitlerUpdator.h.

                                                       :
      theCoeffs(coefficients) {}

Member Function Documentation

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

Evaluation of the polynomial.

Definition at line 34 of file GsfBetheHeitlerUpdator.h.

References i, and theCoeffs.

                                              {
      double sum(0.);
      for ( std::vector<double>::const_iterator i=theCoeffs.begin();
            i!=theCoeffs.end(); i++ )  sum = x*sum + *i;
      return sum;
    }

Member Data Documentation

std::vector<double> GsfBetheHeitlerUpdator::Polynomial::theCoeffs [private]

Definition at line 41 of file GsfBetheHeitlerUpdator.h.

Referenced by operator()().