1 // This is brl/bbas/bsta/bsta_distribution.h
2 #ifndef bsta_distribution_h_
3 #define bsta_distribution_h_
4 //:
5 // \file
6 // \brief A base class for probability distributions
7 // \author Matt Leotta (mleotta@lems.brown.edu)
8 // \date January 25, 2006
9 //
10 // \verbatim
11 //  Modifications
12 //   (none yet)
13 // \endverbatim
14 
15 #include <vnl/vnl_vector_fixed.h>
16 
17 //: A base class for probability distributions
18 template <class T, unsigned n>
19 class bsta_distribution
20 {
21   public:
22     //: The dimension of the distribution
23     enum { dimension = n };
24     //: The type used for calculations
25     typedef T math_type;
26     //: The type used for a n-dimensional vector of math types
27     typedef vnl_vector_fixed<math_type,dimension> vector_type;
28     //: for compatibility with vpdl/vpdt
29     typedef vector_type field_type;
30 };
31 
32 
33 //: A base class for 1D probability distributions
34 //  Warning: this is partial specialization
35 template <class T>
36 class bsta_distribution<T,1>
37 {
38   public:
39     //: The dimension of the distribution
40     enum { dimension = 1 };
41     //: The type used for calculations
42     typedef T math_type;
43     //: The type used for a n-dimensional vector of math types
44     typedef T vector_type;
45 
46     //: for compatibility with vpdl/vpdt
47     typedef vector_type field_type;
48 };
49 
50 
51 #endif // bsta_distribution_h_
52