99
1010#include " boost/multi_array.hpp"
1111#include " odb/dbStream.h"
12- #include " odb/odb.h"
1312
1413namespace odb {
1514
@@ -18,17 +17,17 @@ class dbMatrix
1817{
1918 public:
2019 dbMatrix () = default ;
21- dbMatrix (uint n, uint m);
20+ dbMatrix (int n, int m);
2221
23- uint numRows () const { return matrix_.shape ()[0 ]; }
24- uint numCols () const { return matrix_.shape ()[1 ]; }
25- uint numElems () const ;
22+ int numRows () const { return matrix_.shape ()[0 ]; }
23+ int numCols () const { return matrix_.shape ()[1 ]; }
24+ int numElems () const ;
2625
27- void resize (uint n, uint m);
26+ void resize (int n, int m);
2827 void clear ();
2928
30- const T& operator ()(uint i, uint j) const ;
31- T& operator ()(uint i, uint j);
29+ const T& operator ()(int i, int j) const ;
30+ T& operator ()(int i, int j);
3231
3332 dbMatrix<T>& operator =(const dbMatrix<T>& rhs);
3433
@@ -45,8 +44,8 @@ inline dbOStream& operator<<(dbOStream& stream, const dbMatrix<T>& mat)
4544 stream << mat.numRows ();
4645 stream << mat.numCols ();
4746
48- for (uint i = 0 ; i < mat.numRows (); ++i) {
49- for (uint j = 0 ; j < mat.numCols (); ++j) {
47+ for (int i = 0 ; i < mat.numRows (); ++i) {
48+ for (int j = 0 ; j < mat.numCols (); ++j) {
5049 stream << mat (i, j);
5150 }
5251 }
@@ -57,15 +56,15 @@ inline dbOStream& operator<<(dbOStream& stream, const dbMatrix<T>& mat)
5756template <class T >
5857inline dbIStream& operator >>(dbIStream& stream, dbMatrix<T>& mat)
5958{
60- uint n;
61- uint m;
59+ int n;
60+ int m;
6261
6362 stream >> n;
6463 stream >> m;
6564 mat.resize (n, m);
6665
67- for (uint i = 0 ; i < mat.numRows (); ++i) {
68- for (uint j = 0 ; j < mat.numCols (); ++j) {
66+ for (int i = 0 ; i < mat.numRows (); ++i) {
67+ for (int j = 0 ; j < mat.numCols (); ++j) {
6968 stream >> mat (i, j);
7069 }
7170 }
@@ -74,7 +73,7 @@ inline dbIStream& operator>>(dbIStream& stream, dbMatrix<T>& mat)
7473}
7574
7675template <class T >
77- inline dbMatrix<T>::dbMatrix(uint n, uint m)
76+ inline dbMatrix<T>::dbMatrix(int n, int m)
7877{
7978 resize (n, m);
8079}
@@ -86,25 +85,25 @@ inline void dbMatrix<T>::clear()
8685}
8786
8887template <class T >
89- inline uint dbMatrix<T>::numElems() const
88+ inline int dbMatrix<T>::numElems() const
9089{
9190 return matrix_.num_elements ();
9291}
9392
9493template <class T >
95- inline void dbMatrix<T>::resize(uint n, uint m)
94+ inline void dbMatrix<T>::resize(int n, int m)
9695{
9796 matrix_.resize (boost::extents[n][m]);
9897}
9998
10099template <class T >
101- inline const T& dbMatrix<T>::operator ()(uint i, uint j) const
100+ inline const T& dbMatrix<T>::operator ()(int i, int j) const
102101{
103102 return matrix_[i][j];
104103}
105104
106105template <class T >
107- inline T& dbMatrix<T>::operator ()(uint i, uint j)
106+ inline T& dbMatrix<T>::operator ()(int i, int j)
108107{
109108 return matrix_[i][j];
110109}
0 commit comments