# Rewriting matrix

I've been trying to rewrite the matrix $\left( \begin{array}{cccc} x_{n} & x_{1} & x_{2} & \cdots & x_{n-1} \\ x_{1} & x_{n} & 0 &\cdots & 0 \\ x_{2} & 0& \ddots & 0 & \vdots\\ \vdots & \vdots& & \ddots \\ x_{n-1} & 0 & \cdots & & x_{n} \end{array} \right)$

into the form $-A_{0}+\sum_{k=1}^{n}A_{k}x_{k}$ for matrices $A_{k}$ and scalars $x_{k}$.

Could anyone help me with this?

The main problem I have is that $\sum_{k=1}^{n}A_{k}x_{k}$ gives a vector and im suppose to add this to the matrix $-A_{0}$? How does one add a vector to a matrix in this context?

-
What are the $A_i$ ? if all of them, for example, are the zero matrix then there is no solution. you might want to add some more details – Belgi Nov 11 '12 at 17:20
For the downvoters: Instead of voting down, explain why the reasoning is incorrect. This is a legitimate question with a legitimate (very incorrect) approach from a student. – Pragabhava Nov 11 '12 at 17:22
The $A_{i}$ are matrices yet to be defined such that $-A_{0}+\sum A_{k}x_{k}$ becomes the matrix given above? – Math Girl Nov 11 '12 at 17:33
@MathGirl I'm very rusty in my linear algebra theorems, and I was waiting for a more oriented people to answer this, but the way matrix multiplication is defined, you can only multiply a $n \times m$ matrix with a $m \times p$ one, and the result is a $n \times p$ matrix. In your case, a $n \times n$ matrix plus a $n \times 1$ matrix (vector), will lead to a $n \times 1$ matrix. Addition of matrices is only defined for matrices with the same dimensions, and there is why you'll never be able to express your matrix the way you want. – Pragabhava Nov 11 '12 at 17:44
My linear algebra is not excellent but I do understand that which is the main reason why I'm so confused. I haven't thought of it myself btw. $-A_{0}+\sum A_{k}x_{k}$ is the constraint for the primal semidefinite program in convex optimization. I am simply trying to find someone who can help me interprete this.. – Math Girl Nov 11 '12 at 17:51

Call $A$ your matrix, and, for every $1\leqslant i\leqslant n$, $A_i$ the matrix $A$ when every $x_k$ is zero except $x_i=1$ (for example, $A_n=I$). Then $A=\sum\limits_{i=1}^nx_iA_i$ (hence there is no $A_0$).
Note that $A$ and every $A_i$ are $n\times n$ matrices while every $x_i$ is a scalar. Recall that if $y$ is a scalar and $B=(B_{kj})_{kj}$ a matrix, then $yB$ is the matrix of the same size as $B$ with entries $(yB_{kj})_{kj}$.
Ah apologies $x$ is the vector with the entries $x_{k}$. It all makes a lot more sense now.. – Math Girl Nov 11 '12 at 19:04