SimpleMath: fixed compile warnings when using debug builds
parent
b19a74dcdf
commit
33f08ff39b
|
@ -819,17 +819,19 @@ struct Storage {
|
||||||
|
|
||||||
inline size_t cols() const { return NumCols; }
|
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
|
// Resizing of fixed size matrices not allowed
|
||||||
#ifndef NDEBUG
|
|
||||||
if (num_rows != NumRows || num_cols != NumCols) {
|
if (num_rows != NumRows || num_cols != NumCols) {
|
||||||
std::cout << "Error: trying to resize fixed matrix from "
|
std::cout << "Error: trying to resize fixed matrix from "
|
||||||
<< NumRows << ", " << NumCols << " to "
|
<< NumRows << ", " << NumCols << " to "
|
||||||
<< num_rows << ", " << num_cols << "." << std::endl;
|
<< num_rows << ", " << num_cols << "." << std::endl;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
assert (num_rows == NumRows && num_cols == NumCols);
|
assert (num_rows == NumRows && num_cols == NumCols);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
inline ScalarType& coeff(int row_index, int col_index) {
|
inline ScalarType& coeff(int row_index, int col_index) {
|
||||||
// assert (row_index >= 0 && row_index <= NumRows);
|
// assert (row_index >= 0 && row_index <= NumRows);
|
||||||
|
|
Loading…
Reference in New Issue