source: git/factory/cf_random.h @ 2dd068

spielwiese
Last change on this file since 2dd068 was 2dd068, checked in by Rüdiger Stobbe <stobbe@…>, 28 years ago
Initial revision git-svn-id: file:///usr/local/Singular/svn/trunk@6 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.5 KB
Line 
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
15class CFRandom {
16public:
17    virtual ~CFRandom() {}
18    virtual CanonicalForm generate() const { return 0; }
19    virtual CFRandom * clone() const { return new CFRandom(); }
20};
21
22class GFRandom : public CFRandom
23{
24public:
25    GFRandom() {};
26    ~GFRandom() {}
27    CanonicalForm generate() const;
28    CFRandom * clone() const;
29};
30
31class FFRandom : public CFRandom
32{
33public:
34    FFRandom() {}
35    ~FFRandom() {}
36    CanonicalForm generate() const;
37    CFRandom * clone() const;
38};
39
40class IntRandom : public CFRandom
41{
42private:
43    int max;
44public:
45    IntRandom();
46    IntRandom( int m );
47    ~IntRandom();
48    CanonicalForm generate() const;
49    CFRandom * clone() const;
50};
51
52class AlgExtRandomF : public CFRandom {
53private:
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 & );
61public:
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
69class CFRandomFactory {
70public:
71    static CFRandom * generate();
72};
73
74/*ENDPUBLIC*/
75
76int factoryrandom( int n );
77
78void factoryseed( int s );
79
80
81#endif /* INCL_CF_RANDOM_H */
Note: See TracBrowser for help on using the repository browser.