Is there any library or routine for high-performance matrix-matrix product, where the matrix elements are computed on-the-fly using a given function of $i$ and $j$?
More specifically, in the problem I am currently facing, I have to compute a matrix-matrix product
$$ \mathbf{y} = \mathbf{A} \mathbf{b} $$
where $\mathbf{A}$ is a symmetric matrix $N \times N$, $\mathbf{y}$ and $\mathbf{b}$ are $N\times 3$.
Using LAPACK or BLAS routines requires the formation of the matrix $\mathbf{A}$. The matrix elements, however, are a function that depends only on the matrix indices $i,j$.