Main Page | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals

SymGen Class Reference

#include <newran.h>

Inheritance diagram for SymGen:

Inheritance graph
[legend]
Collaboration diagram for SymGen:

Collaboration graph
[legend]

Public Member Functions

char * Name ()
Real Next ()

Private Member Functions

void operator= (const SymGen &)

Member Function Documentation

char * SymGen::Name  )  [virtual]
 

Reimplemented from PosGen.

Reimplemented in Normal, Cauchy, and SymGenX.

Definition at line 906 of file newran.cpp.

00906 { return "SymGen";           }

Real SymGen::Next  )  [virtual]
 

Reimplemented from PosGen.

Reimplemented in ChiSq1.

Definition at line 244 of file newran.cpp.

References PosGen::Build(), Random::Density(), Random::Next(), PosGen::NotReady, Real, PosGen::sfx, PosGen::sx, and PosGen::xi.

Referenced by ChiSq1::Next(), and test1().

00245 {
00246    Real s,ak,y; int ir;
00247    if (NotReady) Build(true);
00248    do
00249    {
00250       s=1.0;
00251       Real r1=Random::Next();
00252       if (r1>0.5) { s=-1.0; r1=1.0-r1; }
00253       ir = (int)(r1*xi); Real sxi=sx[ir];
00254       ak=sxi+(sx[ir+1]-sxi)*Random::Next();
00255       y=sfx[ir]*Random::Next();
00256    }
00257    while ( y>=sfx[ir+1] && y>=Density(ak) );
00258    return s*ak;
00259 }

void SymGen::operator= const SymGen  )  [inline, private]
 

Definition at line 117 of file newran.h.

00117 {}       // private so can't access


The documentation for this class was generated from the following files:
Generated on Fri Dec 5 04:06:39 2003 for Borqueror by doxygen 1.3.3