contrib/brl/bbas/bsta/bsta_distribution.h
Go to the documentation of this file.
00001 // This is brl/bbas/bsta/bsta_distribution.h
00002 #ifndef bsta_distribution_h_
00003 #define bsta_distribution_h_
00004 //:
00005 // \file
00006 // \brief A base class for probability distributions
00007 // \author Matt Leotta (mleotta@lems.brown.edu)
00008 // \date January 25, 2006
00009 //
00010 // \verbatim
00011 //  Modifications
00012 //   (none yet)
00013 // \endverbatim
00014 
00015 #include <vnl/vnl_vector_fixed.h>
00016 
00017 //: A base class for probability distributions
00018 template <class T, unsigned n>
00019 class bsta_distribution
00020 {
00021   public:
00022     //: The dimension of the distribution
00023     enum { dimension = n };
00024     //: The type used for calculations
00025     typedef T math_type;
00026     //: The type used for a n-dimensional vector of math types
00027     typedef vnl_vector_fixed<math_type,dimension> vector_type;
00028     //: for compatibility with vpdl/vpdt
00029     typedef vector_type field_type;
00030 };
00031 
00032 
00033 //: A base class for 1D probability distributions
00034 //  Warning: this is partial specialization
00035 template <class T>
00036 class bsta_distribution<T,1>
00037 {
00038   public:
00039     //: The dimension of the distribution
00040     enum { dimension = 1 };
00041     //: The type used for calculations
00042     typedef T math_type;
00043     //: The type used for a n-dimensional vector of math types
00044     typedef T vector_type;
00045 
00046     //: for compatibility with vpdl/vpdt
00047     typedef vector_type field_type;
00048 };
00049 
00050 
00051 #endif // bsta_distribution_h_