Notation for element-wise multiplication of vector and matrix columns

5.7k Views Asked by At

What is a clear and concise notation for the element wise multiplication (Hadamard product) of a column vector $v$ and each column of a matrix $F$.

What I want to achieve it this: $$ v\odot F= \begin{bmatrix} v_1\\ v_2 \\ v_3 \end{bmatrix} \odot \begin{bmatrix} f_{1,1} & f_{1,2} & f_{1,3}\\ f_{2,1} & f_{2,2} & f_{2,3}\\ f_{3,1} & f_{3,2} & f_{3,3} \end{bmatrix} = \begin{bmatrix} v_1f_{1,1} & v_1f_{1,2} & v_1f_{1,3}\\ v_2f_{2,1} & v_2f_{2,2} & v_2f_{2,3}\\ v_3f_{3,1} & v_3f_{3,2} & v_3f_{3,3} \end{bmatrix} $$

My question is essentially the same as this one, but I don't think the answer there actually answers the question and I don't have enough reputation to comment.

2

There are 2 best solutions below

4
On BEST ANSWER

The elementwise/Hadamard product $(\circ)$ and the all-ones vector ${\tt1}$ can be used to write your product as $$v\odot F = v{\tt1}^T\circ F$$ You can also write it using a diagonal matrix and the regular matrix product as $$v\odot F = \operatorname{Diag}(v)\,F$$ as suggested in John's answer.

This is actually a special case of a more general rule, i.e. $$ab^T\circ F = \operatorname{Diag}(a)\,F\,\operatorname{Diag}(b)$$

0
On

I would tend to write this as $$ P = diag(v) F $$ having first defined $$ diag: \Bbb R^n \to M_{nn}$$ as clearly as possible.