ContUniformSampler.cpp

Go to the documentation of this file.
00001 /**<!-------------------------------------------------------------------->
00002    @file   ContUniformSampler.cpp
00003    @author Travis Fischer (fisch0920@gmail.com)
00004    @author Matthew Jacobs (jacobs.mh@gmail.com)
00005    @date   Fall 2008
00006    
00007    @brief
00008       Represents a continuous uniform distribution
00009          X ~ U(min, max)
00010          f(x) = 1 / (max - min)
00011    <!-------------------------------------------------------------------->**/
00012 
00013 #include "ContUniformSampler.h"
00014 
00015 Event ContUniformSampler::sample() {
00016    return Event(m_sampler(), this);
00017 }
00018 
00019 real_t ContUniformSampler::getPdf(const Event &event) {
00020    return 1.0 / (m_max - m_min);
00021 }
00022 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6