queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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-2017 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
void setLocation(unsigned int i, unsigned int j, T *info)
Sets the data in a specific location.
unsigned int numCols() const
Number of columns in the array.
unsigned int numRows() const
Number of rows in the array.
~TwoDArray()
Destructor.
unsigned int m_numRows
TwoDArray(unsigned int numRows, unsigned int numCols)
Default constructor.
std::vector< std::vector< T * > * > m_data
T & operator()(unsigned int i, unsigned int j)
Returns data stored in a specific location (non-const).
unsigned int m_numCols
Class for handling arrays of generic data.

Generated on Tue Jun 5 2018 19:48:55 for queso-0.57.1 by  doxygen 1.8.5