#include #define MAT_ELEM(rows,cols,r,c) (r*cols+c) //Improve performance by assuming output matrices do not overlap with //input matrices. If this is C++, use the __restrict extension instead #ifdef __cplusplus typedef double * const __restrict MAT_OUT_t; #else typedef double * const restrict MAT_OUT_t; #endif typedef const double * const MAT_IN_t; static inline void mat_mult( const int m, const int n, const int p, MAT_IN_t a, MAT_IN_t b, MAT_OUT_t c) { for (int row=0; row