CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GsfBetheHeitlerUpdator::Polynomial Class Reference

Public Member Functions

float operator() (float x) const
 Evaluation of the polynomial. More...
 
 Polynomial ()
 Default constructor (needed for construction of a vector) More...
 
 Polynomial (float coefficients[], int is)
 

Private Attributes

int m_size =0
 
float theCoeffs [MaxOrder] ={0}
 

Detailed Description

Helper class for construction & evaluation of a polynomial

Definition at line 30 of file GsfBetheHeitlerUpdator.h.

Constructor & Destructor Documentation

GsfBetheHeitlerUpdator::Polynomial::Polynomial ( )
inline

Default constructor (needed for construction of a vector)

Definition at line 33 of file GsfBetheHeitlerUpdator.h.

33 {}
GsfBetheHeitlerUpdator::Polynomial::Polynomial ( float  coefficients[],
int  is 
)
inline

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

Definition at line 37 of file GsfBetheHeitlerUpdator.h.

References mps_fire::i, m_size, and theCoeffs.

37  :
38  m_size(is) {
39  for (int i=0; i!=m_size; ++i)
40  theCoeffs[i]=coefficients[i];
41  }

Member Function Documentation

float GsfBetheHeitlerUpdator::Polynomial::operator() ( float  x) const
inline

Evaluation of the polynomial.

Definition at line 43 of file GsfBetheHeitlerUpdator.h.

References mps_fire::i, m_size, and theCoeffs.

43  {
44  float sum=theCoeffs[0];
45  for (int i=1; i!=m_size; ++i)
46  sum = x*sum + theCoeffs[i];
47  return sum;
48  }

Member Data Documentation

int GsfBetheHeitlerUpdator::Polynomial::m_size =0
private

Definition at line 51 of file GsfBetheHeitlerUpdator.h.

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

float GsfBetheHeitlerUpdator::Polynomial::theCoeffs[MaxOrder] ={0}
private

Definition at line 50 of file GsfBetheHeitlerUpdator.h.

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