BLASFEO API

The BLASFEO API in BLASFEO is always exported.

The BLASFEO API defines C structures for matrices and vectors. These structures are used to abstract from the actual memory layout of matrices and vectors.
As an example, in case the LA backend is given by the High-Performance version, the matrices are stored in a cache-optimized format, called panel-major matrix format.
Packing and unpacking routines are provided to convert to/from column/row-major matrix format and the BLASFEO matrix structure (similarly for vectors).

All BLASFEO linear algebra routines operate on the matrix (blasfeo_dmat and blasfeo_smat) and vector (blasfeo_dmat and blasfeo_smat) structures.

BLASFEO routine API can be obtained from standard BLAS and LAPACK API using the following rules:

As an example, standard BLAS API of the routine dgemv

void dgemv_(char *ta, int *n, int *m, double *alpha, double *a, int *lda, double *x, int *incx, double *beta, double *y, int *incy);

translates in the BLASFEO API routines

void blasfeo_dgemv_n(int n, int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi);

or

void blasfeo_dgemv_t(int n, int m, double alpha, struct blasfeo_dmat *sA, int ai, int aj, struct blasfeo_dvec *sx, int xi, double beta, struct blasfeo_dvec *sy, int yi, struct blasfeo_dvec *sz, int zi);

depending on the value of ta.