source: src/base/tuple.hpp@ 894a5f

Last change on this file since 894a5f was 894a5f, checked in by Julian Iseringhausen <isering@…>, 14 years ago

Parallel performance update.

git-svn-id: https://svn.version.fz-juelich.de/scafacos/trunk@1314 5161e1c8-67bf-11de-9fd5-51895aff932f

  • Property mode set to 100644
File size: 941 bytes
Line 
1/**
2 * @file tuple.hpp
3 * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
4 * @date Wed May 18 16:48:46 2011
5 *
6 * @brief Templated class for storing tuples.
7 *
8 */
9
10#ifndef TUPLE_HPP_
11#define TUPLE_HPP_
12
13namespace VMG
14{
15
16template<class T>
17class Tuple
18{
19public:
20 T& Left() {return left;}
21 T& Right() {return right;}
22
23 const T& Left() const {return left;}
24 const T& Right() const {return right;}
25
26private:
27 T left, right;
28};
29
30template <class T>
31class Tuple3
32{
33public:
34 Tuple<T>& operator[](const int& index) {return tuples[index];}
35 Tuple<T>& X() {return tuples[0];}
36 Tuple<T>& Y() {return tuples[1];}
37 Tuple<T>& Z() {return tuples[2];}
38
39 const Tuple<T>& operator[](const int& index) const {return tuples[index];}
40 const Tuple<T>& X() const {return tuples[0];}
41 const Tuple<T>& Y() const {return tuples[1];}
42 const Tuple<T>& Z() const {return tuples[2];}
43
44private:
45 Tuple<T> tuples[3];
46};
47
48}
49
50#endif /* TUPLE_HPP_ */
Note: See TracBrowser for help on using the repository browser.