Sampler Class Reference

Represents an abstract random variable that can be sampled according to some discrete/continuous probability distribution. More...

#include <Sampler.h>

Inheritance diagram for Sampler:

BSDF EmitterSampler ExponentialSampler JointContUniformSampler JointSampler NormalSampler SensorSampler UniformOnSphereSampler UniformSampler< T > UniformSampler< double > UniformSampler< int >

List of all members.

Public Member Functions

Constructors
 Sampler ()
virtual ~Sampler ()
Initialization
virtual void init ()
 Should perform any initialization of this random variable which may be necessary to speed or prepare sampling.
Main usage interface
virtual Event sample ()=0
virtual Event sample (real_t &pdf)
 Utility method to both sample this random variable and return the probability density with which that sample was chosen in the out variable pdf.
virtual real_t getPdf (const Event &event) PURE_FUNCTION=0


Detailed Description

Represents an abstract random variable that can be sampled according to some discrete/continuous probability distribution.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 17 of file Sampler.h.


Constructor & Destructor Documentation

Sampler::Sampler (  )  [inline]

Definition at line 23 of file Sampler.h.

virtual Sampler::~Sampler (  )  [inline, virtual]

Definition at line 26 of file Sampler.h.


Member Function Documentation

virtual void Sampler::init (  )  [inline, virtual]

Should perform any initialization of this random variable which may be necessary to speed or prepare sampling.

Note:
should be called before calling sample or getPdf

default implementation is empty

Reimplemented in BSDF, AggregateBSDF, DielectricBSDF, ModifiedPhongBSDF, Emitter, EnvironmentMap, NullEmitter, Sensor, NullSensor, ExponentialSampler, JointContUniformSampler, NormalSampler, SensorSampler, UniformOnSphereSampler, UniformSampler< T >, UniformSampler< double >, and UniformSampler< int >.

Definition at line 42 of file Sampler.h.

virtual Event Sampler::sample (  )  [pure virtual]

Returns:
a randomly chosen event x, sampled from this random variable's sample space
Note:
consecutive calls to sample are expected to return independent, identically distributed (IID) samples

Implemented in BSDF, AbsorbentBSDF, AggregateBSDF, DielectricBSDF, DiffuseBSDF, ModifiedPhongBSDF, Emitter, Sensor, NullSensor, ContUniformSampler, DiscreteUniformSampler, EmitterSampler, ExponentialSampler, JointContUniformSampler, NormalSampler, SensorSampler, and UniformOnSphereSampler.

Event Sampler::sample ( real_t pdf  )  [virtual]

Utility method to both sample this random variable and return the probability density with which that sample was chosen in the out variable pdf.

Returns:
a randomly chosen event x, sampled from this random variable's sample space
Note:
consecutive calls to sample are expected to return independent, identically distributed (IID) samples

Definition at line 14 of file Sampler.cpp.

virtual real_t Sampler::getPdf ( const Event event  )  [pure virtual]

Returns:
the probability density with which the given event would be sampled according to the underlying probability density function
Note:
the given event is assumed to lie within this random variable's sample space

Implemented in BSDF, AbsorbentBSDF, AggregateBSDF, DielectricBSDF, DiffuseBSDF, ModifiedPhongBSDF, Emitter, Sensor, NullSensor, ContUniformSampler, DiscreteUniformSampler, EmitterSampler, ExponentialSampler, JointContUniformSampler, NormalSampler, SensorSampler, and UniformOnSphereSampler.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6