Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions
LightGBM::Random Class Reference

A wrapper for random generator. More...

#include <random.h>

Public Member Functions

 Random ()
 Constructor, with random seed.
 
 Random (int seed)
 Constructor, with specific seed.
 
int NextShort (int lower_bound, int upper_bound)
 Generate random integer, int16 range. [0, 65536].
 
int NextInt (int lower_bound, int upper_bound)
 Generate random integer, int32 range.
 
float NextFloat ()
 Generate random float data.
 
std::vector< int > Sample (int N, int K)
 Sample K data from {0,1,...,N-1}.
 

Detailed Description

A wrapper for random generator.

Member Function Documentation

◆ NextFloat()

float LightGBM::Random::NextFloat ( )
inline

Generate random float data.

Returns
The random float between [0.0, 1.0)

◆ NextInt()

int LightGBM::Random::NextInt ( int  lower_bound,
int  upper_bound 
)
inline

Generate random integer, int32 range.

Parameters
lower_boundlower bound
upper_boundupper bound
Returns
The random integer between [lower_bound, upper_bound)

◆ NextShort()

int LightGBM::Random::NextShort ( int  lower_bound,
int  upper_bound 
)
inline

Generate random integer, int16 range. [0, 65536].

Parameters
lower_boundlower bound
upper_boundupper bound
Returns
The random integer between [lower_bound, upper_bound)

◆ Sample()

std::vector< int > LightGBM::Random::Sample ( int  N,
int  K 
)
inline

Sample K data from {0,1,...,N-1}.

Parameters
N
K
Returns
K Ordered sampled data from {0,1,...,N-1}

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