CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GsfBetheHeitlerUpdator::Polynomial Class Reference

Public Member Functions

double operator() (const double &x) const
 Evaluation of the polynomial. More...
 
 Polynomial ()
 Default constructor (needed for construction of a vector) More...
 
 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.

27 {}
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.

31  :
32  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.

34  {
35  double sum(0.);
36  for ( std::vector<double>::const_iterator i=theCoeffs.begin();
37  i!=theCoeffs.end(); i++ ) sum = x*sum + *i;
38  return sum;
39  }
int i
Definition: DBlmapReader.cc:9
x
Definition: VDTMath.h:216

Member Data Documentation

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

Definition at line 41 of file GsfBetheHeitlerUpdator.h.

Referenced by operator()().