Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Integrator Class Reference

simple numerical integration singleton class to minimize external dependencies More...

#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

IntegratorInstance (void)

Private Member Functions

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

Static Private Attributes

IntegratorfInstance = 0


Detailed Description

simple numerical integration singleton class to minimize external dependencies

________________________________________________________________________________________

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

MuELoss

Costas Andreopoulos <C.V.Andreopoulos@rl.ac.uk> CCLRC, Rutherford Lab. December 10, 2003 _________________________________________________________________________________________

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 26 of file Integrator.cxx.

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


The documentation for this class was generated from the following files:
Generated on Mon Feb 15 11:09:20 2010 for loon by  doxygen 1.3.9.1