dune-istl 3.0-git
combinedfunctor.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_AMG_COMBINEDFUNCTOR_HH
4#define DUNE_AMG_COMBINEDFUNCTOR_HH
5
6#include <dune/common/tuples.hh>
7namespace Dune
8{
9 namespace Amg
10 {
11
12 template<std::size_t i>
14 {
15 template<class TT, class T>
16 static void apply(TT tuple, const T& t)
17 {
18 get<i-1>(tuple) (t);
20 }
21 };
22 template<>
23 struct ApplyHelper<0>
24 {
25 template<class TT, class T>
26 static void apply(TT tuple, const T& t)
27 {
30 }
31 };
32
33 template<typename T>
35 public T
36 {
37 public:
38 CombinedFunctor(const T& tuple)
39 : T(tuple)
40 {}
41
42 template<class T1>
43 void operator()(const T1& t)
44 {
45 ApplyHelper<tuple_size<T>::value>::apply(*this, t);
46 }
47 };
48
49
50 } //namespace Amg
51} // namespace Dune
52#endif
Definition basearray.hh:19
PropertyMapTypeSelector< Amg::VertexVisitedTag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > >::Type get(const Amg::VertexVisitedTag &tag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > &graph)
Definition dependency.hh:292
Statistics about compression achieved in implicit mode.
Definition bcrsmatrix.hh:81
Definition combinedfunctor.hh:14
static void apply(TT tuple, const T &t)
Definition combinedfunctor.hh:16
static void apply(TT tuple, const T &t)
Definition combinedfunctor.hh:26
Definition combinedfunctor.hh:36
CombinedFunctor(const T &tuple)
Definition combinedfunctor.hh:38
void operator()(const T1 &t)
Definition combinedfunctor.hh:43