lux::Distribution1D Class Reference

#include <mcdistribution.h>

Collaboration diagram for lux::Distribution1D:
[legend]

List of all members.

Public Member Functions

 Distribution1D (float *f, int n)
 ~Distribution1D ()
float Sample (float u, float *pdf) const

Public Attributes

float * func
float * cdf
float funcInt
float invFuncInt
float invCount
int count

Detailed Description

A utility class for sampling from a regularly sampled 1D distribution.

Definition at line 81 of file mcdistribution.h.


Constructor & Destructor Documentation

lux::Distribution1D::Distribution1D ( float *  f,
int  n 
) [inline]

Creates a 1D distribution for the given function. It is assumed that the given function is sampled regularly sampled in the interval [0,1] (ex. 0.1, 0.3, 0.5, 0.7, 0.9 for 5 samples).

Parameters:
f The values of the function.
n The number of samples.

Definition at line 91 of file mcdistribution.h.

References cdf, lux::ComputeStep1dCDF(), count, func, funcInt, invCount, invFuncInt, and memcpy().

lux::Distribution1D::~Distribution1D (  )  [inline]

Definition at line 100 of file mcdistribution.h.

References cdf, and func.


Member Function Documentation

float lux::Distribution1D::Sample ( float  u,
float *  pdf 
) const [inline]

Samples from this distribution.

Parameters:
u The random value used to sample.
pdf The pointer to the float where the pdf of the sample should be stored.
Returns:
The x value of the sample (i.e. the x in f(x)).

Definition at line 114 of file mcdistribution.h.

References cdf, count, func, invFuncInt, and cimg_library::cimg::max().

Referenced by lux::InfiniteAreaLightIS::Sample_L().


Member Data Documentation

Definition at line 129 of file mcdistribution.h.

Referenced by Distribution1D(), Sample(), and ~Distribution1D().

The function integral (assuming it is regularly sampled with an interval of 1), the inverted function integral and the inverted count.

Definition at line 134 of file mcdistribution.h.

Referenced by Distribution1D(), and lux::InfiniteAreaLightIS::Pdf().

Definition at line 134 of file mcdistribution.h.

Referenced by Distribution1D(), and lux::InfiniteAreaLightIS::Sample_L().

Definition at line 134 of file mcdistribution.h.

Referenced by Distribution1D(), and Sample().


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208