WeightedEvent.h

Go to the documentation of this file.
00001 /**<!-------------------------------------------------------------------->
00002    @class  WeightedEvent
00003    @author Travis Fischer (fisch0920@gmail.com)
00004    @author Matthew Jacobs (jacobs.mh@gmail.com)
00005    @date   Fall 2008
00006    
00007    @brief
00008       Represents an event sampled by a Sampler that has been coupled with 
00009    an arbitrary real-valued weight in [0,1]
00010    <!-------------------------------------------------------------------->**/
00011 
00012 #ifndef WEIGHTED_EVENT_H_
00013 #define WEIGHTED_EVENT_H_
00014 
00015 #include <stats/Event.h>
00016 
00017 struct WeightedEvent {
00018    Event  event;
00019    real_t weight;
00020    
00021    inline WeightedEvent(const Event &event_, real_t weight_ = 0)
00022       : event(event_), weight(weight_)
00023    {
00024       ASSERT(weight >= -EPSILON && weight <= 1 + EPSILON);
00025    }
00026 };
00027 
00028 DECLARE_STL_TYPEDEF(std::vector<WeightedEvent>, WeightedEventList);
00029 
00030 #endif // WEIGHTED_EVENT_H_
00031 

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6