Closed markisus closed 2 years ago
Hi, at the moment there are no matrix norms implemented, but only the infinity norm for vectors.
No you can't access the first m*n doubles in the memory, as the actual matrix storage is implementation-dependent. If you use the column-major matrix format, the matrix is stored one column after the other but there may be some padding after each column for better alignment to memory boundaries. If you use the panel-major matrix format, the layout is more complicated, and something like block-row-major with column-major within each block-row, plus padding again.
My suggestion would be to use the macro BLASFEO_DMATEL(sA, ai, aj)
which gives you access to an element in a matrix structure regardless of its specific implementation, as there is a different version of this macro for each matrix format, see e.g.
https://github.com/giaf/blasfeo/blob/master/include/blasfeo_common.h#L112
https://github.com/giaf/blasfeo/blob/master/include/blasfeo_common.h#L159
In this way you don't have to worry about the specific matrix format, and the macro is also faster than the function call you mentioned.
As a final suggestion, for performance reasons I would suggest to access the matrix by columns, as this would give a good degree of data locality in both panel- and column-major formats.
Very helpful, thank you!
Does blasfeo implement either of the following matrix norms?
If not, I'd like to implement it manually without having to call blasfeo_dgeex1 m * n times. Is it okay to access the first m * n doubles of the blasfeo_dmat.mem directly?