My Project
Loading...
Searching...
No Matches
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
 
- Public Member Functions inherited from CFRandom
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/2]

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/2]

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()

IntRandom::~IntRandom ( )

Definition at line 101 of file cf_random.cc.

101{}

Member Function Documentation

◆ clone()

CFRandom * IntRandom::clone ( ) const
virtual

Reimplemented from CFRandom.

Definition at line 108 of file cf_random.cc.

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

◆ generate()

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

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: