Is it possible to get the stride value from a (Sub)Matrix/(Sub)Vector?
Issue #187
resolved
Is it possible to get the value of stride (pointer distance between subsequent rows (for row-major matrices) or columns (for column-major matrices)) for dense matrices and submatrices, accounted for padding? Similarly, is it possible to get the pointer difference between adjacent elements for subvectors? I need to know the strides to interface Blaze objects to a C-code which takes raw pointers.
Comments (4)
-
-
-
assigned issue to
-
assigned issue to
-
- changed status to open
-
- changed status to resolved
The
spacing()
function has been documented in the tutorial and the wiki. The updated tutorial is immediately available via cloning the Blaze repository, the updated wiki will be available with the officially release of Blaze 3.4. - Log in to comment
Hi Mikhail!
For matrices you are looking for the
spacing()
function:Unfortunately this function is missing in the documentation. We will update the tutorial and wiki accordingly. Please excuse this oversight.
In case of subvectors you can safely assume a stride of 1. The only case where this is not true is when you use a subvector on an element selection or a band.
Best regards,
Klaus!