jengelh-datetimespielwiese
Last change
on this file since e4fe2b was
e4fe2b,
checked in by Oleksandr Motsak <motsak@…>, 12 years ago
|
FIX: Fixed huge BUG in cf_gmp.h
CHG: starting to cleanup factory
|
-
Property mode set to
100644
|
File size:
1.5 KB
|
Rev | Line | |
---|
[493c477] | 1 | /* emacs edit mode for this file is -*- C++ -*- */ |
---|
[341696] | 2 | /* $Id$ */ |
---|
[2dd068] | 3 | |
---|
| 4 | #ifndef INCL_CF_RANDOM_H |
---|
| 5 | #define INCL_CF_RANDOM_H |
---|
| 6 | |
---|
[e4fe2b] | 7 | // #include "config.h" |
---|
[b973c0] | 8 | |
---|
[2dd068] | 9 | #include "canonicalform.h" |
---|
| 10 | |
---|
| 11 | /*BEGINPUBLIC*/ |
---|
| 12 | |
---|
| 13 | class CFRandom { |
---|
| 14 | public: |
---|
| 15 | virtual ~CFRandom() {} |
---|
| 16 | virtual CanonicalForm generate() const { return 0; } |
---|
| 17 | virtual CFRandom * clone() const { return new CFRandom(); } |
---|
| 18 | }; |
---|
| 19 | |
---|
| 20 | class GFRandom : public CFRandom |
---|
| 21 | { |
---|
| 22 | public: |
---|
| 23 | GFRandom() {}; |
---|
| 24 | ~GFRandom() {} |
---|
| 25 | CanonicalForm generate() const; |
---|
| 26 | CFRandom * clone() const; |
---|
| 27 | }; |
---|
| 28 | |
---|
| 29 | class FFRandom : public CFRandom |
---|
| 30 | { |
---|
| 31 | public: |
---|
| 32 | FFRandom() {} |
---|
| 33 | ~FFRandom() {} |
---|
| 34 | CanonicalForm generate() const; |
---|
| 35 | CFRandom * clone() const; |
---|
| 36 | }; |
---|
| 37 | |
---|
| 38 | class IntRandom : public CFRandom |
---|
| 39 | { |
---|
| 40 | private: |
---|
| 41 | int max; |
---|
| 42 | public: |
---|
| 43 | IntRandom(); |
---|
| 44 | IntRandom( int m ); |
---|
| 45 | ~IntRandom(); |
---|
| 46 | CanonicalForm generate() const; |
---|
| 47 | CFRandom * clone() const; |
---|
| 48 | }; |
---|
| 49 | |
---|
| 50 | class AlgExtRandomF : public CFRandom { |
---|
| 51 | private: |
---|
| 52 | Variable algext; |
---|
| 53 | CFRandom * gen; |
---|
| 54 | int n; |
---|
| 55 | AlgExtRandomF(); |
---|
| 56 | AlgExtRandomF( const Variable & v, CFRandom * g, int nn ); |
---|
| 57 | AlgExtRandomF& operator= ( const AlgExtRandomF & ); |
---|
| 58 | public: |
---|
[d56aae9] | 59 | AlgExtRandomF( const AlgExtRandomF & ); |
---|
[2dd068] | 60 | AlgExtRandomF( const Variable & v ); |
---|
| 61 | AlgExtRandomF( const Variable & v1, const Variable & v2 ); |
---|
| 62 | ~AlgExtRandomF(); |
---|
| 63 | CanonicalForm generate() const; |
---|
| 64 | CFRandom * clone() const; |
---|
| 65 | }; |
---|
| 66 | |
---|
| 67 | class CFRandomFactory { |
---|
| 68 | public: |
---|
| 69 | static CFRandom * generate(); |
---|
| 70 | }; |
---|
| 71 | |
---|
| 72 | int factoryrandom( int n ); |
---|
| 73 | |
---|
| 74 | void factoryseed( int s ); |
---|
| 75 | |
---|
[eb27af] | 76 | /*ENDPUBLIC*/ |
---|
| 77 | |
---|
[493c477] | 78 | #endif /* ! INCL_CF_RANDOM_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.