Public Member Functions | Private Attributes
IntRandom Class Reference

generate random integers More...

#include <cf_random.h>

Public Member Functions

 IntRandom ()
 
 IntRandom (int m)
 
 ~IntRandom ()
 
CanonicalForm generate () const
 
CFRandomclone () const
 
 IntRandom ()
 
 IntRandom (int m)
 
 ~IntRandom ()
 
CanonicalForm generate () const
 
CFRandomclone () const
 
 IntRandom ()
 
 IntRandom (int m)
 
 ~IntRandom ()
 
CanonicalForm generate () const
 
CFRandomclone () const
 
- Public Member Functions inherited from CFRandom
virtual ~CFRandom ()
 
virtual ~CFRandom ()
 
virtual ~CFRandom ()
 

Private Attributes

int max
 

Detailed Description

generate random integers

Definition at line 55 of file cf_random.h.

Constructor & Destructor Documentation

◆ IntRandom() [1/6]

IntRandom::IntRandom ( )

Definition at line 79 of file cf_random.cc.

80 {
81  max = 50;
82 }
int max
Definition: cf_random.h:58

◆ IntRandom() [2/6]

IntRandom::IntRandom ( int  m)

Definition at line 84 of file cf_random.cc.

85 {
86  max = m;
87 }
int max
Definition: cf_random.h:58
int m
Definition: cfEzgcd.cc:121

◆ ~IntRandom() [1/3]

IntRandom::~IntRandom ( )

Definition at line 89 of file cf_random.cc.

89 {}

◆ IntRandom() [3/6]

IntRandom::IntRandom ( )

◆ IntRandom() [4/6]

IntRandom::IntRandom ( int  m)

◆ ~IntRandom() [2/3]

IntRandom::~IntRandom ( )

◆ IntRandom() [5/6]

IntRandom::IntRandom ( )

◆ IntRandom() [6/6]

IntRandom::IntRandom ( int  m)

◆ ~IntRandom() [3/3]

IntRandom::~IntRandom ( )

Member Function Documentation

◆ clone() [1/3]

CFRandom * IntRandom::clone ( ) const
virtual

Reimplemented from CFRandom.

Definition at line 96 of file cf_random.cc.

97 {
98  return new IntRandom( max );
99 }
int max
Definition: cf_random.h:58

◆ clone() [2/3]

CFRandom* IntRandom::clone ( ) const
virtual

Reimplemented from CFRandom.

◆ clone() [3/3]

CFRandom* IntRandom::clone ( ) const
virtual

Reimplemented from CFRandom.

◆ generate() [1/3]

CanonicalForm IntRandom::generate ( ) const
virtual

Reimplemented from CFRandom.

Definition at line 91 of file cf_random.cc.

92 {
93  return factoryrandom( 2*max )-max;
94 }
int factoryrandom(int n)
random integers with abs less than n
Definition: cf_random.cc:168
int max
Definition: cf_random.h:58

◆ generate() [2/3]

CanonicalForm IntRandom::generate ( ) const
virtual

Reimplemented from CFRandom.

◆ generate() [3/3]

CanonicalForm IntRandom::generate ( ) const
virtual

Reimplemented from CFRandom.

Field Documentation

◆ max

int IntRandom::max
private

Definition at line 58 of file cf_random.h.


The documentation for this class was generated from the following files: