1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013 Kyle Lutz <kyle.r.lutz@gmail.com>
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
11 #ifndef BOOST_COMPUTE_EXPERIMENTAL_CLAMP_RANGE_HPP
12 #define BOOST_COMPUTE_EXPERIMENTAL_CLAMP_RANGE_HPP
16 #include <boost/compute/lambda.hpp>
17 #include <boost/compute/algorithm/transform.hpp>
21 namespace experimental {
23 template<class InputIterator, class OutputIterator>
25 clamp_range(InputIterator first,
27 OutputIterator result,
28 typename std::iterator_traits<InputIterator>::value_type lo,
29 typename std::iterator_traits<InputIterator>::value_type hi,
32 using ::boost::compute::lambda::_1;
33 using ::boost::compute::lambda::_2;
34 using ::boost::compute::lambda::clamp;
36 return ::boost::compute::transform(
45 } // end experimental namespace
46 } // end compute namespace
47 } // end boost namespace
49 #endif // BOOST_COMPUTE_EXPERIMENTAL_CLAMP_RANGE_HPP