Cannot assign to BDMatrix and then change its size
Assignment to a BDMatrix currently works by calling operator= from the base class BCRSMatrix. As part of that BCRSMatrix::copyWindowStructure is called, which sets the build mode to row_wise. As a consequence, the matrix cannot be resized anymore afterwards, because that only works for matrices with random build mode. A test and one potential fix for this are given in !299 (closed) .
However, I am unsure about the fix. The offending line is bcrsmatrix.hh:2088:
build_mode = row_wise; // dummy
That looks dubious, and apparently the line dates back to 2004. But what is the proper fix? Simply leave the build mode unchanged? Or change it to the build mode of the matrix we are copying from? Both ways seem to be okay as far as the dune-istl unit tests go.