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