00001 // This is core/vbl/vbl_attributes.h 00002 #ifndef vbl_attributes_h_ 00003 #define vbl_attributes_h_ 00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE 00005 #pragma interface 00006 #endif 00007 //: 00008 // \file 00009 // \brief Find summary attributes of an array 00010 // \author J.L. Mundy 00011 // October 5, 2010 00012 // \verbatim 00013 // Modifications 00014 // Oct 7, 2010 - Peter Vanroose - Added the median 00015 // \endverbatim 00016 00017 #include <vbl/vbl_array_1d.h> 00018 #include <vbl/vbl_array_2d.h> 00019 #include <vbl/vbl_array_3d.h> 00020 00021 //: minimum element value 00022 template <class T> 00023 T minval(vbl_array_1d<T> const& in); 00024 //: maximum element value 00025 template <class T> 00026 T maxval(vbl_array_1d<T> const& in); 00027 //: min max bounds 00028 template <class T> 00029 void bounds(vbl_array_1d<T> const& in, T& min, T& max); 00030 //: mean of element values 00031 template <class T> 00032 T mean(vbl_array_1d<T> const& in); 00033 //: median of element values 00034 // Actually, the "left median" is returned: 00035 // it's always a value from the array, which for even-sized arrays is a 00036 // "left-biased" or better said, a "smaller-biased" middle entry from the array. 00037 template <class T> 00038 T median(vbl_array_1d<T> const& in); 00039 00040 //: minimum element value 00041 template <class T> 00042 T minval(vbl_array_2d<T> const& in); 00043 //: maximum element value 00044 template <class T> 00045 T maxval(vbl_array_2d<T> const& in); 00046 //: min max bounds 00047 template <class T> 00048 void bounds(vbl_array_2d<T> const& in, T& min, T& max); 00049 //: mean of element values 00050 template <class T> 00051 T mean(vbl_array_2d<T> const& in); 00052 //: median of element values 00053 // Actually, the "left median" is returned: 00054 // it's always a value from the array, which for even-sized arrays is a 00055 // "left-biased" or better said, a "smaller-biased" middle entry from the array. 00056 template <class T> 00057 T median(vbl_array_2d<T> const& in); 00058 00059 //: minimum element value 00060 template <class T> 00061 T minval(vbl_array_3d<T> const& in); 00062 //: maximum element value 00063 template <class T> 00064 T maxval(vbl_array_3d<T> const& in); 00065 //: min max bounds 00066 template <class T> 00067 void bounds(vbl_array_3d<T> const& in, T& min, T& max); 00068 //: mean of element values 00069 template <class T> 00070 T mean(vbl_array_3d<T> const& in); 00071 //: median of element values 00072 // Actually, the "left median" is returned: 00073 // it's always a value from the array, which for even-sized arrays is a 00074 // "left-biased" or better said, a "smaller-biased" middle entry from the array. 00075 template <class T> 00076 T median(vbl_array_3d<T> const& in); 00077 00078 #endif // vbl_attributes_h_