1 | // emacs edit mode for this file is -*- C++ -*- |
---|
2 | // $Id: cf_random.h,v 1.0 1996-05-17 10:59:39 stobbe Exp $ |
---|
3 | |
---|
4 | #ifndef INCL_CF_RANDOM_H |
---|
5 | #define INCL_CF_RANDOM_H |
---|
6 | |
---|
7 | /* |
---|
8 | $Log: not supported by cvs2svn $ |
---|
9 | */ |
---|
10 | |
---|
11 | #include "canonicalform.h" |
---|
12 | |
---|
13 | /*BEGINPUBLIC*/ |
---|
14 | |
---|
15 | class CFRandom { |
---|
16 | public: |
---|
17 | virtual ~CFRandom() {} |
---|
18 | virtual CanonicalForm generate() const { return 0; } |
---|
19 | virtual CFRandom * clone() const { return new CFRandom(); } |
---|
20 | }; |
---|
21 | |
---|
22 | class GFRandom : public CFRandom |
---|
23 | { |
---|
24 | public: |
---|
25 | GFRandom() {}; |
---|
26 | ~GFRandom() {} |
---|
27 | CanonicalForm generate() const; |
---|
28 | CFRandom * clone() const; |
---|
29 | }; |
---|
30 | |
---|
31 | class FFRandom : public CFRandom |
---|
32 | { |
---|
33 | public: |
---|
34 | FFRandom() {} |
---|
35 | ~FFRandom() {} |
---|
36 | CanonicalForm generate() const; |
---|
37 | CFRandom * clone() const; |
---|
38 | }; |
---|
39 | |
---|
40 | class IntRandom : public CFRandom |
---|
41 | { |
---|
42 | private: |
---|
43 | int max; |
---|
44 | public: |
---|
45 | IntRandom(); |
---|
46 | IntRandom( int m ); |
---|
47 | ~IntRandom(); |
---|
48 | CanonicalForm generate() const; |
---|
49 | CFRandom * clone() const; |
---|
50 | }; |
---|
51 | |
---|
52 | class AlgExtRandomF : public CFRandom { |
---|
53 | private: |
---|
54 | Variable algext; |
---|
55 | CFRandom * gen; |
---|
56 | int n; |
---|
57 | AlgExtRandomF(); |
---|
58 | AlgExtRandomF( const AlgExtRandomF & ); |
---|
59 | AlgExtRandomF( const Variable & v, CFRandom * g, int nn ); |
---|
60 | AlgExtRandomF& operator= ( const AlgExtRandomF & ); |
---|
61 | public: |
---|
62 | AlgExtRandomF( const Variable & v ); |
---|
63 | AlgExtRandomF( const Variable & v1, const Variable & v2 ); |
---|
64 | ~AlgExtRandomF(); |
---|
65 | CanonicalForm generate() const; |
---|
66 | CFRandom * clone() const; |
---|
67 | }; |
---|
68 | |
---|
69 | class CFRandomFactory { |
---|
70 | public: |
---|
71 | static CFRandom * generate(); |
---|
72 | }; |
---|
73 | |
---|
74 | /*ENDPUBLIC*/ |
---|
75 | |
---|
76 | int factoryrandom( int n ); |
---|
77 | |
---|
78 | void factoryseed( int s ); |
---|
79 | |
---|
80 | |
---|
81 | #endif /* INCL_CF_RANDOM_H */ |
---|