dune-pdelab  2.0.0
simpledofindex.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_PDELAB_COMMON_SIMPLEDOFINDEX_HH
4 #define DUNE_PDELAB_COMMON_SIMPLEDOFINDEX_HH
5 
6 #include <dune/common/fvector.hh>
7 #include <dune/common/hash.hh>
8 
9 namespace Dune {
10  namespace PDELab {
11 
12 
13  template<typename F>
15  : public FieldVector<F,1>
16  {
17 
19  {}
20 
21  SimpleDOFIndex(const F& v)
22  : FieldVector<F,1>(v)
23  {}
24 
25  F& back()
26  {
27  return (*this)[0];
28  }
29 
30  const F& back() const
31  {
32  return (*this)[0];
33  }
34 
35  };
36 
37 
38  template<typename F>
40  : public FieldVector<F,1>
41  {
42 
44  {}
45 
47  : FieldVector<F,1>(v)
48  {}
49 
50  F& back()
51  {
52  return (*this)[0];
53  }
54 
55  const F& back() const
56  {
57  return (*this)[0];
58  }
59 
60  };
61 
62  template<typename F>
63  inline std::size_t hash_value(const SimpleDOFIndex<F>& di)
64  {
65  return di.back();
66  }
67 
68  } // namespace PDELab
69 } // namespace Dune
70 
71 DUNE_DEFINE_HASH(DUNE_HASH_TEMPLATE_ARGS(typename F),DUNE_HASH_TYPE(Dune::PDELab::SimpleDOFIndex<F>))
72 
73 
74 #endif // DUNE_PDELAB_COMMON_SIMPLEDOFINDEX_HH
const F & back() const
Definition: simpledofindex.hh:30
SimpleContainerIndex(const F &v)
Definition: simpledofindex.hh:46
Definition: simpledofindex.hh:39
const F & back() const
Definition: simpledofindex.hh:55
SimpleDOFIndex(const F &v)
Definition: simpledofindex.hh:21
SimpleDOFIndex()
Definition: simpledofindex.hh:18
F & back()
Definition: simpledofindex.hh:50
SimpleContainerIndex()
Definition: simpledofindex.hh:43
F & back()
Definition: simpledofindex.hh:25
Definition: simpledofindex.hh:14
std::size_t hash_value(const DOFIndex< T, n1, n2 > &di)
Definition: dofindex.hh:196