Open3D (C++ API)  0.18.0+5c982c7
Public Member Functions | Protected Attributes
open3d::utility::random::NormalGenerator< T > Class Template Reference

#include <Random.h>

Public Member Functions

 NormalGenerator (const T mean=0.0, const T stddev=1.0)
 
operator() ()
 Call this to generate a normally distributed floating point value. More...
 

Protected Attributes

std::normal_distribution< T > distribution_
 

Detailed Description

template<typename T>
class open3d::utility::random::NormalGenerator< T >

Generate normally distributed floating point values with mean and std. This class is globally seeded by utility::random::Seed(). This class is a wrapper around std::normal_distribution.

Example:

// Globally seed Open3D. This will affect all random functions.
// Generate a random double with mean 0 and std 1.
utility::random::NormalGenerator<double> gen(0, 1);
for (size_t i = 0; i < 10; i++) {
std::cout << gen() << std::endl;
}
void Seed(const int seed)
Set Open3D global random seed.
Definition: Random.cpp:53

Constructor & Destructor Documentation

◆ NormalGenerator()

template<typename T >
open3d::utility::random::NormalGenerator< T >::NormalGenerator ( const T  mean = 0.0,
const T  stddev = 1.0 
)
inline

Generate normally distributed floating point value with mean and std.

Parameters
meanThe mean of the distribution.
stddevThe standard deviation of the distribution.

Member Function Documentation

◆ operator()()

template<typename T >
T open3d::utility::random::NormalGenerator< T >::operator() ( )
inline

Call this to generate a normally distributed floating point value.

Field Documentation

◆ distribution_

template<typename T >
std::normal_distribution<T> open3d::utility::random::NormalGenerator< T >::distribution_
protected

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