queso-0.53.0
2dArrayOfStuff.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_2D_ARRAY_OF_STUFF_H
26 #define UQ_2D_ARRAY_OF_STUFF_H
27 
28 namespace QUESO {
29 
38 template <class T>
39 class TwoDArray
40 {
41 public:
43 
44  TwoDArray(unsigned int numRows, unsigned int numCols);
46 
48  ~TwoDArray();
50 
52 
53  unsigned int numRows () const;
55 
57  unsigned int numCols () const;
58 
60 
62  void setLocation(unsigned int i, unsigned int j, T* info);
64 
66 
67 
70  T& operator ()(unsigned int i, unsigned int j);
71 
73 
75  const T& operator ()(unsigned int i, unsigned int j) const;
77 private:
78  unsigned int m_numRows;
79  unsigned int m_numCols;
80 
81  std::vector<std::vector<T*>* > m_data;
82 };
83 
84 } // End namespace QUESO
85 
86 #endif // UQ_2D_ARRAY_OF_STUFF_H
Class for handling arrays of generic data.
~TwoDArray()
Destructor.
TwoDArray(unsigned int numRows, unsigned int numCols)
Default constructor.
unsigned int m_numRows
unsigned int numCols() const
Number of columns in the array.
std::vector< std::vector< T * > * > m_data
unsigned int m_numCols
T & operator()(unsigned int i, unsigned int j)
Returns data stored in a specific location (non-const).
void setLocation(unsigned int i, unsigned int j, T *info)
Sets the data in a specific location.
unsigned int numRows() const
Number of rows in the array.

Generated on Thu Jun 11 2015 13:52:32 for queso-0.53.0 by  doxygen 1.8.5