Solution (source code)

= Solution

Let $P$ have the old domain <basis> as columns, $C$ the old codomain <basis>, and $D$ the new codomain <basis>. Change of coordinates gives $A\prime=D^{-1}CAP^{-1}$, hence
$$
A\prime=\begin{pmatrix}1&4&3\\0&-3&-1\end{pmatrix}.
$$