rand.cpp File Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

Namespaces | Defines | Functions | Variables
rand.cpp File Reference
`#include <openbabel/babelconfig.h>`
`#include <stdlib.h>`
`#include <stdio.h>`
`#include <math.h>`
`#include <openbabel/rand.h>`
`#include <time.h>`

## Namespaces
namespace | OpenBabel
## Defines
#define | True 1
#define | False 0
#define | IsEven(x) (((x)&1)==0)
#define | IsOdd(x) (((x)&1)!=0)
#define | BothEven(x, y) IsEven((x)|(y))
#define | IsPrime(x) (!IsEven((x))&&IsOddPrime((x)))
#define | HiPart(x) (x>>16)
#define | LoPart(x) ((x)&0xffff)
#define | MAXFACT 10
#define | MAXPRIMES 256
## Functions
static unsigned int | isqrt (unsigned int val)
static int | IsOddPrime (unsigned int x)
static int | RelativelyPrime (unsigned int x, unsigned int y)
void | DoubleAdd (DoubleType *, unsigned int)
void | DoubleMultiply (unsigned int, unsigned int, DoubleType *)
static int | LeadingZeros (unsigned int x)
unsigned int | DoubleModulus (DoubleType *, unsigned int)
static int | DeterminePotency (unsigned int m, unsigned int a)
static int | DetermineFactors (unsigned int x, unsigned int *factors)
static unsigned int | DetermineIncrement (unsigned int m)
int | DetermineSequence (unsigned int m, unsigned int *pm, unsigned int *pa, unsigned int *pc)
void | GenerateSequence (unsigned int p, unsigned int m, unsigned int a, unsigned int c)
## Variables
static int | primes [MAXPRIMES]

## Detailed Description

Pseudo random number generator.

## Define Documentation

#define True 1

Referenced by OpenBabel::DetermineSequence(), and OpenBabel::IsOddPrime().

#define False 0

Referenced by OpenBabel::DetermineSequence(), OpenBabel::IsOddPrime(), and OpenBabel::RelativelyPrime().

#define IsEven | ( |  | x | ) | (((x)&1)==0)

Referenced by OpenBabel::RelativelyPrime().

#define IsOdd | ( |  | x | ) | (((x)&1)!=0)

#define BothEven | ( |  | x,
|  |  | y
| ) |  | IsEven((x)|(y))

Referenced by OpenBabel::RelativelyPrime().

#define IsPrime | ( |  | x | ) | (!IsEven((x))&&IsOddPrime((x)))

#define HiPart | ( |  | x | ) | (x>>16)

Referenced by OpenBabel::DoubleModulus(), and OpenBabel::DoubleMultiply().

#define LoPart | ( |  | x | ) | ((x)&0xffff)

Referenced by OpenBabel::DoubleModulus(), and OpenBabel::DoubleMultiply().

#define MAXFACT 10

Referenced by OpenBabel::DetermineSequence().

#define MAXPRIMES 256

Referenced by OpenBabel::DetermineFactors(), and OpenBabel::IsOddPrime().

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines