#include <helpers.h>
Definition at line 61 of file helpers.h.
◆ IntRand()
int32_t tesseract::TRand::IntRand |
( |
| ) |
|
|
inline |
◆ set_seed() [1/2]
void tesseract::TRand::set_seed |
( |
const std::string & |
str | ) |
|
|
inline |
Definition at line 68 of file helpers.h.
68 {
69 std::hash<std::string> hasher;
70 set_seed(
static_cast<uint64_t
>(hasher(str)));
71 }
void set_seed(uint64_t seed)
◆ set_seed() [2/2]
void tesseract::TRand::set_seed |
( |
uint64_t |
seed | ) |
|
|
inline |
Definition at line 64 of file helpers.h.
64 {
65 e.seed(seed);
66 }
◆ SignedRand()
double tesseract::TRand::SignedRand |
( |
double |
range | ) |
|
|
inline |
Definition at line 78 of file helpers.h.
78 {
79 return range * 2.0 *
IntRand() / INT32_MAX - range;
80 }
◆ UnsignedRand()
double tesseract::TRand::UnsignedRand |
( |
double |
range | ) |
|
|
inline |
Definition at line 82 of file helpers.h.
82 {
83 return range *
IntRand() / INT32_MAX;
84 }
The documentation for this class was generated from the following file:
- /media/home/debian/src/github/tesseract-ocr/tesseract/src/ccutil/helpers.h