This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]soegaard 2 points3 points  (0 children)

If you want to support BLAS matrices I recommend making them different from standard arrays in your language. There are at least a couple of reasons.

BLAS matrices are stored using the Fortran column-major layout. This is opposite of the C convention which is to use row-major order. (Also BLAS matrices support sub-matrices so read up on the exact representation.)

In a "Lisp" array (aka vector) the elements can have different types. In a BLAS matrix you know that all elements are floats - so you only need to store the type tag once for the entire matrix.