7 /** Common utility functions. */
10 /** The square of the value. */
17 /** Median of the values in a vector.
18 * \note For odd number (2n + 1) of values, the n'th value is returned.
22 median(std::vector
<T
> v
)
24 std::sort(v
.begin(), v
.end());
25 return v
[v
.size() / 2];
28 /** Absolute value. */
38 /** Maximum of two values. */
41 max(const T
&a
, const T
&b
)