stlab.adobe.com Adobe Systems Incorporated
median.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2005-2008 Adobe Systems Incorporated
3  Distributed under the MIT License (see accompanying file LICENSE_1_0_0.txt
4  or a copy at http://stlab.adobe.com/licenses.html)
5 */
6 /**************************************************************************************************/
7 
8 #ifndef ADOBE_ALGORITHM_MEDIAN_HPP
9 #define ADOBE_ALGORITHM_MEDIAN_HPP
10 
12 #include <adobe/functional.hpp>
13 
14 namespace adobe {
15 
16 /**************************************************************************************************/
32 /**************************************************************************************************/
33 
38 template <typename T, typename R>
39 inline const T& median(const T& a, const T& b, const T& c, R r)
40 { return select_1(a, b, c, r); }
41 
46 template <typename T, typename R>
47 inline T& median(T& a, T& b, T& c, R r)
48 { return select_1(a, b, c, r); }
49 
54 template <typename T>
55 inline const T& median(const T& a, const T& b, const T& c)
56 { return select_1(a, b, c, adobe::less()); }
57 
62 template <typename T>
63 inline T& median(T& a, T& b, T& c)
64 { return select_1(a, b, c, adobe::less()); }
65 
66 /**************************************************************************************************/
67 
68 } // namespace adobe
69 #endif
const T & median(const T &a, const T &b, const T &c, R r)
median implementation
Definition: median.hpp:39
const T & select_1(const T &a, const T &b, const T &c, R r)
select_1 implementation

Copyright © 2006-2007 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google