SimpleMath: fixed compile warnings when using debug builds

master
Martin Felis 2021-11-16 14:18:08 +01:00
parent b19a74dcdf
commit 33f08ff39b
1 changed files with 5 additions and 3 deletions

View File

@ -819,17 +819,19 @@ struct Storage {
inline size_t cols() const { return NumCols; }
void resize(int UNUSED(num_rows), int UNUSED(num_cols)) {
#ifdef NDEBUG
void resize(int UNUSED(num_rows), int UNUSED(num_cols)) {}
#else
void resize(int num_rows, int num_cols) {
// Resizing of fixed size matrices not allowed
#ifndef NDEBUG
if (num_rows != NumRows || num_cols != NumCols) {
std::cout << "Error: trying to resize fixed matrix from "
<< NumRows << ", " << NumCols << " to "
<< num_rows << ", " << num_cols << "." << std::endl;
}
#endif
assert (num_rows == NumRows && num_cols == NumCols);
}
#endif
inline ScalarType& coeff(int row_index, int col_index) {
// assert (row_index >= 0 && row_index <= NumRows);