data() of column-major matrix row subvector is incorrect

Issue #457 resolved
Mikhail Katliar created an issue

Test:

#include <blaze/Math.h>

#include <iostream>

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

    StaticMatrix<double, 5, 5, columnMajor> A;
    auto r = subvector(row(A, 1), 2, 1);

    std::cout << &A(1, 2) << std::endl;
    std::cout << r.data() << std::endl;

    return 0;
}

Output:

0x7ffccf2b6e48
0x7ffccf2b6df8

I would expect subvector(row(A, i), j, n).data() == &A(i, j) regardless of the matrix storage order.

Comments (7)

  1. Klaus Iglberger

    Hi Mikhail!

    Thanks for reporting this defect. You are correct, despite the fact that the data function can only return the address of the first element of the subvector, it should still return the correct address. We’ll fix the issue as quickly as possible. Thanks again,

    Best regards,

    Klaus!

  2. Klaus Iglberger

    Commit f4de29a fixes the data() member functions of the Subvector view. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9.

  3. Log in to comment