84 static const double recip = 1.0/(
double)(1U <<
NBits);
87 for(dim=0; dim < dimension; dim++) {
88 vector[dim] =
_nextq[dim] * recip;
104 oocoutE(
nullptr,Integration) <<
"RooQuasiRandomGenerator::generate: internal error!" << endl;
109 for(dim=0; dim<dimension; dim++) {
128 for(i_dim=0; i_dim<dimension; i_dim++) {
130 const int poly_index = i_dim + 1;
152 for(k=0; k<=px_degree; k++) {
158 for(j=0; j<
NBits; j++) {
177 if(u == px_degree) u = 0;
186 for(j=0; j<
NBits; j++) {
187 term = 2*term + ci[
r][j];
189 _cj[
r][i_dim] = term;
200 int pb[],
int * pb_degree,
int v[],
int maxv)
202 const int nonzero_element = 1;
203 const int arbitrary_element = 1;
211 int bigm = *pb_degree;
223 polyMultiply(px, px_degree, pb, *pb_degree, pb, pb_degree);
242 for(
r=0;
r<kj;
r++) {
249 for(
r=kj+1;
r<
m;
r++) {
250 v[
r] = arbitrary_element;
256 int term =
sub(0, ph[kj]);
258 for(
r=kj+1;
r<bigm;
r++) {
259 v[
r] = arbitrary_element;
268 v[bigm] =
add(nonzero_element, term);
270 for(
r=bigm+1;
r<
m;
r++) {
271 v[
r] = arbitrary_element;
278 for(
r=0;
r<=maxv-
m;
r++) {
281 term =
sub(term,
mul(pb[k],
v[
r+k]));
292 int pb_degree,
int pc[],
int * pc_degree)
296 int pt_degree = pa_degree + pb_degree;
298 for(k=0; k<=pt_degree; k++) {
300 for(j=0; j<=k; j++) {
301 const int conv_term =
mul(pa[k-j], pb[j]);
302 term =
add(term, conv_term);
307 for(k=0; k<=pt_degree; k++) {
314 *pc_degree = pt_degree;
333 { 1, 0, 0, 0, 0, 0 },
334 { 0, 1, 0, 0, 0, 0 },
335 { 1, 1, 0, 0, 0, 0 },
336 { 1, 1, 1, 0, 0, 0 },
337 { 1, 1, 0, 1, 0, 0 },
338 { 1, 0, 1, 1, 0, 0 },
339 { 1, 1, 0, 0, 1, 0 },
340 { 1, 0, 0, 1, 1, 0 },
341 { 1, 1, 1, 1, 1, 0 },
342 { 1, 0, 1, 0, 0, 1 },
343 { 1, 0, 0, 1, 0, 1 },
344 { 1, 1, 1, 1, 0, 1 },
354 0, 1, 1, 2, 3, 3, 4, 4, 4, 5, 5, 5, 5
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
This class generates the quasi-random (aka "low discrepancy") sequence for dimensions up to 12 using ...
void polyMultiply(const int pa[], int pa_degree, const int pb[], int pb_degree, int pc[], int *pc_degree)
Internal function.
RooQuasiRandomGenerator()
Perform one-time initialization of our static coefficient array if necessary and initialize our works...
void calculateV(const int px[], int px_degree, int pb[], int *pb_degree, int v[], int maxv)
Internal function.
Int_t mul(Int_t x, Int_t y) const
void reset()
Reset the workspace to its initial state.
void calculateCoefs(UInt_t dimension)
Calculate the coefficients for the given number of dimensions.
static Int_t _cj[NBits][MaxDimension]
virtual ~RooQuasiRandomGenerator()
Destructor.
static bool _coefsCalculated
static const Int_t _polyDegree[MaxDimension+1]
static const Int_t _primitivePoly[MaxDimension+1][MaxPrimitiveDegree+1]
bool generate(UInt_t dimension, double vector[])
Generate the next number in the sequence for the specified dimension.
Int_t add(Int_t x, Int_t y) const
Int_t sub(Int_t x, Int_t y) const