yat  0.13.2pre
Index.h
1 #ifndef _theplu_yat_utility_index_
2 #define _theplu_yat_utility_index_
3 
4 // $Id: Index.h 2119 2009-12-12 23:11:43Z peter $
5 
6 /*
7  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
8  Copyright (C) 2009 Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #include "SmartPtr.h"
27 
28 #include <vector>
29 
30 namespace theplu {
31 namespace yat {
32 namespace utility {
33 
41  class Index
42  {
43  public:
49  typedef std::vector<size_t>::const_iterator const_iterator;
50 
54  Index(void);
55 
60  explicit Index(size_t n);
61 
65  Index(const Index& a, const Index& b);
66 
70  explicit Index(const SmartPtr<const std::vector<size_t> >& vec);
71 
77  explicit Index(const std::vector<size_t>& vec);
78 
84  const_iterator begin(void) const;
85 
91  const_iterator end(void) const;
92 
96  const size_t& operator[](size_t) const;
97 
101  size_t size(void) const;
102 
106  const std::vector<size_t>& vector(void) const;
107 
108  private:
109  // using compiler generated copy
110  // Index(const Index&);
111  // const Index& operator=(const Index&);
112 
114  };
115 
116 }}} // of namespace utility, yat, and theplu
117 
118 #endif
const size_t & operator[](size_t) const
access operator
size_t size(void) const
number of elements
Class for storing indices of, e.g., a MatrixLookup.
Definition: Index.h:41
const_iterator end(void) const
const std::vector< size_t > & vector(void) const
Definition: SmartPtr.h:48
const_iterator begin(void) const
std::vector< size_t >::const_iterator const_iterator
Definition: Index.h:49

Generated on Wed Jan 4 2017 02:23:07 for yat by  doxygen 1.8.5