nt2_norm_inf.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. //==============================================================================
  2. // Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI
  3. // Copyright 2014 NumScale SAS
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // See accompanying file LICENSE.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt
  8. //==============================================================================
  9. #ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED
  10. #define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED
  11. #include <nt2/core/container/table/table.hpp>
  12. #include <nt2/include/functions/globalmax.hpp>
  13. #include <nt2/include/functions/abs.hpp>
  14. #include <boost/numeric/odeint/algebra/vector_space_algebra.hpp>
  15. namespace boost { namespace numeric { namespace odeint
  16. {
  17. template<typename T, typename S>
  18. struct vector_space_norm_inf<nt2::container::table<T,S> >
  19. {
  20. typedef T result_type;
  21. result_type operator()(const nt2::container::table<T,S> &v1) const
  22. {
  23. return nt2::globalmax(nt2::abs(v1));
  24. }
  25. };
  26. } } }
  27. #endif