All matrices are real and $n \times n$. The matrix $A$ is given. I am interested in solving $XA=XAX$. In particular, I would like some characterization of matrices that satisfy this equation.
For instance, a useful characterization would be: any valid $X$ is related in some concrete way to the row space of $A$, or any valid $X$ is related in some way to the eigenvectors of $A$. I want to describe the set of admissible $X$es in terms of some known decomposition of $A$ or some property of $A$.
In case this leads to a larger set of admissible solutions, I am also interested, as a separate problem, in the complex relaxation, i.e. $A$ is real but $X$ can be complex.
I apologize if my question is very trivial - I have no experience solving matrix equations like that. In case my question is a special case of some long-established theory, please just point me to a book or an article.