Let $D \in \mathbb{R}^{n\times n}$ be a read-valued diagonal matrix and $v, w \in \mathbb{R}^{n}$ be two vectors. Is there some nice way to compute trace of $Dvw^T$?
I am asking this question because of some Frobenius norm optimization problem. could you help me please?
Let $v=( v_{1},v_{2},...,v_{n})$ and $w=(w_{1},w_{2},...,w_{n})$ then diagonal entries of $v w^{T}$ is $v_{1}w_{1},v_{2}w_{2},...,v_{n}w_{n}$. Hence diagonal entries in $D v w^{T}$ is the product of respective diagonal entries in the two matrices (as $D$ is a diagonal matrix) i.e. diagonal entries of $D v w^{T}$ are $a_{1}v_{1}w_{1},a_{2}v_{2}w_{2},...,a_{n}v_{n}w_{n}$ where $ a_{1},a_{2},...,a_{n}$ are the diagonal entries in $D$. Hence the trace is $a_{1}v_{1}w_{1}+a_{2}v_{2}w_{2}+...+a_{n}v_{n}w_{n}$.