I have a square matrix $N\times N$: $$A_{ij}=a_{ij}S_i \text{ [no sum over repeated index] }$$
and I want to decompose it in the form:
$$A=BC$$ where $$B_{ij}=B_{ij}(S_1,S_2,...,S_N)\ \ \ ,\ \ \ C_{ij}=a_{ij}$$
In other words: having a N-component vector $\bf{S}$ and a square matrix $N\times N$, say C, what is the operation that allows me to multiply the $i$-th row of $C$ by $S_i$?
you can pre-multiply the matrix by the diagonal matrix with $S_i$ on the diag. For example, suppose we have a matrix: $$A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1N} \\ \vdots & \vdots & \vdots & \vdots \\ a_{N1} & a_{N2} & \cdots & a_{NN} \\ \end{pmatrix} $$ and a diagonal matrix $$S = \begin{pmatrix} S_{1} & 0 & \cdots & 0 \\ 0 & S_{2} & 0 & \cdots \\ \vdots & & \ddots & \vdots \\ 0 & \cdots & 0 & S_{N} \\ \end{pmatrix} $$ then the pre-multiplication of $S$ gives $$ SA = \begin{pmatrix} S_1 a_{11} & S_1 a_{12} & \cdots & S_1 a_{1N} \\ \vdots & \vdots & \vdots & \vdots \\ S_N a_{N1} & S_N a_{N2} & \cdots & S_N a_{NN} \\ \end{pmatrix} $$