tesseract 3.04.01

tesseract::TRand Class Reference

#include <helpers.h>

List of all members.

Public Member Functions

 TRand ()
void set_seed (uinT64 seed)
inT32 IntRand ()
double SignedRand (double range)
double UnsignedRand (double range)

Detailed Description

Definition at line 39 of file helpers.h.


Constructor & Destructor Documentation

tesseract::TRand::TRand ( ) [inline]

Definition at line 41 of file helpers.h.

: seed_(1) {}

Member Function Documentation

inT32 tesseract::TRand::IntRand ( ) [inline]

Definition at line 48 of file helpers.h.

                  {
    Iterate();
    return seed_ >> 33;
  }
void tesseract::TRand::set_seed ( uinT64  seed) [inline]

Definition at line 43 of file helpers.h.

                             {
    seed_ = seed;
  }
double tesseract::TRand::SignedRand ( double  range) [inline]

Definition at line 53 of file helpers.h.

                                  {
    return range * 2.0 * IntRand() / MAX_INT32 - range;
  }
double tesseract::TRand::UnsignedRand ( double  range) [inline]

Definition at line 57 of file helpers.h.

                                    {
    return range * IntRand() / MAX_INT32;
  }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines