TreeNode 1.5.2
A library to manipulate phylogenetic trees
Loading...
Searching...
No Matches
PhyloTree.TreeBuilding.ThreadSafeRandom Class Reference

Represents a thread-safe random number generator. More...

Inheritance diagram for PhyloTree.TreeBuilding.ThreadSafeRandom:

Public Member Functions

 ThreadSafeRandom (int seed)
 Initialise a new thread-safe random number generator with the specified seed. More...
 
 ThreadSafeRandom ()
 Initialise a new thread-safe random number generator. More...
 
override int Next ()
 
override int Next (int maxValue)
 
override int Next (int minValue, int maxValue)
 
override double NextDouble ()
 
override void NextBytes (byte[] buffer)
 

Detailed Description

Represents a thread-safe random number generator.

Adapted from https://stackoverflow.com/questions/3049467/is-c-sharp-random-number-generator-thread-safe

Definition at line 10 of file ThreadSafeRandom.cs.

Constructor & Destructor Documentation

◆ ThreadSafeRandom() [1/2]

PhyloTree.TreeBuilding.ThreadSafeRandom.ThreadSafeRandom ( int  seed)

Initialise a new thread-safe random number generator with the specified seed.

Parameters
seedA number used to generate a starting number for the pseudo-random sequence.

Definition at line 22 of file ThreadSafeRandom.cs.

◆ ThreadSafeRandom() [2/2]

PhyloTree.TreeBuilding.ThreadSafeRandom.ThreadSafeRandom ( )

Initialise a new thread-safe random number generator.

Definition at line 34 of file ThreadSafeRandom.cs.

Member Function Documentation

◆ Next() [1/3]

override int PhyloTree.TreeBuilding.ThreadSafeRandom.Next ( )

Definition at line 60 of file ThreadSafeRandom.cs.

◆ Next() [2/3]

override int PhyloTree.TreeBuilding.ThreadSafeRandom.Next ( int  maxValue)

Definition at line 67 of file ThreadSafeRandom.cs.

◆ Next() [3/3]

override int PhyloTree.TreeBuilding.ThreadSafeRandom.Next ( int  minValue,
int  maxValue 
)

Definition at line 74 of file ThreadSafeRandom.cs.

◆ NextBytes()

override void PhyloTree.TreeBuilding.ThreadSafeRandom.NextBytes ( byte[]  buffer)

Definition at line 88 of file ThreadSafeRandom.cs.

◆ NextDouble()

override double PhyloTree.TreeBuilding.ThreadSafeRandom.NextDouble ( )

Definition at line 81 of file ThreadSafeRandom.cs.


The documentation for this class was generated from the following file: