Event.cpp
Go to the documentation of this file.00001 /**<!--------------------------------------------------------------------> 00002 @file Event.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 single event which was sampled from a Sampler. The 00009 internal value of this event is stored in a variant using boost::any, 00010 where the concrete value of type T can be extracted using 00011 Event<T>::getValue() 00012 00013 This makes it esay to have all Samplers conform to the same sampling 00014 interface, which facilitates the implementation of more abstract sampling 00015 algorithms without respect to specific Sampler implementations. One 00016 example of this generic Sampling interface being useful is generic 00017 multiple importance sampling (@see MultipleImportanceSampler) 00018 <!-------------------------------------------------------------------->**/ 00019 00020 #include "Event.h" 00021 #include "Sampler.h" 00022 00023 real_t Event::getPdf() { 00024 if (m_p < 0) { 00025 ASSERT(m_sampler); 00026 00027 m_p = m_sampler->getPdf(*this); 00028 } 00029 00030 ASSERT(m_p >= 0); 00031 return m_p; 00032 } 00033
Generated on 28 Feb 2009 for Milton by
1.5.6