Skip to content
Snippets Groups Projects
Commit df57a51d authored by Simon Praetorius's avatar Simon Praetorius
Browse files

Enclose the bounds check in DUNE_CHECK_BOUNDS conditional

parent 10afff15
No related branches found
No related tags found
1 merge request!1480Improve the error message in the DenseMatrixAssigner for DiagonalMatrix
Pipeline #75395 failed
......@@ -1106,8 +1106,10 @@ namespace Dune {
struct DenseMatrixAssigner<DenseMatrix, DiagonalMatrix<field, N>> {
static void apply(DenseMatrix& denseMatrix,
DiagonalMatrix<field, N> const& rhs) {
#ifdef DUNE_CHECK_BOUNDS
if (denseMatrix.M() != N || denseMatrix.N() != N)
DUNE_THROW(Dune::RangeError, "Incompatible matrix dimensions in assignment.");
#endif // DUNE_CHECK_BOUNDS
denseMatrix = field(0);
for (int i = 0; i < N; ++i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment