Problem compiling assignment of symmetric submatrices

Issue #453 resolved
Mikhail Katliar created an issue

Consider the following code:

#include <blaze/Math.h>
#include <blaze/math/dense/DynamicMatrix.h>


int main(int, char **)
{
    using namespace blaze;

    SymmetricMatrix<StaticMatrix<double, 5, 5>> A;
    SymmetricMatrix<DynamicMatrix<double>> B {5};

    randomize(B);
    submatrix<0, 0, 3, 3>(A) = submatrix(B, 0, 0, 3, 3);

    return 0;
}

Compiling it produces the following error:

$ clang++ test.cpp
In file included from test.cpp:1:
In file included from /usr/local/include/blaze/Math.h:46:
In file included from /usr/local/include/blaze/math/Band.h:50:
In file included from /usr/local/include/blaze/math/views/Band.h:54:
/usr/local/include/blaze/math/expressions/Matrix.h:1226:4: error: static assertion failed due to requirement '!::blaze::IsSymmetric_v<blaze::Submatrix<blaze::SymmetricMatrix<blaze::StaticMatrix<double, 5, 5, false, blaze::aligned, blaze::padded, blaze::GroupTag<0>>, false, true, true>, blaze::unaligned, false, true, 0, 0, 3, 3>>': Symmetric matrix type detected
   BLAZE_CONSTRAINT_MUST_NOT_BE_SYMMETRIC_MATRIX_TYPE( MT1 );
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The code used to compile with an earlier version of Blaze.

Comments (4)

  1. Klaus Iglberger

    Hi Mikhail!

    Thanks for the minimum example to demonstrate this defect. You are correct, this code should flawlessly compile. Apparently the handling of symmetric submatrices is working perfectly. We’ll fix the issue as quickly as possible.

    Best regards,

    Klaus!

  2. Klaus Iglberger

    Commit 6d993b1 fixes the (compound) assignment to symmetric submatrices. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9.

  3. Log in to comment