Integrator Class Reference

#include <Integrator.h>

List of all members.

Public Member Functions

double Simpson (const double *f, const int n, const double dx) const

Static Public Member Functions

static IntegratorInstance (void)

Private Member Functions

 Integrator ()
 Integrator (const Integrator &intg)
virtual ~Integrator ()

Static Private Attributes

static IntegratorfInstance = 0

Detailed Description

________________________________________________________________________________________

Id
Integrator.cxx,v 1.1.1.1 2003/12/24 15:23:46 costas Exp

________________________________________________________________________________________

Id
Integrator.h,v 1.1.1.1 2003/12/24 15:23:46 costas Exp

Definition at line 20 of file Integrator.h.


Constructor & Destructor Documentation

Integrator::Integrator (  )  [private]

Definition at line 28 of file Integrator.cxx.

References fInstance.

00029 {
00030   fInstance = 0;
00031 }

Integrator::Integrator ( const Integrator intg  )  [private]

Definition at line 33 of file Integrator.cxx.

00033                                               :
00034 TObject(intg)
00035 {
00036 
00037 }
//____________________________________________________________________________

Integrator::~Integrator (  )  [private, virtual]

Definition at line 39 of file Integrator.cxx.

References fInstance.

00040 {
00041   fInstance = 0;
00042 }


Member Function Documentation

Integrator * Integrator::Instance ( void   )  [static]

Definition at line 20 of file Integrator.cxx.

Referenced by PetrukhinShestakovModel::bbrem(), BezrukovBugaevModel::bnuc(), and KokoulinPetrukhinModel::bpair().

00021 {
00022   if(fInstance == 0) fInstance = new Integrator();
00023   return fInstance;
00024 }

double Integrator::Simpson ( const double *  f,
const int  n,
const double  dx 
) const

Definition at line 44 of file Integrator.cxx.

Referenced by PetrukhinShestakovModel::bbrem(), BezrukovBugaevModel::bnuc(), and KokoulinPetrukhinModel::bpair().

00045 {
00046 //-- apply Simpson rule for integration
00047 
00048   double integral = (f[0] + f[n-1]) / 2.;
00049 
00050   for(int i = 0; i < n-1; i++)  integral += ( f[i] * (i%2 + 1) );
00051 
00052   integral *= (2.*dx/3.);
00053 
00054   return integral;
00055 }


Member Data Documentation

Integrator * Integrator::fInstance = 0 [static, private]

Definition at line 34 of file Integrator.h.

Referenced by Integrator(), and ~Integrator().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1