source: git/factory/cf_random.h @ e4fe2b

jengelh-datetimespielwiese
Last change on this file since e4fe2b was e4fe2b, checked in by Oleksandr Motsak <motsak@…>, 11 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
Line 
1/* emacs edit mode for this file is -*- C++ -*- */
2/* $Id$ */
3
4#ifndef INCL_CF_RANDOM_H
5#define INCL_CF_RANDOM_H
6
7// #include "config.h"
8
9#include "canonicalform.h"
10
11/*BEGINPUBLIC*/
12
13class CFRandom {
14public:
15    virtual ~CFRandom() {}
16    virtual CanonicalForm generate() const { return 0; }
17    virtual CFRandom * clone() const { return new CFRandom(); }
18};
19
20class GFRandom : public CFRandom
21{
22public:
23    GFRandom() {};
24    ~GFRandom() {}
25    CanonicalForm generate() const;
26    CFRandom * clone() const;
27};
28
29class FFRandom : public CFRandom
30{
31public:
32    FFRandom() {}
33    ~FFRandom() {}
34    CanonicalForm generate() const;
35    CFRandom * clone() const;
36};
37
38class IntRandom : public CFRandom
39{
40private:
41    int max;
42public:
43    IntRandom();
44    IntRandom( int m );
45    ~IntRandom();
46    CanonicalForm generate() const;
47    CFRandom * clone() const;
48};
49
50class AlgExtRandomF : public CFRandom {
51private:
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 & );
58public:
59    AlgExtRandomF( const AlgExtRandomF & );
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
67class CFRandomFactory {
68public:
69    static CFRandom * generate();
70};
71
72int factoryrandom( int n );
73
74void factoryseed( int s );
75
76/*ENDPUBLIC*/
77
78#endif /* ! INCL_CF_RANDOM_H */
Note: See TracBrowser for help on using the repository browser.