static constexpr spacing() function unavailable for LowerMatrix

Issue #454 open
Mikhail Katliar created an issue

Consider the following code:

#include <blaze/Math.h>

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

    using M = LowerMatrix<StaticMatrix<double, 5, 5>>;
    auto constexpr s = M::spacing();

    return 0;
}

The following compilation error is produced:

test.cpp:8:27: error: call to non-static member function without an object argument
    auto constexpr s = M::spacing();
                       ~~~^~~~~~~

The above code used to work with an older version of Blaze. It also works if LowerMatrix<StaticMatrix<double, 5, 5>> is replaced by StaticMatrix<double, 5, 5>.

Comments (6)

  1. Klaus Iglberger

    Hi Mikhail!

    Thanks for pointing out this omission in the adapter classes. You are correct, adapters on a StaticMatrix should provide a constexpr spacing() function. We will upgrade the adapters as quickly as possible.

    Best regards,

    Klaus!

  2. Klaus Iglberger

    Commit cb472ee declares the rows(), columns(), spacing() and capacity() functions of all adapters as constexpr. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9.

  3. Mikhail Katliar reporter

    Hello Klaus!

    Is there any reason why you did not make the spacing() function static for statically-sized matrix types? The auto constexpr s = M::spacing(); expression still does not compile. I can work around it, but it would be nice to be able to get compile-time constant spacing value from the type.

  4. Log in to comment