norm_inf.hpp 990 B

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