Loading...
Searching...
No Matches
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"`
`#include <flint/flint.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
void | factoryseed (int s)
| random seed initializer

## Variables

GLOBAL_VAR flint_rand_t | FLINTrandom
INST_VAR RandomGenerator | ranGen

## Function Documentation

## factoryrandom()

int factoryrandom | ( | int | n | ) |

random integers with abs less than n

Definition at line 177 of file cf_random.cc.

{
if ( n == 0 )
return (int)ranGen.generate();
else
return ranGen.generate() % n;
}
ranGen
INST_VAR RandomGenerator ranGen
Definition cf_random.cc:63

## factoryseed()

void factoryseed | ( | int | s | ) |

random seed initializer

Definition at line 186 of file cf_random.cc.

{
ranGen.seed( s );
#ifdef HAVE_FLINT
#if (__FLINT_RELEASE>=30300)
flint_rand_init(FLINTrandom);
#else
flint_randinit(FLINTrandom);
#endif
#endif
}
FLINTrandom
GLOBAL_VAR flint_rand_t FLINTrandom
Definition cf_random.cc:23
s
const CanonicalForm int s
Definition facAbsFact.cc:51

## Variable Documentation

## FLINTrandom

GLOBAL_VAR flint_rand_t FLINTrandom

Definition at line 23 of file cf_random.cc.

## ranGen

INST_VAR RandomGenerator ranGen

Definition at line 63 of file cf_random.cc.