My Project  debian-1:4.1.2-p1+ds-2
Data Structures | Functions | Variables
cf_random.cc File Reference
#include "config.h"
#include <time.h>
#include "cf_assert.h"
#include "cf_defs.h"
#include "cf_random.h"
#include "ffops.h"
#include "gfops.h"
#include "imm.h"

Go to the source code of this file.

Data Structures

class  RandomGenerator
 

Functions

int factoryrandom (int n)
 random integers with abs less than n More...
 
void factoryseed (int s)
 random seed initializer More...
 

Variables

INST_VAR RandomGenerator ranGen
 

Function Documentation

◆ factoryrandom()

int factoryrandom ( int  n)

random integers with abs less than n

Definition at line 168 of file cf_random.cc.

169 {
170  if ( n == 0 )
171  return (int)ranGen.generate();
172  else
173  return ranGen.generate() % n;
174 }

◆ factoryseed()

void factoryseed ( int  s)

random seed initializer

Definition at line 176 of file cf_random.cc.

177 {
178  ranGen.seed( s );
179 }

Variable Documentation

◆ ranGen

Definition at line 54 of file cf_random.cc.

ranGen
INST_VAR RandomGenerator ranGen
Definition: cf_random.cc:54
RandomGenerator::seed
void seed(int ss)
Definition: cf_random.cc:29
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
RandomGenerator::generate
int generate()
Definition: cf_random.cc:43