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 27 of file GsfBetheHeitlerUpdator.h.

Constructor & Destructor Documentation

◆ Polynomial() [1/2]

GsfBetheHeitlerUpdator::Polynomial::Polynomial ( )
inline

Default constructor (needed for construction of a vector)

Definition at line 30 of file GsfBetheHeitlerUpdator.h.

30 {}

◆ Polynomial() [2/2]

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

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

Definition at line 34 of file GsfBetheHeitlerUpdator.h.

References mps_fire::i, m_size, and theCoeffs.

34  : m_size(is) {
35  for (int i = 0; i != m_size; ++i)
36  theCoeffs[i] = coefficients[i];
37  }

Member Function Documentation

◆ operator()()

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

Evaluation of the polynomial.

Definition at line 39 of file GsfBetheHeitlerUpdator.h.

References mps_fire::i, m_size, theCoeffs, and x.

39  {
40  float sum = theCoeffs[0];
41  for (int i = 1; i != m_size; ++i)
42  sum = x * sum + theCoeffs[i];
43  return sum;
44  }

Member Data Documentation

◆ m_size

int GsfBetheHeitlerUpdator::Polynomial::m_size = 0
private

Definition at line 48 of file GsfBetheHeitlerUpdator.h.

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

◆ theCoeffs

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

Definition at line 47 of file GsfBetheHeitlerUpdator.h.

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