vpdt_num_obs.h
Go to the documentation of this file.
1 // This is core/vpdl/vpdt/vpdt_num_obs.h
2 #ifndef vpdt_num_obs_h_
3 #define vpdt_num_obs_h_
4 //:
5 // \file
6 // \author Matthew Leotta
7 // \brief Attach a "number of observations" variable to any distribution
8 // \date April 7, 2009
9 //
10 // \verbatim
11 // Modifications
12 // None
13 // \endverbatim
14 
15 
17 
18 //: Attach a "number of observations" variable to any distribution.
19 // The number of observations is non-integral because there may be
20 // partial or weighted observations.
21 template <class dist_t>
22 class vpdt_num_obs : public dist_t
23 {
24  public:
25  //: the data type to represent a point in the field
26  typedef typename dist_t::field_type field_type;
27  //: define the parent type
28  typedef dist_t parent_type;
29  //: define the scalar type (normally specified by template parameter T)
31 
32  //: Constructor
34 
35  //: Constructor - somewhat like a copy constructor
36  vpdt_num_obs<dist_t>(const dist_t& d, const T& n_obs = T(0))
37  : dist_t(d), num_observations(n_obs) {}
38 
39  //: The number of observations
41 };
42 
43 
44 #endif // vpdt_num_obs_h_
dist_t parent_type
define the parent type.
Definition: vpdt_num_obs.h:28
T num_observations
The number of observations.
Definition: vpdt_num_obs.h:40
dist_t::field_type field_type
the data type to represent a point in the field.
Definition: vpdt_num_obs.h:26
specialized template trait classes for properties of a field type
vpdt_field_traits< field_type >::scalar_type T
define the scalar type (normally specified by template parameter T).
Definition: vpdt_num_obs.h:30
The field traits class (scalar).
Attach a "number of observations" variable to any distribution.
Definition: vpdt_num_obs.h:22