diff options
author | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2015-04-17 11:36:21 +0200 |
---|---|---|
committer | Christoph Hertzberg <chtz@informatik.uni-bremen.de> | 2015-04-17 11:36:21 +0200 |
commit | 4f126b862da5f8c9d3d901385440d0a79df3ed4f (patch) | |
tree | df7a8b0831f545e24f168e1309b4acacca94eced /Eigen/src/Core/DenseStorage.h | |
parent | da5b98a94d2a3a5a4963262fc1b33d75633b3b83 (diff) |
Add internal assertions to purely fixed-size DenseStorage, mark optional variables always as unused
Diffstat (limited to 'Eigen/src/Core/DenseStorage.h')
-rw-r--r-- | Eigen/src/Core/DenseStorage.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Eigen/src/Core/DenseStorage.h b/Eigen/src/Core/DenseStorage.h index 37759a585..f72ba2c66 100644 --- a/Eigen/src/Core/DenseStorage.h +++ b/Eigen/src/Core/DenseStorage.h @@ -218,7 +218,13 @@ template<typename T, int Size, int _Rows, int _Cols, int _Options> class DenseSt if (this != &other) m_data = other.m_data; return *this; } - EIGEN_DEVICE_FUNC DenseStorage(Index,Index,Index) {} + EIGEN_DEVICE_FUNC DenseStorage(Index size, Index nbRows, Index nbCols) { + EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN + eigen_internal_assert(size==nbRows*nbCols && nbRows==_Rows && nbCols==_Cols); + EIGEN_UNUSED_VARIABLE(size); + EIGEN_UNUSED_VARIABLE(nbRows); + EIGEN_UNUSED_VARIABLE(nbCols); + } EIGEN_DEVICE_FUNC void swap(DenseStorage& other) { std::swap(m_data,other.m_data); } EIGEN_DEVICE_FUNC static Index rows(void) {return _Rows;} EIGEN_DEVICE_FUNC static Index cols(void) {return _Cols;} @@ -361,8 +367,6 @@ template<typename T, int _Options> class DenseStorage<T, Dynamic, Dynamic, Dynam { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN eigen_internal_assert(size==nbRows*nbCols && nbRows>=0 && nbCols >=0); - EIGEN_ONLY_USED_FOR_DEBUG(nbRows); - EIGEN_ONLY_USED_FOR_DEBUG(nbCols); } DenseStorage(const DenseStorage& other) : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(other.m_rows*other.m_cols)) @@ -442,7 +446,7 @@ template<typename T, int _Rows, int _Options> class DenseStorage<T, Dynamic, _Ro { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN eigen_internal_assert(size==nbRows*nbCols && nbRows==_Rows && nbCols >=0); - EIGEN_ONLY_USED_FOR_DEBUG(nbRows); + EIGEN_UNUSED_VARIABLE(nbRows); } DenseStorage(const DenseStorage& other) : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(_Rows*other.m_cols)) @@ -515,7 +519,7 @@ template<typename T, int _Cols, int _Options> class DenseStorage<T, Dynamic, Dyn { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN eigen_internal_assert(size==nbRows*nbCols && nbRows>=0 && nbCols == _Cols); - EIGEN_ONLY_USED_FOR_DEBUG(nbCols); + EIGEN_UNUSED_VARIABLE(nbCols); } DenseStorage(const DenseStorage& other) : m_data(internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(other.m_rows*_Cols)) |