Distribution1D Class Reference

Discrete 1D distribution. More...

#include <dist.h>

Public Member Functions

 LM_DISABLE_COPY_AND_MOVE (Distribution1D)
 
auto Add (Float v) -> void
 Add an value.
 
auto Normalize () -> void
 Normalize the histogram.
 
auto Sample (Float u) const -> int
 Sample from the distribution.
 
auto SampleReuse (Float u, Float &u2) const -> int
 Sample from the distribution reusing a random variable.
 
auto EvaluatePDF (int i) const -> Float
 Evaluate distribution.
 
auto Clear () -> void
 Clear distribution.
 
auto Empty () const -> bool
 Check if the distribution is empty.
 

Detailed Description

Discrete 1D distribution.