ROOT  6.06/09
Reference Guide
UnuranRng.h
Go to the documentation of this file.
1 // @(#)root/unuran:$Id$
2 // Author: L. Moneta Wed Sep 27 11:22:34 2006
3 
4 /**********************************************************************
5  * *
6  * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT *
7  * *
8  * *
9  **********************************************************************/
10 
11 // Header file for class UnuranRng
12 
13 #ifndef ROOT_UnuranRng
14 #define ROOT_UnuranRng
15 
16 
17 /**
18  UnuranRng class for interface ROOT random generators to Unuran
19 */
20 
21 template<class Random>
22 struct UnuranRng {
23 
24 public:
25 
26  /// function to delete object (not needed)
27  static void Delete(void * /* p */ ) {
28 // Random * r = reinterpret_cast<Random *> (p);
29 // delete r;
30  }
31 
32  /// function to set the seed in the random
33  static void Seed(void * p, unsigned long seed) {
34  Random * r = reinterpret_cast<Random *> (p);
35  r->SetSeed(seed);
36  }
37 
38  /// function to sample random generator
39  static double Rndm(void * p) {
40  Random * r = reinterpret_cast<Random *> (p);
41  return r->Rndm();
42  }
43 
44 
45 };
46 
47 
48 
49 #endif /* ROOT_UnuranRng */
static void Seed(void *p, unsigned long seed)
function to set the seed in the random
Definition: UnuranRng.h:33
UnuranRng class for interface ROOT random generators to Unuran.
Definition: UnuranRng.h:22
static double Rndm(void *p)
function to sample random generator
Definition: UnuranRng.h:39
static void Delete(void *)
function to delete object (not needed)
Definition: UnuranRng.h:27
ROOT::R::TRInterface & r
Definition: Object.C:4
void Random()
Definition: utils.cpp:154