Classes | Defines | Functions | Variables

ut_rand.cpp File Reference

#include <limits.h>
#include <stddef.h>
#include <stdlib.h>
#include "ut_types.h"
#include "ut_rand.h"
#include <errno.h>

Classes

struct  UT_random_data
struct  random_poly_info

Defines

#define TYPE_0   0
#define BREAK_0   8
#define DEG_0   0
#define SEP_0   0
#define TYPE_1   1
#define BREAK_1   32
#define DEG_1   7
#define SEP_1   3
#define TYPE_2   2
#define BREAK_2   64
#define DEG_2   15
#define SEP_2   1
#define TYPE_3   3
#define BREAK_3   128
#define DEG_3   31
#define SEP_3   3
#define TYPE_4   4
#define BREAK_4   256
#define DEG_4   63
#define SEP_4   1
#define MAX_TYPES   5
#define TYPE_0   0
#define BREAK_0   8
#define DEG_0   0
#define SEP_0   0
#define TYPE_1   1
#define BREAK_1   32
#define DEG_1   7
#define SEP_1   3
#define TYPE_2   2
#define BREAK_2   64
#define DEG_2   15
#define SEP_2   1
#define BREAK_3   128
#define TYPE_4   4
#define BREAK_4   256
#define DEG_4   63
#define SEP_4   1
#define MAX_TYPES   5

Functions

static int srandom_r__ (unsigned int seed, struct UT_random_data *buf)
static int random_r__ (struct UT_random_data *buf, UT_sint32 *result)
void UT_srandom (UT_uint32 seed)
static UT_sint32 random__ ()
UT_sint32 UT_rand ()

Variables

static UT_sint32 randtbl [DEG_3+1]
static struct UT_random_data unsafe_state

Define Documentation

#define BREAK_0   8
#define BREAK_0   8
#define BREAK_1   32
#define BREAK_1   32
#define BREAK_2   64
#define BREAK_2   64
#define BREAK_3   128
#define BREAK_3   128
#define BREAK_4   256
#define BREAK_4   256
#define DEG_0   0
#define DEG_0   0
#define DEG_1   7
#define DEG_1   7
#define DEG_2   15
#define DEG_2   15
#define DEG_3   31
#define DEG_4   63
#define DEG_4   63
#define MAX_TYPES   5
#define MAX_TYPES   5

Referenced by srandom_r__().

#define SEP_0   0
#define SEP_0   0
#define SEP_1   3
#define SEP_1   3
#define SEP_2   1
#define SEP_2   1
#define SEP_3   3
#define SEP_4   1
#define SEP_4   1
#define TYPE_0   0
#define TYPE_0   0

Referenced by random_r__(), and srandom_r__().

#define TYPE_1   1
#define TYPE_1   1
#define TYPE_2   2
#define TYPE_2   2
#define TYPE_3   3
#define TYPE_4   4
#define TYPE_4   4

Function Documentation

static UT_sint32 random__ (  )  [static]

References random_r__().

Referenced by UT_rand().

static int random_r__ ( struct UT_random_data buf,
UT_sint32 result 
) [static]
static int srandom_r__ ( unsigned int  seed,
struct UT_random_data buf 
) [static]
UT_sint32 UT_rand (  ) 
void UT_srandom ( UT_uint32  seed  ) 

Variable Documentation

UT_sint32 randtbl[DEG_3+1] [static]
Initial value:
  {
    TYPE_3,

    -1726662223, 379960547, 1735697613, 1040273694, 1313901226,
    1627687941, -179304937, -2073333483, 1780058412, -1989503057,
    -615974602, 344556628, 939512070, -1249116260, 1507946756,
    -812545463, 154635395, 1388815473, -1926676823, 525320961,
    -1009028674, 968117788, -123449607, 1284210865, 435012392,
    -2017506339, -911064859, -370259173, 1132637927, 1398500161,
    -205601318,
  }
struct UT_random_data unsafe_state [static]
Initial value:
  {


      
       &randtbl[SEP_3 + 1],
       &randtbl[1],



       &randtbl[1],

       TYPE_3,
       DEG_3,
       SEP_3,

       &randtbl[sizeof (randtbl) / sizeof (randtbl[0])]
}