static constexpr spacing() function unavailable for LowerMatrix
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)
-
-
-
assigned issue to
-
assigned issue to
-
- changed status to open
-
- changed status to resolved
Commit cb472ee declares the
rows()
,columns()
,spacing()
andcapacity()
functions of all adapters asconstexpr
. The fix is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.9. -
reporter - changed status to open
-
reporter Hello Klaus!
Is there any reason why you did not make the
spacing()
function static for statically-sized matrix types? Theauto 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. - Log in to comment
Hi Mikhail!
Thanks for pointing out this omission in the adapter classes. You are correct, adapters on a
StaticMatrix
should provide aconstexpr
spacing()
function. We will upgrade the adapters as quickly as possible.Best regards,
Klaus!