From 4f126b862da5f8c9d3d901385440d0a79df3ed4f Mon Sep 17 00:00:00 2001 From: Christoph Hertzberg Date: Fri, 17 Apr 2015 11:36:21 +0200 Subject: Add internal assertions to purely fixed-size DenseStorage, mark optional variables always as unused --- Eigen/src/Core/DenseStorage.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'Eigen/src/Core/DenseStorage.h') 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 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 class DenseStorage=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(other.m_rows*other.m_cols)) @@ -442,7 +446,7 @@ template class DenseStorage=0); - EIGEN_ONLY_USED_FOR_DEBUG(nbRows); + EIGEN_UNUSED_VARIABLE(nbRows); } DenseStorage(const DenseStorage& other) : m_data(internal::conditional_aligned_new_auto(_Rows*other.m_cols)) @@ -515,7 +519,7 @@ template class DenseStorage=0 && nbCols == _Cols); - EIGEN_ONLY_USED_FOR_DEBUG(nbCols); + EIGEN_UNUSED_VARIABLE(nbCols); } DenseStorage(const DenseStorage& other) : m_data(internal::conditional_aligned_new_auto(other.m_rows*_Cols)) -- cgit v1.2.3