Skip to content

Transposetest fails when boundschecking is enabled

With the updated CI job debian:12 gcc-12-20 (with checking) the pipeline fails in the transposetest due to a "Index out of bounds" error. Actually, it should be pronounced "incompatible size" error, since it happens in the dense-matrix assigner specialization of the DiagonalMatrix.

Pricise error message (and backtrace):

Dune::RangeError [apply:/opt/sources/dune/dune-common/dune/common/diagonalmatrix.hh:1110]: Index out of bounds.

#9  in Dune::DenseMatrixAssigner<Dune::FieldMatrix<double, 7, 4>, Dune::DiagonalMatrix<double, 4> >::apply (denseMatrix=..., rhs=...)
    at dune-common/dune/common/diagonalmatrix.hh:1110
#10 in Dune::DenseMatrix<Dune::FieldMatrix<double, 7, 4> >::operator=<Dune::DiagonalMatrix<double, 4>, void> (this=0x7fffffffb7d0, rhs=...)
    at dune-common/dune/common/densematrix.hh:281
#11 in Dune::FieldMatrix<double, 7, 4>::FieldMatrix<Dune::DiagonalMatrix<double, 4>, void> (this=0x7fffffffb7d0, rhs=...)
    at dune-common/dune/common/fmatrix.hh:150
#12 in checkAxBT<Dune::DiagonalMatrix<double, 4>, Dune::FieldMatrix<double, 7, 4>, Dune::Impl::TransposedMatrixWrapper<std::__1::reference_wrapper<Dune::FieldMatrix<double, 7, 4> > > > (a=..., b=..., bt=...) at dune-common/dune/common/test/transposetest.cc:62
#13 in checkTransposeProduct<Dune::DiagonalMatrix<double, 4>, Dune::FieldMatrix<double, 7, 4> > (suite=..., a=..., b_original=...)
    at dune-common/dune/common/test/transposetest.cc:108
#14 in main () at dune-common/dune/common/test/transposetest.cc:270

This error happens in the matrix-matrix product auto abt = a * bt; inside

DiagonalMatrix<double, 4> * TransposedMatrixWrapper<FieldMatrix<double, 7, 4>>

It seems that an overload of the operator* is wrongly selected, but I am not sure.

Edited by Simon Praetorius