norm_inf.hpp 969 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. namespace boost {
  17. namespace numeric {
  18. namespace odeint {
  19. namespace detail {
  20. template< typename Value , class Iterator1 >
  21. inline Value norm_inf( Iterator1 first1 , Iterator1 last1 , Value init )
  22. {
  23. using std::max;
  24. using std::abs;
  25. for( ; first1 != last1 ; )
  26. init = max( init , abs( *first1++ ) );
  27. return init;
  28. }
  29. } // detail
  30. } // odeint
  31. } // numeric
  32. } // boost
  33. #endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED