ACDCGenerator::ACDCGenCell Class Reference

ACDCGenCell is the class representing a generation cell in ACDCGen. More...

#include <ACDCGenCell.h>

List of all members.

Public Member Functions

 ACDCGenCell (double newG)
 Constructor taking the maximum value as argument.
 ACDCGenCell (double newG, double newV)
 Constructor taking the maximum value and the volume as argument.
 ~ACDCGenCell ()
 The destuctor will also delete all child cells.
template<typename RndType>
ACDCGenCellgenerate (DVector &lo, DVector &up, RndType *rnd)
 Choose a cell recursively according to their relative overestimated integrals.
ACDCGenCellgenerate (DVector &lo, DVector &up, DVector &rndv)
 Choose a cell recursively according to their relative overestimated integrals.
ACDCGenCellgetCell (DVector &lo, const DVector &x, DVector &up)
 Find a cell.
void smooth (double frac)
 Smooth out the levels.
bool isSplit () const
 Returns true if this cell has been split.
double doMaxInt (double rescale=1.0)
 Recalculate (recursively) the overestimated integral for this cell (and of the sub-cells) and return it.
double maxInt () const
 Return the last calculated the overestimated integral for this cell.
void splitme (double lo, double newDiv, double up, DimType newDim)
 Split this cell into two.
void g (double newG)
 Set a new overestimated maximum function value in this cell.
double g () const
 Return the overestimated maximum function value in this cell.
double v () const
 Return the volume of this cell.
DimType dim () const
 Return the direction in which it has been split.
double div () const
 Return the point of division in the dim() direction.
ACDCGenCellupper () const
 Return the upper sub-cell.
ACDCGenCelllower () const
 Return the lower sub-cell.
int nBins () const
 Return the number of cells in this sub-tree which have not been split.
int depth () const
 Return the maximum depth of this sub-tree.
void extract (DVector &lo, DVector &up, vector< ACDCGenCellInfo > &v) const
 Append ACDCGenCellInfo objects describing this subtree to a given vector.
long getIndex (const ACDCGenCell *c) const
 Get the index of the given cell.
long getIndex (const ACDCGenCell *c, long &indx) const
 Helper function for getIndex(const ACDCGenCell *) with an extra argument to use as counter.
ACDCGenCellgetCell (long i)
 Return the cell corresponding to the given index i.
ACDCGenCellgetCell (long i, long &indx)
 Helper function for getCell(long) with an extra argument to use as counter.

Public Attributes

double theG
 If the cell has not been split this is the overestimated maximum function value in this cell.
double theV
 The volume of this cell.
ACDCGenCelltheUpper
 Pointers to the upper sub-cell.
ACDCGenCelltheLower
 Pointers to the lower sub-cell.
double theDivision
 The point of division in the dim() direction.
DimType theSplitDimension
 The direction in which it has been split.

Private Member Functions

 ACDCGenCell ()
 Default constructor is private and not implemented.
 ACDCGenCell (const ACDCGenCell &)
 Copy constructor is private and not implemented.
ACDCGenCelloperator= (const ACDCGenCell &)
 Assignment is private and not implemented.


Detailed Description

ACDCGenCell is the class representing a generation cell in ACDCGen.

Definition at line 20 of file ACDCGenCell.h.


Member Function Documentation

template<typename RndType>
ACDCGenCell* ACDCGenerator::ACDCGenCell::generate ( DVector lo,
DVector up,
RndType *  rnd 
) [inline]

Choose a cell recursively according to their relative overestimated integrals.

Parameters:
lo the lower-left corner of the chosen cell.
up the upper-right corner of the chosen cell.
rnd the random generator object used to throw dice to choose sub-cell.
Returns:
a pointer to the chosen cell.

ACDCGenCell* ACDCGenerator::ACDCGenCell::generate ( DVector lo,
DVector up,
DVector rndv 
) [inline]

Choose a cell recursively according to their relative overestimated integrals.

Parameters:
lo the lower-left corner of the chosen cell.
up the upper-right corner of the chosen cell.
rndv a pre-generated set of random numbers (one for each dimension) used to choose sub-cell and then rescales that random number to be reused by the sub-cell.
Returns:
a pointer to the chosen cell.

ACDCGenCell* ACDCGenerator::ACDCGenCell::getCell ( DVector lo,
const DVector x,
DVector up 
) [inline]

Find a cell.

For a given phase space point, x, find the corresponding cell. Afterwards, the up and lo vectors will contain the upper-right and lower-left corners of the chosen cell.

void ACDCGenerator::ACDCGenCell::smooth ( double  frac  )  [inline]

Smooth out the levels.

If one cell has an overestimated integral which is less than frac of the adjacent one, rescale it to avoid situations where it is never sampled.

double ACDCGenerator::ACDCGenCell::doMaxInt ( double  rescale = 1.0  )  [inline]

Recalculate (recursively) the overestimated integral for this cell (and of the sub-cells) and return it.

Optionally rescale the overestimated integral.

void ACDCGenerator::ACDCGenCell::splitme ( double  lo,
double  newDiv,
double  up,
DimType  newDim 
) [inline]

Split this cell into two.

The cell is split along the newDim direction, where the lower and upper limit is given by lo and up and the point of division is given by newDiv.

DimType ACDCGenerator::ACDCGenCell::dim (  )  const [inline]

Return the direction in which it has been split.

Return -1 if it has not been split.

double ACDCGenerator::ACDCGenCell::div (  )  const [inline]

Return the point of division in the dim() direction.

Return -1.0 if it has not been split.

ACDCGenCell* ACDCGenerator::ACDCGenCell::upper (  )  const [inline]

Return the upper sub-cell.

Return null if it has not been split.

ACDCGenCell* ACDCGenerator::ACDCGenCell::lower (  )  const [inline]

Return the lower sub-cell.

Return null if it has not been split.

void ACDCGenerator::ACDCGenCell::extract ( DVector lo,
DVector up,
vector< ACDCGenCellInfo > &  v 
) const [inline]

Append ACDCGenCellInfo objects describing this subtree to a given vector.

Parameters:
lo the lower-left corner of this cell.
up the upper-right corner of this cell.
v the vector where the ACDCGenCellInfo objects will be appended.


Member Data Documentation

If the cell has not been split this is the overestimated maximum function value in this cell.

Otherwise it is the weighted average of the sub-cells values.

Definition at line 190 of file ACDCGenCell.h.


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

Generated on Thu Apr 29 12:42:55 2010 for ThePEG by  doxygen 1.5.5