Open Babel
3.0
|
#include <openbabel/babelconfig.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "rand.h"
#include <time.h>
Namespaces | |
OpenBabel | |
Macros | |
#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) |
static void | DoubleAdd (DoubleType *x, unsigned int y) |
static void | DoubleMultiply (unsigned int x, unsigned int y, DoubleType *z) |
static int | LeadingZeros (unsigned int x) |
static unsigned int | DoubleModulus (DoubleType *n, unsigned int d) |
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) |
static int | DetermineSequence (unsigned int m, unsigned int *pm, unsigned int *pa, unsigned int *pc) |
static void | GenerateSequence (unsigned int p, unsigned int m, unsigned int a, unsigned int c) |
Variables | |
static int | primes [MAXPRIMES] |
Pseudo random number generator.
#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().