Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_mpl_for_each.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef STOKHOS_MPL_FOR_EACH_HPP
11 #define STOKHOS_MPL_FOR_EACH_HPP
12 
13 #include "Sacado_mpl_begin.hpp"
14 #include "Sacado_mpl_end.hpp"
15 #include "Sacado_mpl_next.hpp"
16 #include "Sacado_mpl_deref.hpp"
17 
18 #include "Kokkos_Macros.hpp"
19 
20 namespace Stokhos {
21 
22  namespace mpl {
23 
24  template <class Seq,
25  class Iter1 = typename Sacado::mpl::begin<Seq>::type,
26  class Iter2 = typename Sacado::mpl::end<Seq>::type>
27  struct for_each {
28  template <typename Op>
29  KOKKOS_INLINE_FUNCTION
30  for_each(const Op& op) {
31  op(typename Sacado::mpl::deref<Iter1>::type());
33  }
34  };
35 
36  template <class Seq, class Iter1>
37  struct for_each<Seq, Iter1, Iter1> {
38  template <typename Op>
39  KOKKOS_INLINE_FUNCTION
40  for_each(const Op& op) {}
41  };
42 
43  }
44 
45 }
46 
47 #endif // STOKHOS_MPL_FOR_EACH_HPP
KOKKOS_INLINE_FUNCTION for_each(const Op &op)
KOKKOS_INLINE_FUNCTION for_each(const Op &op)
ScalarType f(const Teuchos::Array< ScalarType > &x, double a, double b)