1 /*
2  [auto_generated]
3  boost/numeric/odeint/algebra/detail/norm_inf.hpp
4 
5  [begin_description]
6  Default reduce implementation.
7  [end_description]
8 
9  Copyright 2013 Karsten Ahnert
10  Copyright 2013 Mario Mulansky
11 
12  Distributed under the Boost Software License, Version 1.0.
13  (See accompanying file LICENSE_1_0.txt or
14  copy at http://www.boost.org/LICENSE_1_0.txt)
15  */
16 
17 
18 #ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED
19 #define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED
20 
21 #include <cmath>
22 
23 namespace boost {
24 namespace numeric {
25 namespace odeint {
26 namespace detail {
27 
28 template< typename Value , class Iterator1 >
norm_inf(Iterator1 first1,Iterator1 last1,Value init)29 inline Value norm_inf( Iterator1 first1 , Iterator1 last1 , Value init )
30 {
31     using std::max;
32     using std::abs;
33     for( ; first1 != last1 ; )
34         init = max( init , abs( *first1++ ) );
35     return init;
36 }
37 
38 
39 } // detail
40 } // odeint
41 } // numeric
42 } // boost
43 
44 
45 #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED
46