My Project
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 CanonicalForm generate () const
 
virtual CFRandomclone () const
 
virtual ~CFRandom ()
 
virtual CanonicalForm generate () const
 
virtual CFRandomclone () const
 
virtual ~CFRandom ()
 
virtual CanonicalForm generate () const
 
virtual CFRandomclone () const
 

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 91 of file cf_random.cc.

92{
93 max = 50;
94}
int max
Definition: cf_random.h:58

◆ IntRandom() [2/6]

IntRandom::IntRandom ( int  m)

Definition at line 96 of file cf_random.cc.

97{
98 max = m;
99}
int m
Definition: cfEzgcd.cc:128

◆ ~IntRandom() [1/3]

IntRandom::~IntRandom ( )

Definition at line 101 of file cf_random.cc.

101{}

◆ 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 108 of file cf_random.cc.

109{
110 return new IntRandom( max );
111}

◆ 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 103 of file cf_random.cc.

104{
105 return factoryrandom( 2*max )-max;
106}
int factoryrandom(int n)
random integers with abs less than n
Definition: cf_random.cc:180

◆ 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: