UniformOnSphereSampler Class Reference

Represents a uniform distribution on the surface of an N-dimensional unit sphere (with parameter N > 0 and radius = 1). More...

#include <UniformOnSphereSampler.h>

Inheritance diagram for UniformOnSphereSampler:

Sampler

List of all members.

Public Member Functions

Constructors
 UniformOnSphereSampler (unsigned dimension=3)
 UniformOnSphereSampler (const UniformOnSphereSampler &copy)
virtual ~UniformOnSphereSampler ()
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 ()
virtual real_t getPdf (const Event &event) PURE_FUNCTION
Accessors/Mutators
real_t getDimension () const
real_t getRadius () const

Protected Member Functions

unsigned _factorial (unsigned n)

Protected Attributes

Random::BoostUniformOnSphereSampler m_sampler
unsigned m_dimension


Detailed Description

Represents a uniform distribution on the surface of an N-dimensional unit sphere (with parameter N > 0 and radius = 1).

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 17 of file UniformOnSphereSampler.h.


Constructor & Destructor Documentation

UniformOnSphereSampler::UniformOnSphereSampler ( unsigned  dimension = 3  )  [inline, explicit]

Definition at line 23 of file UniformOnSphereSampler.h.

UniformOnSphereSampler::UniformOnSphereSampler ( const UniformOnSphereSampler copy  )  [inline]

Definition at line 30 of file UniformOnSphereSampler.h.

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

Definition at line 36 of file UniformOnSphereSampler.h.


Member Function Documentation

void UniformOnSphereSampler::init (  )  [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 initialiazes this random variable's sample space

Reimplemented from Sampler.

Definition at line 15 of file UniformOnSphereSampler.cpp.

Event UniformOnSphereSampler::sample (  )  [virtual]

Returns:
a randomly chosen event x, sampled from this random variable's sample space; returned Event has underlying type of Point3
Note:
consecutive calls to sample are expected to return independent, identically distributed (IID) samples

Implements Sampler.

Definition at line 21 of file UniformOnSphereSampler.cpp.

real_t UniformOnSphereSampler::getPdf ( const Event event  )  [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

Implements Sampler.

Definition at line 31 of file UniformOnSphereSampler.cpp.

real_t UniformOnSphereSampler::getDimension (  )  const [inline]

Returns:
the dimension of the sphere, whose surface defines the sample space of this random variable

Definition at line 86 of file UniformOnSphereSampler.h.

real_t UniformOnSphereSampler::getRadius (  )  const [inline]

Returns:
the radius of the N-dimensional sphere, whose surface defines the sample space of this random variable

Definition at line 94 of file UniformOnSphereSampler.h.

unsigned UniformOnSphereSampler::_factorial ( unsigned  n  )  [protected]

Definition at line 46 of file UniformOnSphereSampler.cpp.


Member Data Documentation

Definition at line 106 of file UniformOnSphereSampler.h.


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

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6