vbl_attributes.h
Go to the documentation of this file.
1 // This is core/vbl/vbl_attributes.h
2 #ifndef vbl_attributes_h_
3 #define vbl_attributes_h_
4 //:
5 // \file
6 // \brief Find summary attributes of an array
7 // \author J.L. Mundy
8 // October 5, 2010
9 // \verbatim
10 // Modifications
11 // Oct 7, 2010 - Peter Vanroose - Added the median
12 // \endverbatim
13 
14 #include <vbl/vbl_array_1d.h>
15 #include <vbl/vbl_array_2d.h>
16 #include <vbl/vbl_array_3d.h>
17 
18 //: minimum element value
19 template <class T>
20 T minval(vbl_array_1d<T> const& in);
21 //: maximum element value
22 template <class T>
23 T maxval(vbl_array_1d<T> const& in);
24 //: min max bounds
25 template <class T>
26 void bounds(vbl_array_1d<T> const& in, T& min, T& max);
27 //: mean of element values
28 template <class T>
29 T mean(vbl_array_1d<T> const& in);
30 //: median of element values
31 // Actually, the "left median" is returned:
32 // it's always a value from the array, which for even-sized arrays is a
33 // "left-biased" or better said, a "smaller-biased" middle entry from the array.
34 template <class T>
35 T median(vbl_array_1d<T> const& in);
36 
37 //: minimum element value
38 template <class T>
39 T minval(vbl_array_2d<T> const& in);
40 //: maximum element value
41 template <class T>
42 T maxval(vbl_array_2d<T> const& in);
43 //: min max bounds
44 template <class T>
45 void bounds(vbl_array_2d<T> const& in, T& min, T& max);
46 //: mean of element values
47 template <class T>
48 T mean(vbl_array_2d<T> const& in);
49 //: median of element values
50 // Actually, the "left median" is returned:
51 // it's always a value from the array, which for even-sized arrays is a
52 // "left-biased" or better said, a "smaller-biased" middle entry from the array.
53 template <class T>
54 T median(vbl_array_2d<T> const& in);
55 
56 //: minimum element value
57 template <class T>
58 T minval(vbl_array_3d<T> const& in);
59 //: maximum element value
60 template <class T>
61 T maxval(vbl_array_3d<T> const& in);
62 //: min max bounds
63 template <class T>
64 void bounds(vbl_array_3d<T> const& in, T& min, T& max);
65 //: mean of element values
66 template <class T>
67 T mean(vbl_array_3d<T> const& in);
68 //: median of element values
69 // Actually, the "left median" is returned:
70 // it's always a value from the array, which for even-sized arrays is a
71 // "left-biased" or better said, a "smaller-biased" middle entry from the array.
72 template <class T>
73 T median(vbl_array_3d<T> const& in);
74 
75 #endif // vbl_attributes_h_
simple 2D array.
Definition: vbl_array_2d.h:25
A simple container.
Definition: vbl_array_1d.h:28
Contains class for templated 3d array.
Templated 3-dimensional array.
Definition: vbl_array_3d.h:38
A simple container.
T mean(vbl_array_1d< T > const &in)
mean of element values.
T minval(vbl_array_1d< T > const &in)
minimum element value.
T maxval(vbl_array_1d< T > const &in)
maximum element value.
T median(vbl_array_1d< T > const &in)
median of element values.
void bounds(vbl_array_1d< T > const &in, T &min, T &max)
min max bounds.
Contains class for a templated 2d array.