Artificial intelligent assistant

Network energy function matrix representation The question seems very simple, however I`m trying to find the right blas-function which correctly describes the following expression: $\sum_{i=1}^{N}\sum_{j=1}^{N}{w_{ij}x_ix_j}$ Is it `_ssymv` and `_sdsdot` combination? Thanks for help!

I am not sure about the functions you're referencing to, but:

The term $$ \sum_{i=1}^{N}\sum_{j=1}^{N}{w_{ij}x_ix_j} $$ is nothing more than the result of two matrix multiplications, you can also see this as an application of a bilinear form, so in fact you have $$ \sum_{i=1}^{N}\sum_{j=1}^{N}{w_{ij}x_ix_j}=x^t W x\in\mathbb R $$ where $W=\begin{pmatrix}w_{11}&w_{12}&\ldots\\\w_{21}&\ddots\\\\\vdots\end{pmatrix}\in \mathbb R^{N\times N}$ and $x\in\mathbb R^N$. So it is somehow a weighted "scalar product", also the property of being a scalar product actually depends on the weight matrix $W$ (like being symmetric etc.).

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 99343127f42473936d6bdeb681f4881d