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!
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.).